Skip to content
New issue

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

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

Already on GitHub? # to your account

[PHP] Error: Undefined offset: 1 at /var/www/html/apps/music/lib/Controller/SubsonicController.php#418 #988

Closed
mikaelkundert opened this issue Jun 16, 2022 · 2 comments

Comments

@mikaelkundert
Copy link

mikaelkundert commented Jun 16, 2022

Subsonic controller logs some errors apparently when client is trying to fetch cover art with undefined ID.

[PHP] Error: Undefined offset: 1 at /var/www/html/apps/music/lib/Controller/SubsonicController.php#418

GET /apps/music/subsonic/rest/getCoverArt.view?u=<username>&p=<password>&v=1.13.0&c=substreamer&f=json&size=200&id=undefined
from xxx.xxx.xxx.xxx at 2022-06-16T13:25:53+00:00
{"reqId":"ZI6FyZ5OjWm3vNwX3e7Z","level":3,"time":"2022-06-16T13:25:53+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"PHP","method":"GET","url":"/apps/music/subsonic/rest/getCoverArt.view?u=<username>&p=<password>&v=1.13.0&c=substreamer&f=json&size=200&id=undefined","message":"Undefined offset: 1 at /var/www/html/apps/music/lib/Controller/SubsonicController.php#418","userAgent":"Mozilla/5.0 (Linux; Android 12; SM-G970F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/102.0.5005.78 Mobile Safari/537.36","version":"23.0.5.1","exception":{"Exception":"Error","Message":"Undefined offset: 1 at /var/www/html/apps/music/lib/Controller/SubsonicController.php#418","Code":0,"Trace":[{"file":"/var/www/html/apps/music/lib/Controller/SubsonicController.php","line":418,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/html/apps/music/lib/Controller/SubsonicController.php","line":179,"function":"getCoverArt","class":"OCA\\Music\\Controller\\SubsonicController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"handleRequest","class":"OCA\\Music\\Controller\\SubsonicController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"62ab311594f18"}

Nextcloud Hub II, 23.0.5
Music 1.5.2

@paulijar
Copy link
Collaborator

It makes little sense for a client (Substreamer) to request album art for an album with ID "undefined". But maybe there should be a bit of sanity checking in the Music app.

paulijar added a commit that referenced this issue Jun 17, 2022
Basically all entity IDs in our Subsonic API implementation should be
of format "<type:string>-<number:int>". If the client passes an ID not
following this format, there is now a sensible error response and the
rest of the handling is aborted.

refs #988
@paulijar
Copy link
Collaborator

The sanity checking is now in place in Music v1.6.0.

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

No branches or pull requests

2 participants