Could you please clarify in which cases an error like the one below may occur when performing an upsert using D1 from Cloudflare Workers?
Error: Failed query: select "id" from "users" where "users"."tg_id" = ?
Request ID: 9c2226659cb0e187
This is an upsert query. I’ve reviewed the SQL itself and couldn’t find any issues.
The query works correctly for most users, but for some users the error occurs intermittently, during certain periods of time. Because of this, I’m wondering whether the root cause could be something other than the query itself, for example:
D1 limits (concurrency, throughput, etc.)
temporary D1 unavailability
connection issues between Workers and D1
internal D1-related failures
I’d really appreciate any guidance on what could cause this kind of intermittent behavior and where I should look next.
Thank you!