[GH-ISSUE #463] koel:sync 65535 limit #326

Closed
opened 2026-02-26 02:32:51 +03:00 by kerem · 9 comments
Owner

Originally created by @maryingo on GitHub (Sep 25, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/463

When I run koel:sync on my 100K track library, I get

[PDOException]                                                                
SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535

Everything works as expected when I sync fewer than 65K tracks, but I'm not able to subsequently add the remaining tracks.
Replicated with both mySQL and postgresql.
Is this a database configuration issue of my own or should koel be splitting up the table creation?

Originally created by @maryingo on GitHub (Sep 25, 2016). Original GitHub issue: https://github.com/koel/koel/issues/463 When I run koel:sync on my 100K track library, I get ``` [PDOException] SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 ``` Everything works as expected when I sync fewer than 65K tracks, but I'm not able to subsequently add the remaining tracks. Replicated with both mySQL and postgresql. Is this a database configuration issue of my own or should koel be splitting up the table creation?
kerem closed this issue 2026-02-26 02:32:51 +03:00
Author
Owner

@phanan commented on GitHub (Sep 25, 2016):

Can you show where exactly in the code that threw the error?

<!-- gh-comment-id:249416795 --> @phanan commented on GitHub (Sep 25, 2016): Can you show where exactly in the code that threw the error?
Author
Owner

@phanan commented on GitHub (Sep 25, 2016):

Also, what architecture is your server? Linux (what flavor?) / Windows / Mac? 32 or 64bit? Please give as many details as you can when reporting bugs.

<!-- gh-comment-id:249417043 --> @phanan commented on GitHub (Sep 25, 2016): Also, what architecture is your server? Linux (what flavor?) / Windows / Mac? 32 or 64bit? Please give as many details as you can when reporting bugs.
Author
Owner

@ArcheTwist commented on GitHub (Sep 25, 2016):

@maryingo how do you get 100,000 songs? How much storage is this using? What is it hosted on?

<!-- gh-comment-id:249438560 --> @ArcheTwist commented on GitHub (Sep 25, 2016): @maryingo how do you get 100,000 songs? How much storage is this using? What is it hosted on?
Author
Owner

@maryingo commented on GitHub (Sep 25, 2016):

Sorry for the lack of detail. The server is running a LAMP stack with Ubuntu 16.04.
The sync progress bar will reach 100%, delay for several minutes, then I get the errors:

[Illuminate\Database\QueryException]                                                                                      
  SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 
(SQL: delete from "songs" where "id" not in (358c82256cc5b0a4fcc194e85b9e6171,
 .....(massive list of strings).......)

And:


  [PDOException]                                                                      
  SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535
<!-- gh-comment-id:249442123 --> @maryingo commented on GitHub (Sep 25, 2016): Sorry for the lack of detail. The server is running a LAMP stack with Ubuntu 16.04. The sync progress bar will reach 100%, delay for several minutes, then I get the errors: ``` [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 (SQL: delete from "songs" where "id" not in (358c82256cc5b0a4fcc194e85b9e6171, .....(massive list of strings).......) ``` And: ``` [PDOException] SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 ```
Author
Owner

@phanan commented on GitHub (Sep 26, 2016):

I guessed it right… still, @maryingo, is your Ubuntu 32 or 64bit?

<!-- gh-comment-id:249466264 --> @phanan commented on GitHub (Sep 26, 2016): I guessed it right… still, @maryingo, is your Ubuntu 32 or 64bit?
Author
Owner

@maryingo commented on GitHub (Sep 26, 2016):

64-bit

<!-- gh-comment-id:249473683 --> @maryingo commented on GitHub (Sep 26, 2016): 64-bit
Author
Owner

@phanan commented on GitHub (Sep 26, 2016):

The reason why this happens is MySQL (and apparently, PostreSQL) has a
limitation of 2^16 (65,536) entries in an IN clause. I'll try to work on
a workaround.

On Mon, Sep 26, 2016 at 11:47 AM, maryingo notifications@github.com wrote:

64-bit


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/phanan/koel/issues/463#issuecomment-249473683, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHrt0uphuLRDmzAmnZvYkd0ra9htqotJks5qt0BOgaJpZM4KFzOt
.

<!-- gh-comment-id:249477894 --> @phanan commented on GitHub (Sep 26, 2016): The reason why this happens is MySQL (and apparently, PostreSQL) has a limitation of 2^16 (65,536) entries in an `IN` clause. I'll try to work on a workaround. On Mon, Sep 26, 2016 at 11:47 AM, maryingo notifications@github.com wrote: > 64-bit > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > https://github.com/phanan/koel/issues/463#issuecomment-249473683, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AHrt0uphuLRDmzAmnZvYkd0ra9htqotJks5qt0BOgaJpZM4KFzOt > .
Author
Owner

@phanan commented on GitHub (Sep 26, 2016):

@maryingo Can you try if the latest commits on master branch fixed the issue? Please add BROADCAST_DRIVER=log into .env and run composer install, as I've upgraded Laravel to 5.3.

<!-- gh-comment-id:249499289 --> @phanan commented on GitHub (Sep 26, 2016): @maryingo Can you try if the latest commits on `master` branch fixed the issue? Please add `BROADCAST_DRIVER=log` into `.env` and run `composer install`, as I've upgraded Laravel to 5.3.
Author
Owner

@maryingo commented on GitHub (Sep 26, 2016):

Excellent - koel:sync now finishes successfully.
Thank you for looking into and fixing this so quickly, I sincerely appreciate it.

<!-- gh-comment-id:249516472 --> @maryingo commented on GitHub (Sep 26, 2016): Excellent - koel:sync now finishes successfully. Thank you for looking into and fixing this so quickly, I sincerely appreciate it.
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#326
No description provided.