[GH-ISSUE #4365] [BUG]: node process is killed while uploading and embedding documents #2784

Closed
opened 2026-02-22 18:31:14 -05:00 by yindo · 2 comments
Owner

Originally created by @jstawski on GitHub (Sep 5, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4365

How are you running AnythingLLM?

Docker (remote machine)

What happened?

I am running the PG container in a hosting environment. The container has 1 CPU and 3 GB of memory. When uploading a document and embedding it directly into a workspace (utilizing the API), the node process is sometimes killed. I haven't pinpointed if this happens with only one file or if it happens after a series of files (does the embedding happen in a background process?). Here's an excerpt of the logs:

[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 76 of 406
[36m[backend][0m [32minfo[39m: [36m[CollectorApi][0m Document Office filename.json uploaded, processed, and moved to folder Workspace1 successfully.
[36m[backend][0m [32minfo[39m: [32m[Event Logged][0m - api_document_uploaded
[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 393 of 406
[36m[backend][0m [32minfo[39m: [35m[PGVectorDb][0m Adding new vectorized document into namespace workspace1
[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Initialized Xenova/all-MiniLM-L6-v2
[36m[backend][0m [32minfo[39m: [35m[RecursiveSplitter][0m Will split with {"chunkSize":1000,"chunkOverlap":20,"chunkHeader":"<document_metadata>\nsourceDocument: Office HoursYo..."}
[36m[backend][0m [32minfo[39m: [35m[PGVectorDb][0m Snippets created from document: 10133
[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 77 of 406
[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 394 of 406
...
[36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 79 of 406
/usr/local/bin/docker-entrypoint.sh: line 24: 162 Killed node /app/server/index.js

Looking at the metrics of the container I can see big CPU and Memory usage during this time, which eventually goes down to 0 (since the process was killed). In the memory side of things the memory is moving up and down between ~1.7 GB and ~2.4 GB, eventually it spikes to 3GB and dies.

Everything points to an Out of Memory exception, but I can't find any logs besides the 162 Killed node message.

Am I running with too little memory? If I double it, will this continue to happen, just with a bigger load? How can I avoid it?

Are there known steps to reproduce?

Setup a container with constrained memory and upload many docs of different sizes and embed them. I was able to reproduce via the API and the UI.

Originally created by @jstawski on GitHub (Sep 5, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4365 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? I am running the PG container in a hosting environment. The container has 1 CPU and 3 GB of memory. When uploading a document and embedding it directly into a workspace (utilizing the API), the node process is sometimes killed. I haven't pinpointed if this happens with only one file or if it happens after a series of files (does the embedding happen in a background process?). Here's an excerpt of the logs: > [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 76 of 406 [36m[backend][0m [32minfo[39m: [36m[CollectorApi][0m Document Office filename.json uploaded, processed, and moved to folder Workspace1 successfully. [36m[backend][0m [32minfo[39m: [32m[Event Logged][0m - api_document_uploaded [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 393 of 406 [36m[backend][0m [32minfo[39m: [35m[PGVectorDb][0m Adding new vectorized document into namespace workspace1 [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Initialized Xenova/all-MiniLM-L6-v2 [36m[backend][0m [32minfo[39m: [35m[RecursiveSplitter][0m Will split with {"chunkSize":1000,"chunkOverlap":20,"chunkHeader":"<document_metadata>\nsourceDocument: Office HoursYo..."} [36m[backend][0m [32minfo[39m: [35m[PGVectorDb][0m Snippets created from document: 10133 [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 77 of 406 [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 394 of 406 ... [36m[backend][0m [32minfo[39m: [36m[NativeEmbedder][0m Embedded Chunk Group 79 of 406 /usr/local/bin/docker-entrypoint.sh: line 24: 162 Killed node /app/server/index.js Looking at the metrics of the container I can see big CPU and Memory usage during this time, which eventually goes down to 0 (since the process was killed). In the memory side of things the memory is moving up and down between ~1.7 GB and ~2.4 GB, eventually it spikes to 3GB and dies. Everything points to an Out of Memory exception, but I can't find any logs besides the `162 Killed node` message. Am I running with too little memory? If I double it, will this continue to happen, just with a bigger load? How can I avoid it? ### Are there known steps to reproduce? Setup a container with constrained memory and upload many docs of different sizes and embed them. I was able to reproduce via the API and the UI.
yindo added the possible bug label 2026-02-22 18:31:14 -05:00
yindo closed this issue 2026-02-22 18:31:14 -05:00
Author
Owner

@shatfield4 commented on GitHub (Sep 5, 2025):

Yes, this does seem like it is an out of memory (OOM) exception. I can see that the document you are uploading is rather large since it is embedding 406 chunks. Try increasing the CPU and RAM allocated to the docker container and this may solve the issue.

You can confirm that this is the issue by trying a smaller document on the same setup and if it completes properly then it is indeed an OOM exception.

@shatfield4 commented on GitHub (Sep 5, 2025): Yes, this does seem like it is an out of memory (OOM) exception. I can see that the document you are uploading is rather large since it is embedding 406 chunks. Try increasing the CPU and RAM allocated to the docker container and this may solve the issue. You can confirm that this is the issue by trying a smaller document on the same setup and if it completes properly then it is indeed an OOM exception.
Author
Owner

@jstawski commented on GitHub (Sep 8, 2025):

But why is the process killed? Isn't there a way to make sure it doesn't die?

@jstawski commented on GitHub (Sep 8, 2025): But why is the process killed? Isn't there a way to make sure it doesn't die?
yindo changed title from [BUG]: node process is killed while uploading and embedding documents to [GH-ISSUE #4365] [BUG]: node process is killed while uploading and embedding documents 2026-06-05 14:48:32 -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#2784