{"record":{"id":"8802e104cc1871f7","repo":"Mintplex-Labs/anything-llm","slug":"not-found-8802e1","errorCode":null,"errorMessage":"Not Found","messagePattern":"Not Found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"server/endpoints/api/document/index.js","lineNumber":778,"sourceCode":"                  \".txt\",\n                  \".md\"\n                ]\n              }\n            }\n          }\n        }\n      }\n    }\n    #swagger.responses[403] = {\n      schema: {\n        \"$ref\": \"#/definitions/InvalidAPIKey\"\n      }\n    }\n    */\n      try {\n        const types = await new CollectorApi().acceptedFileTypes();\n        if (!types) {\n          response.sendStatus(404).end();\n          return;\n        }\n\n        response.status(200).json({ types });\n      } catch (e) {\n        console.error(e.message, e);\n        response.sendStatus(500).end();\n      }\n    }\n  );\n\n  app.get(\n    \"/v1/document/metadata-schema\",\n    [validApiKey],\n    async (_, response) => {\n      /*\n    #swagger.tags = ['Documents']\n    #swagger.description = 'Get the known available metadata schema for when doing a raw-text upload and the acceptable type of value for each key.'","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/endpoints/api/document/index.js#L760-L796","documentation":"HTTP 404 returned by GET /v1/document/accepted-file-types in AnythingLLM. The handler asks the collector for its supported types via new CollectorApi().acceptedFileTypes(); if the call returns a falsy value (null/undefined/empty) the route answers sendStatus(404). This is not a 'document not found' - it means the collector reported no types.","triggerScenarios":"Collector process not running or unreachable so acceptedFileTypes resolves to null; collector running an old version that does not implement the types endpoint; collector connected but returned an empty list due to a config error.","commonSituations":"Fresh install where the collector container was not started; misconfigured COLLECTOR_API base URL/port; collector crashed and its HTTP server is down; version skew between server and collector where the types route does not exist yet.","solutions":["Verify the collector/Python service is running and its HTTP port matches the server's COLLECTOR_API configuration.","Hit the collector's health/types endpoint directly to confirm it returns a non-empty payload.","Restart the collector container and retry the AnythingLLM endpoint.","Align collector and server versions if there is version skew.","If the collector intentionally returns no types, fix its MIME/config so it advertises at least one accepted type."],"exampleFix":"// before\nconst r = await fetch('/v1/document/accepted-file-types');\nif (r.status === 404) throw new Error('not found');\n\n// after - treat 404 here as 'collector down', not a missing resource\nconst r = await fetch('/v1/document/accepted-file-types');\nif (r.status === 404) throw new Error('Collector returned no file types - check collector service health');","handlingStrategy":"fallback","validationCode":"// Probe collector health indirectly before relying on file-types\nconst r = await fetch('/v1/document/accepted-file-types');\nif (r.status === 404) throw new Error('Collector returned no types - verify collector service is up');","typeGuard":"function isFileTypesPayload(v) {\n  return v != null && typeof v === 'object' && Array.isArray(v.types) && v.types.length > 0;\n}","tryCatchPattern":"try {\n  const r = await fetch('/v1/document/accepted-file-types');\n  if (r.status === 404) throw new Error('no types - collector down or empty config');\n  if (!r.ok) throw new Error('file-types request failed: ' + r.status);\n  const json = await r.json();\n  if (!isFileTypesPayload(json)) throw new Error('empty/invalid types payload');\n} catch (e) { throw e; }","preventionTips":["Treat a 404 from this endpoint as 'collector reported no types', not a missing document.","Ensure the collector service is running and version-aligned with the server.","Cache the file-types list at startup to avoid repeated dependency on collector uptime.","Alert if the endpoint flips from 200 to 404 - it signals collector regression."],"tags":["anythingllm","collector","file-types","http-404","health"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}