[GH-ISSUE #1727] Music import fails with bad ID3 metadata #949

Closed
opened 2026-02-26 02:34:43 +03:00 by kerem · 4 comments
Owner

Originally created by @volcs0 on GitHub (Dec 18, 2023).
Original GitHub issue: https://github.com/koel/koel/issues/1727

Describe the bug
When the music importer hits a file with missing/wrong/some other metadata, it crashes.

To reproduce
Steps to reproduce the behavior:

run: php artisan koel:sync
against my music library

When it hits a file with corrupt metadata, the import crashes.
When I re-write the metadata using MusicBrainz Picard, the import proceeds normally (until the next bad track).

A clear and concise description of what you expected to happen.

Expect the import to continue without stopping.
If there is a flag to have it continue, even when it encounters a problem, I don't know what it is.

Screenshots
Screenshot attached.

Environment

  • Koel version 6.11.12
  • OS: Linux
  • Browser: Edge, Chrome
  • PHP version 8.1.8
  • Node version : unknown
Screenshot 2023-12-17 at 23 11 24
Originally created by @volcs0 on GitHub (Dec 18, 2023). Original GitHub issue: https://github.com/koel/koel/issues/1727 _**Describe the bug**_ When the music importer hits a file with missing/wrong/some other metadata, it crashes. _**To reproduce**_ Steps to reproduce the behavior: run: php artisan koel:sync against my music library When it hits a file with corrupt metadata, the import crashes. When I re-write the metadata using MusicBrainz Picard, the import proceeds normally (until the next bad track). _A clear and concise description of what you expected to happen._ Expect the import to continue without stopping. If there is a flag to have it continue, even when it encounters a problem, I don't know what it is. _**Screenshots**_ Screenshot attached. _**Environment**_ - Koel version 6.11.12 - OS: Linux - Browser: Edge, Chrome - PHP version 8.1.8 - Node version : unknown <img width="1334" alt="Screenshot 2023-12-17 at 23 11 24" src="https://github.com/koel/koel/assets/799188/a4f5de24-3d8d-46f6-bafe-67529fd276a7">
kerem closed this issue 2026-02-26 02:34:43 +03:00
Author
Owner

@phanan commented on GitHub (Dec 23, 2023):

Hey, sorry this happened to you. As you have correctly identified, this happens with weird corrupted files where even getId3 crashes (it normally gracefully handles exceptions). I thought about wrapping every single file scan in a try/catch block, but this would come with some performance cost (especially for huge libraries), so I'm still on the fence about it.

For artist images: You need Spotify integration enabled and configured.

<!-- gh-comment-id:1868317309 --> @phanan commented on GitHub (Dec 23, 2023): Hey, sorry this happened to you. As you have correctly identified, this happens with weird corrupted files where even getId3 crashes (it normally gracefully handles exceptions). I thought about wrapping every single file scan in a try/catch block, but this would come with some performance cost (especially for huge libraries), so I'm still on the fence about it. For artist images: You need Spotify integration enabled and configured.
Author
Owner

@h4dr05 commented on GitHub (Dec 24, 2023):

Faced the same problem today. Any idea how to find out on which file it crashes, exactly?

<!-- gh-comment-id:1868557544 --> @h4dr05 commented on GitHub (Dec 24, 2023): Faced the same problem today. Any idea how to find out on which file it crashes, exactly?
Author
Owner

@volcs0 commented on GitHub (Dec 24, 2023):

Faced the same problem today. Any idea how to find out on which file it crashes, exactly?

Do the import from the command line with verbose logging.

php artisan koel:sync -vv

Then you should see which track(s) are causing the problem.
For each track/album that was causing the issue, it was easy to see why (usually a weird character).
I ended up doing a lot of renaming and using MusicBrainz Picard to re-write ID3 tags.
I had to do this >50 times - each time taking longer for the import to fail.
But after about 2 days, I was done, and now the library works.

Hope this helps.

<!-- gh-comment-id:1868560534 --> @volcs0 commented on GitHub (Dec 24, 2023): > Faced the same problem today. Any idea how to find out on which file it crashes, exactly? Do the import from the command line with verbose logging. # php artisan koel:sync -vv Then you should see which track(s) are causing the problem. For each track/album that was causing the issue, it was easy to see why (usually a weird character). I ended up doing a lot of renaming and using MusicBrainz Picard to re-write ID3 tags. I had to do this >50 times - each time taking longer for the import to fail. But after about 2 days, I was done, and now the library works. Hope this helps.
Author
Owner

@phanan commented on GitHub (Dec 25, 2023):

What @volcs0 suggested (thanks!) I'm aware that this is not the best, however, so I have implemented a sync log functionality in 1518196af0 and will tag once I have the time :) Sorry for the inconvenience.

<!-- gh-comment-id:1869060006 --> @phanan commented on GitHub (Dec 25, 2023): What @volcs0 suggested (thanks!) I'm aware that this is not the best, however, so I have implemented a sync log functionality in 1518196af09726a7ef002b54034e6ee76566b22a and will tag once I have the time :) Sorry for the inconvenience.
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#949
No description provided.