owncloud / music

:notes: Music app for ownCloud
GNU Affero General Public License v3.0
568 stars 198 forks source link

"Invalid session token" for Ampache clients since Nextcloud 20 upgrade #791

Closed gloomytrousers closed 3 years ago

gloomytrousers commented 4 years ago

Since (I think) the upgrade to Nextcloud 20, Power Ampache has failed to connect to the Music app. The error is:

Ampache error code:401 error: Invalid Login - invalid session token

I tried generating a new app password and using that, but got the same result.

I've also just installed AmDroid to try it; that gives "Error: Invalid Login - invalid session token" too.

The Nextcloud log contains lots of these (just a warning):

{"reqId":"X4r9Dxf1VONOiH-9LhY3SwAAARQ","level":0,"time":"2020-10-17T14:17:51+00:00","remoteAddr":"xxxxxxxxx","user":"--","app":"twofactor_totp","method":"GET","url":"/nextcloud/index.php/apps/music/ampache/server/xml.server.php?auth=","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Dalvik/2.1.0 (Linux; U; Android 9; SM-G900F Build/PQ3A.190801.002)","version":"20.0.0.9"}

And one of these for each failing request:

{"reqId":"X4r9Dxf1VONOiH-9LhY3SwAAARQ","level":0,"time":"2020-10-17T14:17:51+00:00","remoteAddr":"xxxxxxxxx","user":"--","app":"music","method":"GET","url":"/nextcloud/index.php/apps/music/ampache/server/xml.server.php?auth=","message":"Invalid Login - session token missing","userAgent":"Dalvik/2.1.0 (Linux; U; Android 9; SM-G900F Build/PQ3A.190801.002)","version":"20.0.0.9"}

This is with the latest release of the Music app, 0.16.0.

paulijar commented 4 years ago

@gloomytrousers Thanks for the report. There seems to be a weird bug in Nextcloud 20, which I just reported for the server: One of the URL arguments from the Ampache client is eaten up by the Nextcloud server before it reaches the Music app. Without this argument, none of the Ampache API calls can work.

Which application is "AmDroid", or did you mean Amproid? Note that Music 0.16.0 does not support Amproid because it requires Ampache API v4.x, while Music currently implements API v3.5. This will change with Music v0.17.0 which should be released very soon.

gloomytrousers commented 4 years ago

@paulijar thanks for the speedy reply - I'll watch the other bug.

AmDroid is https://github.com/Dejvino/amdroid installed from the f-droid app store for Android. It's pretty old actually - I just wanted another app to test with.

stefangweichinger commented 4 years ago

Updated the Music App right now, I still get the "session token" error when I try to connect/sync via SubMusic on my Garmin Fenix 6X Pro:

https://github.com/memen45/SubMusic/issues/6

Yes, NC20.

paulijar commented 4 years ago

@stefangweichinger Yes, updating the Music app doesn't help here because this issue is in the NC20 core.

stefangweichinger commented 4 years ago

@paulijar Ah, I see, so I have to wait for https://github.com/nextcloud/server/issues/23544 to be fixed, right? thanks

paulijar commented 4 years ago

@stefangweichinger Yes, nothing will happen to this bug before there is some resolution for nextcloud/server#23544. But once that happens, I will post an update here, too.

paulijar commented 3 years ago

If you are interested to monkey patch you Nextcloud installation, see https://github.com/nextcloud/server/issues/23544#issuecomment-736012528 for a possible solution. This comes with no guarantees, but it seems to fix the issue. Please report if you do this and notice any side effects.

paulijar commented 3 years ago

The fix for the root cause of this problem has been merged to the stable20 branch yesterday. I believe that this means that the fix will make it to the Nextcloud version 20.0.5 which is scheduled to be released on 2021-01-14.

paulijar commented 3 years ago

The Nextcloud version 20.0.5 is now out and it has been verified that the Ampache API works on it. Closing.