nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
450 stars 56 forks source link

Exception while generating all previews during setup #300

Closed ghost closed 2 years ago

ghost commented 2 years ago

I tried setting up the PreviewGenerator app using the offical guide in the Nextcloud app store.

When running preview:generate-all -vvv an exception was thrown on an mp3 file. Other mp3 files were processed without problem.

This is the exception from the output:

An unhandled exception has been thrown:
TypeError: decbin(): Argument #1 ($num) must be of type int, string given in /var/www/html/3rdparty/christophwurst/id3parser/src/getID3/getid3_lib.php:305
Stack trace:
#0 /var/www/html/3rdparty/christophwurst/id3parser/src/getID3/getid3_lib.php(305): decbin('\x00\x00')
#1 /var/www/html/3rdparty/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php(1875): ID3Parser\getID3\getid3_lib::Dec2Bin('\x00\x00')
#2 /var/www/html/3rdparty/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php(338): ID3Parser\getID3\Tags\getid3_id3v2->ParseID3v2Frame(Array)
#3 /var/www/html/3rdparty/christophwurst/id3parser/src/getID3/getid3.php(164): ID3Parser\getID3\Tags\getid3_id3v2->Analyze()
#4 /var/www/html/3rdparty/christophwurst/id3parser/src/ID3Parser.php(20): ID3Parser\getID3\getid3->analyze('/var/www/html/d...')
#5 /var/www/html/lib/private/Preview/MP3.php(51): ID3Parser\ID3Parser->analyze('/var/www/html/d...')
#6 /var/www/html/lib/private/Preview/GeneratorHelper.php(62): OC\Preview\MP3->getThumbnail(Object(OC\Files\Node\File), 4096, 4096)
#7 /var/www/html/lib/private/Preview/Generator.php(246): OC\Preview\GeneratorHelper->getThumbnail(Object(OC\Preview\MP3), Object(OC\Files\Node\File), 4096, 4096)
#8 /var/www/html/lib/private/Preview/Generator.php(141): OC\Preview\Generator->getMaxPreview(Object(OC\Files\SimpleFS\SimpleFolder), Object(OC\Files\Node\File), 'audio/mpeg', '')
#9 /var/www/html/lib/private/PreviewManager.php(227): OC\Preview\Generator->generatePreviews(Object(OC\Files\Node\File), Array, 'audio/mpeg')
#10 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(234): OC\PreviewManager->generatePreviews(Object(OC\Files\Node\File), Array)
#11 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(205): OCA\PreviewGenerator\Command\Generate->parseFile(Object(OC\Files\Node\File))
#12 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(174): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#13 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(122): OCA\PreviewGenerator\Command\Generate->generatePathPreviews(Object(OC\User\User), '/ben/files/Musi...')
#14 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\PreviewGenerator\Command\Generate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\PreviewGenerator\Command\Generate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/console.php(99): OC\Console\Application->run()
#20 /var/www/html/occ(11): require_once('/var/www/html/c...')
#21 {main}

Rerunning the command on the path that caused the issue keeps throwing this Exception.

Seems to be related to #249 and JamesHeinrich/getID3/issues/299

Since the issue was resolved and merged there and was caused by a 3rd party library, I am not sure whether this issue belongs here.

Praetorian1410 commented 2 years ago

Can confirm I also have this issue on a docker-compose Nextcloud Installation (also because of the mentioned 3rd party id3 library). I'm also on PHP 8.0.19 / NC 23.0.5. @mrbenjoi: https://github.com/nextcloud/3rdparty/pull/966 may be the reason why this is still an issue.

st3iny commented 2 years ago

The backports failed which means that the bug is only fixed in Nextcloud 24 and newer. I can give it another shot but can't make any promises. I'll update you if I succeed.

st3iny commented 2 years ago

I have good news: The backports went through this time. The fix will be included in upcoming Nextcloud patch releases 22.2.9 and 23.0.6.

Praetorian1410 commented 2 years ago

Cheers mate, made my day ;)