[GH-ISSUE #2527] '400 Bad Request' occurs once uploading a document when running in production without docker #1635

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

Originally created by @fengnex on GitHub (Oct 24, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2527

Reproducing steps:

  1. Set up the environment according to https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md
  2. Add console.log(res); at the line of 65 in server/utils/collectorApi/index.js
  3. Execute cd server && node index.js from the home directory and then execute cd collector && node index.js from the same dir in another terminal window
  4. Try to upload a document and then the UI would be:
    anthingllm-400-1
  5. Check the server's console then the following response can be found: Response { status: 400, statusText: 'Bad Request', headers: Headers { 'x-powered-by': 'Express', vary: 'Origin', 'content-type': 'application/json; charset=utf-8', 'content-length': '43', etag: 'W/"2b-+vivW5V/CWdmo6x7+lEhhCy5OUo"', date: 'Thu, 24 Oct 2024 04:30:42 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true }, bodyUsed: false, ok: false, redirected: false, type: 'basic', url: 'http://0.0.0.0:8888/process' } [CollectorApi] Response could not be completed

By the way, the above function runs smoothly and correctly when the server, the collector and the frontend run in development mode.

Can anyone be so kind as to explain relevant problems or root causes, and give some ideas on how to solve it? Thanks a lot in advance!

Originally created by @fengnex on GitHub (Oct 24, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2527 Reproducing steps: 1. Set up the environment according to [https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md](url) 2. Add `console.log(res);` at the line of 65 in `server/utils/collectorApi/index.js` 3. Execute `cd server && node index.js` from the home directory and then execute `cd collector && node index.js` from the same dir in another terminal window 4. Try to upload a document and then the UI would be: ![anthingllm-400-1](https://github.com/user-attachments/assets/19943858-bbb7-4626-8774-72a01e267706) 5. Check the server's console then the following response can be found: `Response { status: 400, statusText: 'Bad Request', headers: Headers { 'x-powered-by': 'Express', vary: 'Origin', 'content-type': 'application/json; charset=utf-8', 'content-length': '43', etag: 'W/"2b-+vivW5V/CWdmo6x7+lEhhCy5OUo"', date: 'Thu, 24 Oct 2024 04:30:42 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true }, bodyUsed: false, ok: false, redirected: false, type: 'basic', url: 'http://0.0.0.0:8888/process' } [CollectorApi] Response could not be completed` By the way, the above function runs smoothly and correctly when the server, the collector and the frontend run in development mode. Can anyone be so kind as to explain relevant problems or root causes, and give some ideas on how to solve it? Thanks a lot in advance!
yindo added the question label 2026-02-22 18:25:48 -05:00
yindo closed this issue 2026-02-22 18:25:48 -05:00
Author
Owner

@fengnex commented on GitHub (Oct 24, 2024):

@timothycarambat Could you please look at this problem and provide some ideas? Thanks

@fengnex commented on GitHub (Oct 24, 2024): @timothycarambat Could you please look at this problem and provide some ideas? Thanks
Author
Owner

@timothycarambat commented on GitHub (Oct 24, 2024):

https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md

Warning

This method of deployment is not supported by the core-team and is to be used as a reference for your deployment.
You are fully responsible for securing your deployment and data in this mode.
Any issues experienced from bare-metal or non-containerized deployments will be not answered or supported.

I will hopefully get to this, but it is nearly impossible to support people like this - especially over Github. This is 100% a configuration issue, I just cant be sure of what.

In general, people just fail to set the .env for the server in server/.env correctly almost 100% of the time.

SERVER_PORT=3001
STORAGE_DIR="/absolute/path/to/anything-llm/server/storage" # absolute filesystem path with no trailing slash
DATABASE_URL="file:/absolute/path/to/anything-llm/server/storage/anythingllm.db"

SInce the app loads and you have a workspace, your DatabaseURL is correct (likey using the default), but your storage directory may be wrong. Collector can be checked in this mode by GET http://localhost:8888/accepts and should get a JSON array back.

@timothycarambat commented on GitHub (Oct 24, 2024): https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md > [!WARNING] > This method of deployment is **not supported** by the core-team and is to be used as a reference for your deployment. > You are fully responsible for securing your deployment and data in this mode. > **Any issues** experienced from bare-metal or non-containerized deployments will be **not** answered or supported. I will hopefully get to this, but it is nearly impossible to support people like this - especially over Github. This is 100% a configuration issue, I just cant be sure of what. In general, people just fail to set the `.env` for the server in server/.env correctly almost 100% of the time. ``` SERVER_PORT=3001 STORAGE_DIR="/absolute/path/to/anything-llm/server/storage" # absolute filesystem path with no trailing slash DATABASE_URL="file:/absolute/path/to/anything-llm/server/storage/anythingllm.db" ``` SInce the app loads and you have a workspace, your DatabaseURL is correct (likey using the default), but your storage directory may be wrong. Collector can be checked in this mode by GET `http://localhost:8888/accepts` and should get a JSON array back.
yindo changed title from '400 Bad Request' occurs once uploading a document when running in production without docker to [GH-ISSUE #2527] '400 Bad Request' occurs once uploading a document when running in production without docker 2026-06-05 14:41:51 -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#1635