Skip to content

When using local API to update a doc D1 errors (cloudflare) #14427

@brogulj

Description

@brogulj

Describe the Bug

When using local API (payload.update) to update a doc (page), i encounter a following error
Error: D1_ERROR: too many SQL variables at offset 689: SQLITE_ERROR
It makes no sense because the object is well formed and in the same shape as one in the db.
After it throws, it deletes the remaining block after the problematic one, and a part of the problematic block (in my case it is the industriesGlobeBlock and it deletes all the countries)
i assume the arrays are somehow creating some problems here

Link to the code that reproduces this issue

https://github.com/brogulj/cooperante-cloudflare/

Reproduction Steps

i implemented a translation feature that automatically translates all the localized values
steps:

  1. log in
  2. create a page
  3. add tableBlock with minimum of 3 columns and 3 rows or industriesGlobeBlock with lots of countries
  4. click translate (you need to set GEMINI_API_KEY in the .env beforehand)

Which area(s) are affected? (Select all that apply)

db: d1-sqlite

Environment Info

Binaries:
  Node: 22.13.1
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  payload: 3.58.0
  next: 15.4.4
  @payloadcms/email-nodemailer: 3.58.0
  @payloadcms/email-resend: 3.58.0
  @payloadcms/graphql: 3.58.0
  @payloadcms/next/utilities: 3.58.0
  @payloadcms/payload-cloud: 3.58.0
  @payloadcms/plugin-cloud-storage: 3.58.0
  @payloadcms/plugin-form-builder: 3.58.0
  @payloadcms/plugin-seo: 3.58.0
  @payloadcms/richtext-lexical: 3.58.0
  @payloadcms/translations: 3.58.0
  @payloadcms/ui/shared: 3.58.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132
  Available memory (MB): 16384
  Available CPU cores: 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions