zylon-ai/private-gpt · error · HTTPException

Invalid file ID.

Error message

Invalid file ID.

What it means

Error "Invalid file ID." thrown in zylon-ai/private-gpt.

Source

Thrown at private_gpt/server/files/file_service.py:228

        self._validate_file_id(storage_path)
        if not storage_path.startswith("uploads/"):
            raise HTTPException(
                status_code=404,
                detail=f"File '{file_id}' not found or is a sandbox output (cannot be deleted).",
            )
        _folder, filename = storage_path.split("/", 1)
        deleted = await storage.delete_file(self._uploads_prefix(scope_id), filename)
        if not deleted:
            raise HTTPException(
                status_code=404,
                detail=f"File '{file_id}' not found or is a sandbox output (cannot be deleted).",
            )
        return DeletedFile(id=file_id)

    @staticmethod
    def _validate_file_id(file_id: str) -> None:
        if ".." in file_id.split("/"):
            raise HTTPException(status_code=400, detail="Invalid file ID.")

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Provide a valid file ID as returned by the file upload or list endpoint.
  2. Check the file ID for typos or truncation before sending the request.
  3. Use the files list endpoint to look up the correct file_id for the target file.

When it happens

Trigger: Raised when the supplied file ID fails validation (malformed, empty, or not matching the expected format) before any lookup occurs.

Common situations: Client sends a hand-constructed or truncated file id to the files endpoint; also occurs when URL path parameters are mangled.


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/349bf70ff6b5cded. Report an issue: GitHub.