Skip to content

Iceberg REST answers an unreadable metadata file with a 500 typed NotFoundException #1841

Closed

Description

@moomindani

Describe the bug

When the metadata file a table points at cannot be read, the Iceberg REST endpoints answer 500 with
"type": "NotFoundException" and the reader's own message, which quotes the path the server keeps the
file at:

{"error":{"message":"Failed to read file: /tmp/marksheet_uniform/metadata/00002-5b7aa739-d074-4764-b49d-ad6c63419576.metadata.json","type":"NotFoundException","code":500}}

The status and the type contradict each other. Iceberg raises NotFoundException for any file a table
points at, and IcebergRestExceptionHandler has no case for it, so the status comes from the internal
error the request became while the type comes from the cause. A client reading that type is told the
thing it asked for is missing -- something it could act on -- when the table is there and the server
could not read it. The message also puts the server's storage layout in a client-facing error.

To Reproduce

Steps to reproduce the behavior:

  1. Start the server and expose a table through the Iceberg REST catalog.
  2. Remove the metadata file the table's metadata pointer names (or point it at a file that is not
    there), leaving the table registered.
  3. GET /api/2.1/unity-catalog/iceberg/v1/catalogs/{catalog}/namespaces/{schema}/tables/{table}
    answers the 500 above, typed NotFoundException.

Expected behavior

A 500 whose type says a server-side failure, and a message that says the table's Iceberg metadata could
not be read without quoting where the server keeps it. The reason belongs in the server's log.

System [please complete the following information]:

  • OS: macOS 15, server built from main at 58d5c7b

Additional context

Iceberg's client picks the exception from the status, so a 500 raises ServiceFailureException
whatever the type says; the type is what makes the response contradict itself, and what a client
inspecting the body reads.

Activity

  1. added a commit that references this issue on Sep 14, 2026
    2b57e36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions