Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stops working after a period of time #38

Open
tuxcomputers opened this issue May 9, 2024 · 13 comments
Open

Stops working after a period of time #38

tuxcomputers opened this issue May 9, 2024 · 13 comments

Comments

@tuxcomputers
Copy link
Contributor

I have connected AntennaPod to the server, it will work for a period of time and then start failing.

To get it working again I have to logout of AntennaPod and then connect it again.

I turned on the debug and saw this
image

I then looked at your code and saw this
image

I am not familiar with PHP enough but I think this means AntennaPod is broken and not sending the user name across, right?

@tuxcomputers
Copy link
Contributor Author

After logging out and reconnecting I synced AntennaPod and once finished all the initial stuff I hit Synchronise now, the debug looks like this
image

@tuxcomputers
Copy link
Contributor Author

So my thinking was that because Antennapod doe snot have access to my server at home while I am out and about something something then it starts failing.

To check that I made a server that is publicly available at all times:
https://gpodder.tux.com.au

Nope it still ends up timing out, I have enabled the debug on the new server. The plan is to reconnect the phone to server then parse the logs to find out the time period it takes to start failing

@tuxcomputers
Copy link
Contributor Author

I just updated to the latest code and will continue to monitor.

@tuxcomputers
Copy link
Contributor Author

It seems like the time is about 1/2 hour
image

@bohwaz
Copy link
Collaborator

bohwaz commented May 16, 2024

I have the same issue, not sure what is causing this currently.

@tuxcomputers
Copy link
Contributor Author

Here is what I did as a hacky awful workaround.

  1. AntennaPod fails
  2. Kill the app
  3. Open the app
  4. Sync

I got the PHP to show me the cookie value, here it is before and after I killed the app
image

So AntennaPod does not even try to use the sessionid cookie when it has been killed. I wonder what the expiry of the cookie is and if AntennaPod cares.

@tuxcomputers
Copy link
Contributor Author

@bohwaz are you using Antenna Pod as well? It could be a change in that not your server.

@bohwaz
Copy link
Collaborator

bohwaz commented May 29, 2024

Yes AntennaPod as well.

I just changed the HTTP status code in this case to 401, maybe that will trigger AntennaPod to restart the authentication dance if the cookie has expired.

Tell me if the error comes back after upgrading to the latest version.

@sezuan
Copy link

sezuan commented Jun 6, 2024

Hi!

I observe the same problem, but it doesn't seem to help. Seems that Antennapod is not reauthenticating:

127.0.0.1 - matthias [06/Jun/2024:09:54:30 +0200] "POST /api/2/auth/matthias/login.json HTTP/1.1" 400 73 "-" "AntennaPod/3.4.0"
127.0.0.1 - matthias [06/Jun/2024:09:54:32 +0200] "POST /api/2/auth/matthias/login.json HTTP/1.1" 400 73 "-" "AntennaPod/3.4.0"
<updated API.php>
127.0.0.1 - matthias [06/Jun/2024:09:55:08 +0200] "POST /api/2/auth/matthias/login.json HTTP/1.1" 401 73 "-" "AntennaPod/3.4.0"
127.0.0.1 - matthias [06/Jun/2024:09:55:11 +0200] "POST /api/2/auth/matthias/login.json HTTP/1.1" 401 73 "-" "AntennaPod/3.4.0"
127.0.0.1 - matthias [06/Jun/2024:09:55:12 +0200] "POST /api/2/auth/matthias/login.json HTTP/1.1" 401 73 "-" "AntennaPod/3.4.0"

@bohwaz
Copy link
Collaborator

bohwaz commented Jun 6, 2024

This happens when the client is sending a cookie linked to an expired session (PHP sessions expire after 30 minutes by default, if I remember correctly).

bohwaz added a commit that referenced this issue Jun 6, 2024
@bohwaz
Copy link
Collaborator

bohwaz commented Jun 6, 2024

It might be that AntennaPod is providing the Authorization AND the expired session cookie. oPodSync is using the cookie first. I changed so that if Authorization is provided, cookie is ignored and replaced.

Let me know if that changes things. I also changed the error message to make it clearer.

@sezuan
Copy link

sezuan commented Jun 7, 2024

It works now. I couldn't duplicated it anymore. Thank you!

@jesusmgg
Copy link

I was also experiencing the issue and an update to the latest code seems to have fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants