[GH-ISSUE #813] koel:sync breaks on invalid Exif #572

Closed
opened 2026-02-26 02:33:35 +03:00 by kerem · 3 comments
Owner

Originally created by @kopf on GitHub (Sep 27, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/813

Affected version

v3.7.2 of koel. Using https://github.com/0xcaff/docker-koel .

Bug report

The following error occurs when performing a sync of my collection (running php artisan -vvv koel:sync inside the container):

  28390/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░]  27% 43 secs/2 mins 938.5 MiB03 - A Boy.mp3 has no changes – ignoring
  28391/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░]  27% 43 secs/2 mins 938.5 MiB01 - The Acrobat.mp3 has no changes – ignoring
  28392/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░]  27% 43 secs/2 mins 938.5 MiB02 - The Acrobat (Efdemin Remix).mp3 has no changes – ignoring

In File.php line 368:

  [ErrorException]
  exif_imagetype(): Read error!


Exception trace:
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at n/a:n/a
 exif_imagetype() at /var/www/html/app/Models/File.php:368
 App\Models\File->App\Models\{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:291
 Illuminate\Cache\Repository->remember() at /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:305
 Illuminate\Cache\CacheManager->__call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221
 Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/app/Models/File.php:373
 App\Models\File->getCoverFileUnderSameDirectory() at /var/www/html/app/Models/File.php:273
 App\Models\File->generateAlbumCover() at /var/www/html/app/Models/File.php:243
 App\Models\File->sync() at /var/www/html/app/Services/Media.php:84
 App\Services\Media->sync() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221
 Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/app/Console/Commands/SyncMedia.php:83
 App\Console\Commands\SyncMedia->syncAll() at /var/www/html/app/Console/Commands/SyncMedia.php:63
 App\Console\Commands\SyncMedia->handle() at n/a:n/a
 call_user_func_array() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
 Illuminate\Container\BoundMethod::call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:539
 Illuminate\Container\Container->call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:182
 Illuminate\Console\Command->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:167
 Illuminate\Console\Command->run() at /var/www/html/vendor/symfony/console/Application.php:918
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:222
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:129
 Symfony\Component\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
 Illuminate\Foundation\Console\Kernel->handle() at /var/www/html/artisan:35

I'd love to provide you with the file in question, but I can't work it out from the log, since the name of the file being scanned is logged after it's been processed. If you have any tips on how to figure out which file it is, please let me know.

Template questionnaire

Hey, thanks for contributing to Koel! To save time for both of us, please make sure these checkboxes are checked before submitting the issue:

  • You have read and followed closely the Wiki, Upgrade Guide, as well as Troubleshooting
  • The issue has not been reported before
  • This is not a "how to install on Windows" or "why is my npm messed up" question
  • You're a cool person

All checked? Now also make sure your issue

  • Is associated with a version. Or better yet, a commit.
  • Is as detailed as possible (ahem... OS, browser, steps to reproduce, maybe?)
  • Includes the error output if it's a bug/error report ("Whoops!" is not very helpful, you know)
  • Is in English, 因为我不说中文。
Originally created by @kopf on GitHub (Sep 27, 2018). Original GitHub issue: https://github.com/koel/koel/issues/813 # Affected version `v3.7.2` of koel. Using https://github.com/0xcaff/docker-koel . # Bug report The following error occurs when performing a sync of my collection (running `php artisan -vvv koel:sync` inside the container): ``` 28390/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░] 27% 43 secs/2 mins 938.5 MiB03 - A Boy.mp3 has no changes – ignoring 28391/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░] 27% 43 secs/2 mins 938.5 MiB01 - The Acrobat.mp3 has no changes – ignoring 28392/103807 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░] 27% 43 secs/2 mins 938.5 MiB02 - The Acrobat (Efdemin Remix).mp3 has no changes – ignoring In File.php line 368: [ErrorException] exif_imagetype(): Read error! Exception trace: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at n/a:n/a exif_imagetype() at /var/www/html/app/Models/File.php:368 App\Models\File->App\Models\{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:291 Illuminate\Cache\Repository->remember() at /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:305 Illuminate\Cache\CacheManager->__call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221 Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/app/Models/File.php:373 App\Models\File->getCoverFileUnderSameDirectory() at /var/www/html/app/Models/File.php:273 App\Models\File->generateAlbumCover() at /var/www/html/app/Models/File.php:243 App\Models\File->sync() at /var/www/html/app/Services/Media.php:84 App\Services\Media->sync() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221 Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/app/Console/Commands/SyncMedia.php:83 App\Console\Commands\SyncMedia->syncAll() at /var/www/html/app/Console/Commands/SyncMedia.php:63 App\Console\Commands\SyncMedia->handle() at n/a:n/a call_user_func_array() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 Illuminate\Container\BoundMethod::call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:539 Illuminate\Container\Container->call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:182 Illuminate\Console\Command->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:252 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:167 Illuminate\Console\Command->run() at /var/www/html/vendor/symfony/console/Application.php:918 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:222 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:129 Symfony\Component\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122 Illuminate\Foundation\Console\Kernel->handle() at /var/www/html/artisan:35 ``` I'd love to provide you with the file in question, but I can't work it out from the log, since the name of the file being scanned is logged *after* it's been processed. If you have any tips on how to figure out which file it is, please let me know. # Template questionnaire Hey, thanks for contributing to Koel! To save time for both of us, please make sure these checkboxes are checked before submitting the issue: - [x] You have read and followed closely the [Wiki](https://koel.phanan.net/docs), [Upgrade Guide](https://github.com/phanan/koel/releases), as well as [Troubleshooting](https://koel.phanan.net/docs/#/troubleshooting) - [x] The issue has not been reported before - [x] This is not a "how to install on Windows" or "why is my npm messed up" question - [x] You're a cool person All checked? Now also make sure your issue - [x] Is associated with a version. Or better yet, a commit. - [x] Is as detailed as possible (ahem... OS, browser, steps to reproduce, maybe?) - [x] Includes the error output if it's a bug/error report ("Whoops!" is not very helpful, you know) - [x] Is in English, 因为我不说中文。
kerem closed this issue 2026-02-26 02:33:35 +03:00
Author
Owner

@phanan commented on GitHub (Sep 27, 2018):

Hmm, I think this error is relevant. You can look at the function call in File.php and temporarily fix it there.

<!-- gh-comment-id:425105109 --> @phanan commented on GitHub (Sep 27, 2018): Hmm, I think [this error](https://secure.php.net/manual/de/function.exif-imagetype.php#79283) is relevant. You can look at the function call in `File.php` and temporarily fix it there.
Author
Owner

@kopf commented on GitHub (Sep 27, 2018):

Yep! Changing L368 to:

if ($cover && filesize($cover) > 11 && exif_imagetype($cover) === false) {

did the job. thanks. Shall I open a PR? I've literally 0 PHP experience, so I'm afraid I wouldn't be up to writing a test.

<!-- gh-comment-id:425109423 --> @kopf commented on GitHub (Sep 27, 2018): Yep! Changing L368 to: ``` if ($cover && filesize($cover) > 11 && exif_imagetype($cover) === false) { ``` did the job. thanks. Shall I open a PR? I've literally 0 PHP experience, so I'm afraid I wouldn't be up to writing a test.
Author
Owner

@phanan commented on GitHub (Sep 27, 2018):

Glad it works for you. I'm rewriting this part largely, so a PR isn't really necessary. Thanks for the offer though!

<!-- gh-comment-id:425110377 --> @phanan commented on GitHub (Sep 27, 2018): Glad it works for you. I'm rewriting this part largely, so a PR isn't really necessary. Thanks for the offer though!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#572
No description provided.