Skip to content

server : add request path to 404 error message#24409

Open
Jinpop wants to merge 1 commit into
ggml-org:masterfrom
Jinpop:server-404-path
Open

server : add request path to 404 error message#24409
Jinpop wants to merge 1 commit into
ggml-org:masterfrom
Jinpop:server-404-path

Conversation

@Jinpop

@Jinpop Jinpop commented Jun 10, 2026

Copy link
Copy Markdown

Overview

This PR updates the 404 response to include the requested path.

Previously, missing routes returned only "File Not Found", which made it unclear which path caused the error. This led to confusion in cases like #24224, where the user thought the server was running on the wrong port.

Fixes #24279

Additional information

Before:

{"error":{"message":"File Not Found","type":"not_found_error","code":404}}

After:

{"error":{"message":"File Not Found: /app","type":"not_found_error","code":404}}

Tests

Added test_404_error_includes_path, which verifies that a request to a missing route returns 404 and includes the requested path in the error message.

Local Verification

Verified locally on macOS Apple Silicon. The new test and the existing test_no_webui test both pass.

The path is also safe to include even when it contains invalid UTF-8, since the response is serialized through safe_json_to_str, which already uses error_handler_t::replace.

Requirements

The design decisions were made by me, including the response message format, keeping the existing "File Not Found" prefix for compatibility, and defining the test scenario.

AI was used to assist with issue and codebase exploration, build/reproduction/test execution, typing the code according to my design, and reviewing the changes. The commit message wording was also suggested by AI.

I personally reviewed and understood every changed line in this PR.

@Jinpop Jinpop requested a review from a team as a code owner June 10, 2026 10:27
@github-actions github-actions Bot added examples python python script changes server labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

llama-server prints that some file is missing but doesn't say what file

1 participant