{"record":{"id":"49866235e52eed6d","repo":"odysseus-dev/odysseus","slug":"unsupported-file-type-ext-498662","errorCode":null,"errorMessage":"Unsupported file type: {ext}","messagePattern":"Unsupported file type: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/memory/memory_routes.py","lineNumber":385,"sourceCode":"                logger.warning(\"Session %s not found or inaccessible, falling back to utility endpoint\", session)\n                endpoint_url, model, headers = resolve_endpoint(\"utility\", owner=user)\n            else:\n                endpoint_url, model, headers = resolve_task_endpoint(\n                    sess.endpoint_url, sess.model, sess.headers, owner=user\n                )\n        else:\n            endpoint_url, model, headers = resolve_task_endpoint(owner=user)\n    \n        if not endpoint_url or not model:\n            raise HTTPException(400, \"No LLM model configured. Set a default model in Settings.\")\n\n        content = await read_upload_limited(file, MEMORY_IMPORT_MAX_BYTES, \"Memory import\")\n        filename = file.filename or \"upload\"\n        _, ext = os.path.splitext(filename.lower())\n\n        allowed = {\".txt\", \".md\", \".pdf\", \".csv\", \".log\", \".json\", \".py\", \".js\", \".html\"}\n        if ext not in allowed:\n            raise HTTPException(400, f\"Unsupported file type: {ext}\")\n\n        # Extract text based on file type\n        if ext == \".pdf\":\n            from src.document_processor import _process_pdf\n            with tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False) as tmp:\n                tmp.write(content)\n                tmp_path = tmp.name\n            try:\n                text = _process_pdf(tmp_path, owner=_owner(request))\n            finally:\n                os.unlink(tmp_path)\n        else:\n            try:\n                text = content.decode(\"utf-8\")\n            except UnicodeDecodeError:\n                from charset_normalizer import detect\n                encoding = (detect(content) or {}).get(\"encoding\") or \"utf-8\"\n                text = content.decode(encoding, errors=\"replace\")","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/memory/memory_routes.py#L367-L403","documentation":"Error \"Unsupported file type: {ext}\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Upload a file with a supported extension for memory extraction.","Convert the content to a supported text format and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}