opodsync icon indicating copy to clipboard operation
opodsync copied to clipboard

Stops working after a period of time

Open tuxcomputers opened this issue 1 year ago • 13 comments

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 avatar May 09 '24 21:05 tuxcomputers

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 avatar May 09 '24 21:05 tuxcomputers

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 avatar May 14 '24 22:05 tuxcomputers

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

tuxcomputers avatar May 14 '24 23:05 tuxcomputers

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

tuxcomputers avatar May 15 '24 03:05 tuxcomputers

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

bohwaz avatar May 16 '24 11:05 bohwaz

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 avatar May 18 '24 09:05 tuxcomputers

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

tuxcomputers avatar May 22 '24 02:05 tuxcomputers

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.

bohwaz avatar May 29 '24 17:05 bohwaz

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"

sezuan avatar Jun 06 '24 08:06 sezuan

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 avatar Jun 06 '24 22:06 bohwaz

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.

bohwaz avatar Jun 06 '24 22:06 bohwaz

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

sezuan avatar Jun 07 '24 04:06 sezuan

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

jesusmgg avatar Jul 15 '24 15:07 jesusmgg

Thanks for the feedback. Closing this issue if everything is fine.

bohwaz avatar Oct 15 '24 13:10 bohwaz