-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
Unique constraint errors (genre) on scan #1564
Comments
Confirmed, I've just hit the same issue. Interestingly, it only happens when run in a Docker container. The exact same binary (with the same database and library path) works when run outside it. EDIT: Scratch that, just tested it on another machine (same library, database, files, and docker image) and it works. Possibly an issue with that machine. EDIT2: Have ruled out environment differences. The instances on both machines inside the container have the exact same environment variables (except HOSTNAME):
This rules out any C locale screwery affecting ffmpeg or taglib. |
Root cause: #1918 |
* persistence/genre: change Put() to upsert Absolutely disgusting hack to work around [1]. Try to insert the genre, but if it conflicts, ignore it and update the genre with the existing ID. [1]: #1918. * scanner: remove cached genre repository Not needed anytmore. And remember: "Many Small Queries Are Efficient In SQLite" [1]. [1]: https://www.sqlite.org/np1queryprob.html * Revert "scanner: remove cached genre repository" This reverts commit c5d900a. * Use squirrel to build SQL, to reduce risk of SQL injection Co-authored-by: Deluan <deluan@navidrome.org>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
I am getting unique constraint errors in the scan log when scanning. I scan 2’855 Files in 239 Folders. Most of the scan log entries are infos.
Expected Behaviour
No contraint errors should happen / be logged.
Steps to reproduce
music
folderscan
Platform information
0.47.0 (8c7d95c1)
Ubuntu 20.04.3 LTS
deluan/navidrome:0.47.0
Additional information
ERRO[0025] Error updating folder in the DB dir="/music/[path]" error="UNIQUE constraint failed: media_file.id"
ERRO[0026] Error updating folder in the DB dir="/music/[path]" error="UNIQUE constraint failed: media_file_genres.media_file_id, media_file_genres.genre_id"
ERRO[0096] Error writing albums to the DB error="UNIQUE constraint failed: album_genres.album_id, album_genres.genre_id"
ERRO[0099] Error updating folder in the DB dir="/music/[path]" error="UNIQUE constraint failed: media_file_genres.media_file_id, media_file_genres.genre_id"
The text was updated successfully, but these errors were encountered: