[GH-ISSUE #879] Duplicate entry, integrity constraint violation #591

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

Originally created by @chrisvandergeld on GitHub (Dec 17, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/879

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, 因为我不说中文。

I've got an issue regarding a duplicate entry upon sync. I've got a fair library and I bet there's a couple doubles in there I just have no clue of how to fix this or find the entry it's talking about. I've tried looking at similar issues but I haven't found any solution so far.

How do I find out which entry it's talking about exactly?

I'm using binhex's arch/koel docker.

image

Originally created by @chrisvandergeld on GitHub (Dec 17, 2018). Original GitHub issue: https://github.com/koel/koel/issues/879 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) - [ ] 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 - [ ] 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, 因为我不说中文。 I've got an issue regarding a duplicate entry upon sync. I've got a fair library and I bet there's a couple doubles in there I just have no clue of how to fix this or find the entry it's talking about. I've tried looking at similar issues but I haven't found any solution so far. How do I find out which entry it's talking about exactly? I'm using binhex's arch/koel docker. ![image](https://user-images.githubusercontent.com/24505478/50095782-870fb380-0216-11e9-9139-bbdf74bb894b.png)
kerem 2026-02-26 02:33:38 +03:00
  • closed this issue
  • added the
    Sync
    label
Author
Owner

@MyPod-zz commented on GitHub (Jan 5, 2019):

I have met the same issue. My fix was to re-initialise the application via php artisan koel:init, a subsequent php artisan koel:sync worked correctly. I had no issues in doing this as it was a fairly recent setup anyhow.

<!-- gh-comment-id:451695553 --> @MyPod-zz commented on GitHub (Jan 5, 2019): I have met the same issue. My fix was to re-initialise the application via `php artisan koel:init`, a subsequent `php artisan koel:sync` worked correctly. I had no issues in doing this as it was a fairly recent setup anyhow.
Author
Owner

@phanan commented on GitHub (Jan 7, 2019):

As this is a fairly common problem, I'll think about at least adding a more specific (read: helpful) error message. Thanks for reporting the issue!

<!-- gh-comment-id:451848198 --> @phanan commented on GitHub (Jan 7, 2019): As this is a fairly common problem, I'll think about at least adding a more specific (read: helpful) error message. Thanks for reporting the issue!
Author
Owner

@qcasey commented on GitHub (Feb 20, 2019):

I had this exact issue, but php artisan koel:init didn't fix it for me.

I noticed the Artist's name was way over the artists:name varchar(191) column length. Bumping up the length to 240 (or ~300 in @Tailchakra's case) fixed it for me.

I don't know Laravel, but is it possible to automatically extend the column size in the DB instead of throwing an exception on these edge cases?

Koel has been great so far and looks slick, very excited to get my whole library synced!

<!-- gh-comment-id:465755988 --> @qcasey commented on GitHub (Feb 20, 2019): I had this exact issue, but `php artisan koel:init` didn't fix it for me. I noticed the Artist's name was way over the artists:name `varchar(191)` column length. Bumping up the length to 240 (or ~300 in @Tailchakra's case) fixed it for me. I don't know Laravel, but is it possible to automatically extend the column size in the DB instead of throwing an exception on these edge cases? Koel has been great so far and looks slick, very excited to get my whole library synced!
Author
Owner

@greengeek commented on GitHub (Mar 21, 2019):

I just experienced the same error today as well. I wanted to see what would happen if I pointed it to a library of a few hundred thousand songs. I am pretty sure all my artist/albums/songs are valid for windows naming convention, so I am guessing they should all be under 260 characters, but definitely there will be some that are right up to that limit, easily surpassing the 191.

I tried koel right before on a library of just a few hundred songs for testing and it was very snappy. Looks great so far!

<!-- gh-comment-id:475096118 --> @greengeek commented on GitHub (Mar 21, 2019): I just experienced the same error today as well. I wanted to see what would happen if I pointed it to a library of a few hundred thousand songs. I am pretty sure all my artist/albums/songs are valid for windows naming convention, so I am guessing they should all be under 260 characters, but definitely there will be some that are right up to that limit, easily surpassing the 191. I tried koel right before on a library of just a few hundred songs for testing and it was very snappy. Looks great so far!
Author
Owner

@BrookeDot commented on GitHub (Apr 22, 2020):

Is this still an issue with newer versions of Koel?

<!-- gh-comment-id:617590843 --> @BrookeDot commented on GitHub (Apr 22, 2020): Is this still an issue with newer versions of Koel?
Author
Owner

@CirnoT commented on GitHub (Nov 8, 2020):

Yes it is an issue (on master), I suppose you should either change name to TEXT or trim name to length of column before inserting into database.

The first solution might be more desirable seeing how popular this is, as alternative would cut off metadata.

<!-- gh-comment-id:723679675 --> @CirnoT commented on GitHub (Nov 8, 2020): Yes it is an issue (on master), I suppose you should either change name to TEXT or trim name to length of column before inserting into database. The first solution might be more desirable seeing how popular this is, as alternative would cut off metadata.
Author
Owner

@phanan commented on GitHub (Nov 10, 2020):

Thanks folks. I'll give it a closer look in the next version.

<!-- gh-comment-id:724744702 --> @phanan commented on GitHub (Nov 10, 2020): Thanks folks. I'll give it a closer look in the next version.
Author
Owner

@junoh-moon commented on GitHub (Jun 8, 2021):

I also had the same problem, (artist name length is about 220), and I temporarily resolved it by increasing varchar size of the column name to big number (512 in my case) in database/migrations/2015_11_23_074600_create_artists_table.php

<!-- gh-comment-id:856567959 --> @junoh-moon commented on GitHub (Jun 8, 2021): I also had the same problem, (artist name length is about 220), and I temporarily resolved it by increasing varchar size of the column `name` to big number (512 in my case) in `database/migrations/2015_11_23_074600_create_artists_table.php`
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#591
No description provided.