[GH-ISSUE #2971] [BUG]: Updating the workspace while a thread is loading breaks AnythingLLM #1894

Closed
opened 2026-02-22 18:27:06 -05:00 by yindo · 5 comments
Owner

Originally created by @DangerousBerries on GitHub (Jan 14, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2971

How are you running AnythingLLM?

Docker (local)

What happened?

I get these errors:

Error:
Invalid prisma.workspaces.update() invocation:
Error in connector: Error querying the database: cannot start a transaction within a transaction

AnythingLLM will get stuck in a loading icon and nothing will work.

Also Timothy I replied to you in closed issues a couple of times (like in Display Backfilled Context) and it seems like you didn't see them, do you not get notified for replies after issues are closed?

Are there known steps to reproduce?

While loading a thread in the background change the Max Context Snippets number and click "Update workplace".

Originally created by @DangerousBerries on GitHub (Jan 14, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2971 ### How are you running AnythingLLM? Docker (local) ### What happened? I get these errors: Error: Invalid `prisma.workspaces.update()` invocation: Error in connector: Error querying the database: cannot start a transaction within a transaction AnythingLLM will get stuck in a loading icon and nothing will work. Also Timothy I replied to you in closed issues a couple of times (like in Display Backfilled Context) and it seems like you didn't see them, do you not get notified for replies after issues are closed? ### Are there known steps to reproduce? While loading a thread in the background change the Max Context Snippets number and click "Update workplace".
yindo closed this issue 2026-02-22 18:27:06 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jan 14, 2025):

How you would arrive in this state is quite odd, is your docker instance overloaded or on a small machine with low resources? Being able to run a transaction is trivial to process so getting to this state will be very difficult to replicate as we already have the guards to prevent updating a null reference.

If there is a race condition from doing an update when a thread is loading (under what state - creation, deletion, etc?) then unless this becomes experiential for more users it will be wontfix for now. The background DB is SQLite and is can handle concurrent reads, but not writes since its a file-based system. However,it will do a write-ahead-log to prevent these exact kinds of errors. So how this happened is odd, but also something I cannot even try to replicate atm.

@timothycarambat commented on GitHub (Jan 14, 2025): How you would arrive in this state is quite odd, is your docker instance overloaded or on a small machine with low resources? Being able to run a transaction is trivial to process so getting to this state will be very difficult to replicate as we already have the guards to prevent updating a null reference. If there is a race condition from doing an update when a thread is loading (under what state - creation, deletion, etc?) then unless this becomes experiential for more users it will be wontfix for now. The background DB is SQLite and is can handle concurrent reads, but not writes since its a file-based system. However,it will do a write-ahead-log to prevent these exact kinds of errors. So how this happened is odd, but also something I cannot even try to replicate atm.
Author
Owner

@DangerousBerries commented on GitHub (Jan 14, 2025):

How you would arrive in this state is quite odd, is your docker instance overloaded or on a small machine with low resources? Being able to run a transaction is trivial to process so getting to this state will be very difficult to replicate as we already have the guards to prevent updating a null reference.

If there is a race condition from doing an update when a thread is loading (under what state - creation, deletion, etc?) then unless this becomes experiential for more users it will be wontfix for now. The background DB is SQLite and is can handle concurrent reads, but not writes since its a file-based system. However,it will do a write-ahead-log to prevent these exact kinds of errors. So how this happened is odd, but also something I cannot even try to replicate atm.

Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that.

@DangerousBerries commented on GitHub (Jan 14, 2025): > How you would arrive in this state is quite odd, is your docker instance overloaded or on a small machine with low resources? Being able to run a transaction is trivial to process so getting to this state will be very difficult to replicate as we already have the guards to prevent updating a null reference. > > If there is a race condition from doing an update when a thread is loading (under what state - creation, deletion, etc?) then unless this becomes experiential for more users it will be wontfix for now. The background DB is SQLite and is can handle concurrent reads, but not writes since its a file-based system. However,it will do a write-ahead-log to prevent these exact kinds of errors. So how this happened is odd, but also something I cannot even try to replicate atm. Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that.
Author
Owner

@timothycarambat commented on GitHub (Jan 14, 2025):

Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that.

The name or the chat??

@timothycarambat commented on GitHub (Jan 14, 2025): > Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that. The name or the chat??
Author
Owner

@DangerousBerries commented on GitHub (Jan 14, 2025):

Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that.

The name or the chat??

the chat lol

@DangerousBerries commented on GitHub (Jan 14, 2025): > > Oh I just have a thread that's like hundreds of thousands of characters so it takes time to load lol, but that's fine that you won't fix it I'll avoid doing that. > > The name or the chat?? the chat lol
Author
Owner

@DangerousBerries commented on GitHub (Mar 26, 2025):

I try to avoid this but eventually I stumble and get it again. I got a slightly different line though, maybe that could help:
Error in connector: Error creating a database connection. (Timed out during query execution.)

@DangerousBerries commented on GitHub (Mar 26, 2025): I try to avoid this but eventually I stumble and get it again. I got a slightly different line though, maybe that could help: Error in connector: Error creating a database connection. (Timed out during query execution.)
yindo changed title from [BUG]: Updating the workspace while a thread is loading breaks AnythingLLM to [GH-ISSUE #2971] [BUG]: Updating the workspace while a thread is loading breaks AnythingLLM 2026-06-05 14:43:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1894