Skip to content

Unhandled ValueError (500 Internal Server Error) when requesting revisions for titles with no save data #2

@kanjieater

Description

@kanjieater

When the uNSS client is configured with restoreBy=all (the default), it requests save data revisions for all installed titles on the console. If the remote server does not yet have any backed-up save data for a specific title, the server throws an unhandled ValueError and returns a 500 Internal Server Error, rather than gracefully returning an empty response or a 404.

While POST requests (archiving) continue to work fine, this causes the server console to be heavily spammed with unhandled exception tracebacks during a pull/sync operation.

Steps to Reproduce:

Configure the Switch client config.ini with restoreBy=all.

Ensure the console has games installed that have never been backed up to the uNSS server.

Initiate a Pull/Sync operation from the Switch client.

Observe the Python server logs.

Expected Behavior:
The server should handle the missing data gracefully. If a GET request is made for a Title ID that does not exist in the server's backend, it should catch the error and return an empty list [] or a standard 404 Not Found response, rather than crashing the endpoint with a 500.

Actual Behavior / Traceback:
The server throws a 500 Internal Server Error. The crash originates in service.py at get_latest_revision_by_title.

INFO:     192.168.1.29:32779 - "GET /users/x/saves/0100ecd018ebe000/revisions HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  ... [ASGI/Starlette middleware trace omitted] ...
  File "fastapi\routing.py", line 212, in run_endpoint_function
  File "main.py", line 51, in get_revisions
  File "service.py", line 26, in get_latest_revision_by_title
ValueError: No revision found for title 0100ecd018ebe000

Environment:

Server OS: Windows (Prebuilt PyInstaller binary / Python backend)

Client: Nintendo Switch running uNSS 1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions