-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Incorrect string attribution breaking with PHP 7.1 #123
Comments
There are more points of contention, audioplayer now scans, but it's still not working with the same issue on other places: {"reqId":"WIR7X8YGIWAuDMbNKNZZrAAAAAA","remoteAddr":"192.168.3.30","app":"index","message":"Exception: {"Exception":"Error","Message":"[] operator not supported for strings","Code":0,"Trace":"#0 \/var\/www\/html\/nextcloud\/apps\/audioplayer\/controller\/categorycontroller.php(61): OCA\\audioplayer\\Controller\\CategoryController->getCategoryforUser('Folder')\n#1 [internal function]: OCA\\audioplayer\\Controller\\CategoryController->getCategory()\n#2 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(160): call_user_func_array(Array, Array)\n#3 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(90): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\audioplayer\\Controller\\CategoryController), 'getCategory')\n#4 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/App.php(114): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\audioplayer\\Controller\\CategoryController), 'getCategory')\n#5 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main('OCA\\\\audioplayer...', 'getCategory', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#6 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#7 \/var\/www\/html\/nextcloud\/lib\/private\/Route\/Router.php(299): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#8 \/var\/www\/html\/nextcloud\/lib\/base.php(1010): OC\\Route\\Router->match('\/apps\/audioplay...')\n#9 \/var\/www\/html\/nextcloud\/index.php(40): OC::handleRequest()\n#10 {main}","File":"\/var\/www\/html\/nextcloud\/apps\/audioplayer\/controller\/categorycontroller.php","Line":135}","level":3,"time":"2017-01-22T09:29:03+00:00","method":"GET","url":"/index.php/apps/audioplayer/getcategory?category=Folder","user":"USER","version":"11.0.1.2"} But the pattern here is't $var[...][] = "string" but probably $var[]="string" OR the script above did a bit more than it should :) However I verified by uninstalling audioplayer and reinstalling it again, after the successful scan, that the [] problem persists with original untouched code. |
DON'T RUN THE "fix", it does make scan run but it indeed breaks things up, I've cleared the tables and scanned again and noticed that artists and albums wasn't being populated with errors on the nextcloud.log about invalid arguments to foreach so... yeah, a more troublesome manual fix might be needed :) |
Hello @rseabra |
Hi @Rello, The "fix" that's in the bug report. The issue happens also outside of the third party id3 library. For now I'm "fixing" it more successfully with grep -r 'error.][]' * | cut -d : -f 1 | sort -u | while read F ; do sed -i -e "s,error'][] =,error'] =," $F ; done But there are still errors like: These maybe are from those with the fix you mention. Do you have any eta for a fixed version of audioplayer? |
Hello, if you download the current repo directly from GIT and copy/paste it into your /apps folder, you could give it a try. its flagged as 1.4.1-beta.2
|
|
Will do and report back. |
BTW, this is one such example: {"reqId":"WISSDdBIC5ZL7-A39oczJgAAAAQ","remoteAddr":"192.168.3.30","app":"index","message":"Exception: {"Exception":"Error","Message":"Cannot use string offset as an array","Code":0,"Trace":"#0 \/var\/www\/html\/nextcloud\/apps\/audioplayer\/controller\/musiccontroller.php(160): OCA\\audioplayer\\Controller\\MusicController->loadSongs()\n#1 [internal function]: OCA\\audioplayer\\Controller\\MusicController->getMusic()\n#2 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(160): call_user_func_array(Array, Array)\n#3 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(90): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\audioplayer\\Controller\\MusicController), 'getMusic')\n#4 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/App.php(114): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\audioplayer\\Controller\\MusicController), 'getMusic')\n#5 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main('OCA\\\\audioplayer...', 'getMusic', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#6 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#7 \/var\/www\/html\/nextcloud\/lib\/private\/Route\/Router.php(299): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#8 \/var\/www\/html\/nextcloud\/lib\/base.php(1010): OC\\Route\\Router->match('\/apps\/audioplay...')\n#9 \/var\/www\/html\/nextcloud\/index.php(40): OC::handleRequest()\n#10 {main}","File":"\/var\/www\/html\/nextcloud\/apps\/audioplayer\/controller\/musiccontroller.php","Line":273}","level":3,"time":"2017-01-22T11:05:49+00:00","method":"GET","url":"/index.php/apps/audioplayer/getmusic","user":"USER","version":"11.0.1.2"} And audioplayer just shows a spinning wheel on center of the page and no albums show up. |
Yeah, it works! Even the one on your "side" works, @Rello . Thanks for fixing it. How do git downloaded apps interact with Nextcloud's app management? When a new stable comes out, will it offer me to "update" to it? |
Well, fixing this one lead to opening #124 as a performance issue. I'd like to help more, but I'm not experienced enough in PHP for this sort of thing, only hackish stuff like those greps :) |
hello, the version management will be fine because now you have a ...beta2 installed. thank you very much for your testing support. helped a lot |
Expected behavior
No PHP stack trace.
Actual behavior
PHP stack trace and not files scanned.
Start scan for USER
An unhandled exception has been thrown:
Error: [] operator not supported for strings in /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/module.audio.mp3.php:926
Stack trace:
#0 /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/module.audio.mp3.php(1088): getid3_mp3->decodeMPEGaudioHeader(572, Array, false)
#1 /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/module.audio.mp3.php(973): getid3_mp3->RecursiveFrameScanning(572, 989, false)
#2 /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/module.audio.mp3.php(1430): getid3_mp3->decodeMPEGaudioHeader(572, Array, true)
#3 /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/module.audio.mp3.php(35): getid3_mp3->getOnlyMPEGaudioInfo(572)
#4 /var/www/html/nextcloud/apps/audioplayer/3rdparty/getid3/getid3.php(463): getid3_mp3->Analyze()
#5 /var/www/html/nextcloud/apps/audioplayer/controller/scannercontroller.php(541): getID3->analyze('/var/lib/cloud/...')
#6 /var/www/html/nextcloud/apps/audioplayer/command/scan.php(87): OCA\audioplayer\Controller\ScannerController->scanForAudios('USER', Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#7 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(256): OCA\audioplayer\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(818): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(OCA\audioplayer\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/nextcloud/lib/private/Console/Application.php(169): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/nextcloud/console.php(90): OC\Console\Application->run()
#13 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#14 {main}
Steps to reproduce the behavior
Possible solution (optional)
grep -r '][]' * | cut -d : -f 1 | sort -u | while read F ; do sed -i -e 's,][],],' $F ; done
sudo -u apache php occ audioplayer:scan USER
Start scan for USER
Audios found: 1302
Duplicates found: 0
Written to music library: 1300
Albums found: 0
Errors: 2
Server configuration
Operating system:
CentOS 7
Web server:
Apache 2.4
PHP version:
7.1
ownCloud/Nextcloud version: (see
/status.php
)11 and 11.0.1
Audio Player version: (see
/settings/apps
)1.4.0
Where did you install Audio Player from:
Apps in Nextcloud
The text was updated successfully, but these errors were encountered: