Skip to content

bug: railtracks viz serves {"error":"File not found"} with no indication that init is required #1103

Description

@CoronRing

Problem

Running railtracks viz without first running railtracks init starts the server successfully (port 3030, no terminal errors, browser opens automatically), but every browser request returns:

{"error":"File not found"}

There is no error message in the terminal indicating that the UI package is missing or that railtracks init needs to be run first. The server logs look completely healthy, so the user has no way of knowing what went wrong.

Root cause

railtracks viz calls create_railtracks_dir() (creates .railtracks/) but never downloads the UI bundle. The server's catch-all route in viz_server.py silently falls through to a 404 JSON response when .railtracks/ui/index.html does not exist.

Steps to reproduce

# Fresh clone, or after deleting .railtracks/
railtracks viz
# → browser opens to http://localhost:3030
# → shows {"error":"File not found"} — no hint in the terminal

Expected behaviour

Either:

  • railtracks viz should auto-download the UI if missing (no extra step needed), or
  • a clear error message should be shown: "UI bundle not found — run railtracks init first"

The current silent failure is especially confusing because the server reports itself as running successfully.

Fix

Check for index.html in viz before starting the server and auto-download if missing — making railtracks init optional rather than an undocumented prerequisite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is an issue outlining a bug in the framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions