Mintplex-Labs/anything-llm · warning
Internal Server Error
Error message
Internal Server Error
What it means
HTTP 500 returned by the AnythingLLM system dump-env route (POST, guarded by validApiKey). In non-production the handler short-circuits with 200; in production it calls dumpENV() then sendStatus(200). The 500 fires only if dumpENV() throws - typically a filesystem write error while dumping the .env output.
Source
Thrown at server/endpoints/api/system/index.js:33
app.get("/v1/system/env-dump", async (_, response) => {
/*
#swagger.tags = ['System Settings']
#swagger.description = 'Dump all settings to file storage'
#swagger.responses[403] = {
schema: {
"$ref": "#/definitions/InvalidAPIKey"
}
}
*/
try {
if (process.env.NODE_ENV !== "production")
return response.sendStatus(200).end();
dumpENV();
response.sendStatus(200).end();
} catch (e) {
console.error(e.message, e);
response.sendStatus(500).end();
}
});
app.get("/v1/system", [validApiKey], async (_, response) => {
/*
#swagger.tags = ['System Settings']
#swagger.description = 'Get all current system settings that are defined.'
#swagger.responses[200] = {
content: {
"application/json": {
schema: {
type: 'object',
example: {
"settings": {
"VectorDB": "pinecone",
"PineConeKey": true,
"PineConeIndex": "my-pinecone-index",
"LLMProvider": "azure",View on GitHub (pinned to 526360e320)
Solutions
- Confirm the server process has write permission to the directory dumpENV targets.
- Check disk free space on that volume.
- Inspect the server log for the EACCES/ENOSPC error from dumpENV.
- Verify NODE_ENV is intentionally 'production' if you expected the no-op 200 path.
- Mount the storage volume read-write if it is currently read-only.
Defensive patterns
Strategy: try-catch
Validate before calling
// No request body; guard the runtime expectation.
if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'production') {
// expect the dumpENV branch to run - ensure writable storage beforehand
} Try / catch
try {
const r = await fetch('/v1/system/dump-env', { method:'POST' });
if (r.status === 500) throw new Error('dump-env failed - verify write permissions/disk on dumpENV target');
} catch (e) { throw e; } Prevention
- Ensure the server process can write to the directory dumpENV targets.
- Keep the storage volume mounted read-write and not out of disk space.
- Be deliberate about NODE_ENV so the production dump path does not run unintentionally.
- Alert on 500 here as a filesystem-permission/disk signal.
When it happens
Trigger: dumpENV attempting to write to a path the server process cannot write to (permission denied); the output directory missing; disk full; path configured to a read-only mount; NODE_ENV mis-set so the production branch runs unexpectedly.
Common situations: Container running with a read-only filesystem where dumpENV writes; storage volume not mounted; disk exhaustion; NODE_ENV=production unintentionally set in dev so the dump path runs.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
Related errors
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/eaac37b02671ed28.
Report an issue: GitHub.