putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
149 stars 36 forks source link

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

Closed boboldehampsink closed 6 months ago

boboldehampsink commented 6 months ago

Bug Report

Seeing this come up in various variants:

SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 The SQL being executed was: SELECT "id" FROM "blitz_caches" WHERE (("siteId"=1) AND ("uri"='...')) OR (("siteId"=1) AND ("uri"='......

I'm on PostgreSQL

Plugin Version

4.13

Craft CMS Version

4.8

PHP Version

8.3

bencroker commented 6 months ago

Are you seeing a stack trace along with these errors, or can you track one down in the logs?

boboldehampsink commented 6 months ago

Ah, forgot to mention this is shown as a "Refreshing Blitz Cache" job error (no full stacktrace comes with that)

bencroker commented 6 months ago

Thanks! Fixed in https://github.com/putyourlightson/craft-blitz/commit/2440fd8c81c67fd1b38bc468016e923073cdcc62 for the next release.

boboldehampsink commented 6 months ago

Thanks! When is the release planned? My queue manager is actually crashing now a few of these big ones have shown up - have to delete them manually from the db to make things work again.

bencroker commented 6 months ago

Early next week. If you need this sooner then you can install the develop branch by running ddev composer require "putyourlightson/craft-blitz:dev-develop as 4.13.3".

boboldehampsink commented 6 months ago

@bencroker now seeing this slightly different message (using develop):

SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535 The SQL being executed was: SELECT "siteId", "uri" FROM "blitz_caches" WHERE "id" IN (205807, 205908, 182419, ...
bencroker commented 6 months ago

Thanks. I’ve added chunking of query params in more places in https://github.com/putyourlightson/craft-blitz/commit/4c0edf674afab2ff9b9b18eb0d27616d618c3fcc. Hopefully that catches them all now.

bencroker commented 6 months ago

Released in 4.14.0.