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

four mp3s that create an error #856

Closed
mrtxmrtx opened this issue May 12, 2021 · 6 comments
Closed

four mp3s that create an error #856

mrtxmrtx opened this issue May 12, 2021 · 6 comments
Labels

Comments

@mrtxmrtx
Copy link

When scanning my music with Music v1.1.0 on Nextcloud 21.0.1 it stopped on four of my mp3-files. I changed the name of the file to 09.mp3 but that did not help. Removing all mp3-tags solved the problem. I did not recognize something special in the mp3-tags.

This ist what happened:

sudo -u www-data /var/www/nextcloud/occ music:scan Saraya
Start scan for Saraya
Found 1 music files to scan
Scanning /saraya/files/0/mm/Musik/Pool/Siggi/Disrupters/anarchy peace and chips soundtrack/disrupters - anarchy peace and chips soundtrack - 09 - im still here (demo).mp3
An unhandled exception has been thrown:
ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.tag.id3v2.php:999
Stack trace:
#0 /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.tag.id3v2.php(999): strpos()
#1 /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.tag.id3v2.php(355): getid3_id3v2->ParseID3v2Frame()
#2 /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php(675): getid3_id3v2->Analyze()
#3 /var/www/nextcloud/apps/music/lib/Utility/ExtractorGetID3.php(74): getID3->analyze()
#4 /var/www/nextcloud/apps/music/lib/Utility/Scanner.php(183): OCA\Music\Utility\ExtractorGetID3->extract()
#5 /var/www/nextcloud/apps/music/lib/Utility/Scanner.php(134): OCA\Music\Utility\Scanner->extractMetadata()
#6 /var/www/nextcloud/apps/music/lib/Utility/Scanner.php(109): OCA\Music\Utility\Scanner->updateAudio()
#7 /var/www/nextcloud/apps/music/lib/Utility/Scanner.php(481): OCA\Music\Utility\Scanner->update()
#8 /var/www/nextcloud/apps/music/lib/Command/Scan.php(117): OCA\Music\Utility\Scanner->scanFiles()
#9 /var/www/nextcloud/apps/music/lib/Command/Scan.php(91): OCA\Music\Command\Scan->scanUser()
#10 /var/www/nextcloud/apps/music/lib/Command/BaseCommand.php(63): OCA\Music\Command\Scan->doExecute()
#11 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Music\Command\BaseCommand->execute()
#12 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#15 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#16 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#17 /var/www/nextcloud/occ(11): require_once('...')
#18 {main}Speicherzugriffsfehler

This is the beginning of one of the mp3-files with the interfering tags:

00000000 49 44 33 04 00 00 00 00 0F 76 54 43 4F 4E 00 00 ID3......vTCON..
00000010 00 01 00 00 00 55 53 4C 54 00 00 00 02 00 00 00 .....USLT.......
00000020 00 54 49 54 32 00 00 00 17 00 00 00 49 27 6D 20 .TIT2.......I'm
00000030 53 74 69 6C 6C 20 48 65 72 65 20 28 44 65 6D 6F Still Here (Demo
00000040 29 00 54 50 45 31 00 00 00 0C 00 00 00 44 69 73 ).TPE1.......Dis
00000050 72 75 70 74 65 72 73 00 54 41 4C 42 00 00 00 24 rupters.TALB...$
00000060 00 00 00 41 6E 61 72 63 68 79 20 50 65 61 63 65 ...Anarchy Peace
00000070 20 61 6E 64 20 43 68 69 70 73 20 53 6F 75 6E 64 and Chips Sound
00000080 74 72 61 63 6B 00 54 52 43 4B 00 00 00 03 00 00 track.TRCK......
00000090 00 39 00 54 44 52 43 00 00 00 06 00 00 00 32 30 .9.TDRC.......20
000000A0 30 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03..............

@paulijar
Copy link
Collaborator

Thanks for the report. Could you share one of those files with the problem with me? You can find my email address from my github profile.

Judging by the stack trace, the root cause is probably within getID3 library which we use for the metadata extraction. But maybe I could prevent the whole scanning process from stopping even if the library throws an unexpected exception. Anyway, if I can reproduce this using the demo app of getID3, then I can report this onwards to the github of the library.

@paulijar paulijar added the Bug label May 12, 2021
@paulijar
Copy link
Collaborator

Ok, I got the sample file. Interestingly, this doesn't break the scan for me and the error is not printed to the console when using occ music:scan. But I do find error message similar to the OP from nextcloud.log. Maybe the exact behavior depends on the PHP version used and/or its settings. I was using PHP 7.4.

@mrtxmrtx
Copy link
Author

I am using php 8.0.5, mysql 10.5.10

@paulijar
Copy link
Collaborator

Okay, the PHP version seems to be the key here. This site tells, that passing an invalid offset to strpos function throws a ValueError starting from PHP8.0 while it previously emitted a warning.

@mrtxmrtx
Copy link
Author

Thank you for looking into it.

@paulijar
Copy link
Collaborator

Music v1.2.1 with an updated getID3 version was just released. It should fix also this issue with PHP8.

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

No branches or pull requests

2 participants