Mintplex-Labs/anything-llm · error

Not Found

Error message

Not Found

What it means

This 404 'Not Found' from GET /system/accepted-document-types (server/endpoints/system.js:577) is a deliberate mapping, not a thrown exception. The handler calls CollectorApi().acceptedFileTypes(), which fetches http://0.0.0.0:8888/accepts on the document collector (python) service; its internal .catch returns null on any failure - ECONNREFUSED, wrong COLLECTOR_PORT, non-OK response - and the endpoint converts that null into 404. In short: 404 here means the document processor/collector is unreachable, not that a route is missing.

Source

Thrown at server/endpoints/system.js:577

    async (_, response) => {
      try {
        const online = await new CollectorApi().online();
        response.sendStatus(online ? 200 : 503);
      } catch (e) {
        console.error(e.message, e);
        response.sendStatus(500).end();
      }
    }
  );

  app.get(
    "/system/accepted-document-types",
    [validatedRequest],
    async (_, response) => {
      try {
        const types = await new CollectorApi().acceptedFileTypes();
        if (!types) {
          response.sendStatus(404).end();
          return;
        }

        response.status(200).json({ types });
      } catch (e) {
        console.error(e.message, e);
        response.sendStatus(500).end();
      }
    }
  );

  app.post(
    "/system/update-env",
    [validatedRequest, flexUserRoleValid([ROLES.admin])],
    async (request, response) => {
      try {
        const body = reqBody(request);
        const { newValues, error } = await updateENV(

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Check the collector service: docker ps / docker logs <collector> - restart it if exited
  2. Verify COLLECTOR_PORT is identical in server and collector environments
  3. Retry after the collector finishes booting - it exposes /accepts only once ready
  4. From inside the server container, curl http://0.0.0.0:8888/accepts to confirm reachability

Example fix

// before (client assumes 404 = bad route)
const res = await fetch("/api/system/accepted-document-types");
if (res.status === 404) console.error("route missing");

// after (404 = collector offline)
const res = await fetch("/api/system/accepted-document-types");
if (res.status === 404) {
  showBanner("Document processor offline - uploads disabled until it restarts");
}
Defensive patterns

Strategy: fallback

Try / catch

try {
  const res = await fetch("/api/system/accepted-document-types", { headers: authHeaders() });
  if (res.status === 404) {
    return FALLBACK_TYPES; // collector offline - fall back to a known-good type list and disable live validation
  }
  if (!res.ok) throw new Error(`unexpected status ${res.status}`);
  return (await res.json()).types;
} catch (e) {
  return FALLBACK_TYPES;
}

Prevention

When it happens

Trigger: GET /api/system/accepted-document-types while the collector container is stopped or crashed; COLLECTOR_PORT set to a value the collector is not listening on; collector still booting (its model/OCR imports are slow) when the frontend loads the upload dialog.

Common situations: Docker compose deployments where the collector sidecar exited (check docker logs on the collector); dev setups running only `node server/index.js` without the python collector; port conflicts on 8888.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/e033abaaa8000ea9. Report an issue: GitHub.