ufoaz
ufoaz9mo ago

Uncaught Error: Documents read from or written to the "itineraries" table changed while this mut...

Is it bad practice to stream from 3 different threads from an LLM and then run respective mutations to update the same document (at the same time)? Seems there are some 'Error managing thread' errors appearing. Could imagine storing references to 3 different documents instead, but would ideally keep this structure. Full error:
Uncaught Error: Documents read from or written to the "itineraries" table changed while this mutation was being run and on every subsequent retry. Another call to this mutation changed the document with ID "j57bsqexd56n4fnee9y4k2v1dx6s1e46". See https://docs.convex.dev/error#1
at async recursiveStreamHandler (../convex/openai_v2.ts:264:64)
at async recursiveStreamHandler (../convex/openai_v2.ts:307:12)
at async handler (../convex/openai_v2.ts:92:8)
Uncaught Error: Documents read from or written to the "itineraries" table changed while this mutation was being run and on every subsequent retry. Another call to this mutation changed the document with ID "j57bsqexd56n4fnee9y4k2v1dx6s1e46". See https://docs.convex.dev/error#1
at async recursiveStreamHandler (../convex/openai_v2.ts:264:64)
at async recursiveStreamHandler (../convex/openai_v2.ts:307:12)
at async handler (../convex/openai_v2.ts:92:8)
2 Replies
Michal Srb
Michal Srb9mo ago
Hey @ufoaz , have you checked out the included link? https://docs.convex.dev/error#1
Errors and Warnings | Convex Developer Hub
This page explains specific errors thrown by Convex.
jamwt
jamwt9mo ago
As the linked document says, you'll need to optimize your mutations to reduce conflicts. If you need more help with this, feel free to paste the mutation in question and we'll see if we can give you some feedback the easiest first step is to make sure you're using indexes for all queries inside these mutations

Did you find this page helpful?