[GH-ISSUE #2872] bench.sh crashes with NameError when it starts the server itself (regression from #2330) #1161

Closed
opened 2026-11-04 01:48:59 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kristoffern on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2872

What happened

./bench.sh (with no --url) crashes before it starts the model:

  File "tools/strata_bench.py", line 990, in main
    say(f"Starting {cfg_path.name} on port {port} (loading takes 1-3 minutes; the PC may be slow meanwhile) ...")
NameError: name 'port' is not defined

Commit 69fe4055 (#2330) replaced

port = a.port or int(cfg.get("port", 8080))
base = f"http://127.0.0.1:{port}"

with base = server_base(cfg.get("host"), a.port or int(cfg.get("port", 8080))), but port is still used at lines 987, 990 and 991 (start_server(cfg_path, port, ...)). Every run where bench.sh starts the server hits this. Running with --url against an already running server works, because it skips that branch.

To reproduce: a set-up install with no server running, then ./bench.sh.

Suggested fix: keep the variable.

port = a.port or int(cfg.get("port", 8080))
base = server_base(cfg.get("host"), port)

Workaround until then: start the model with ./run-<model>.sh, then ./bench.sh --url http://127.0.0.1:<port>.

Strata version, GPU, OS

Engine 0.1.45 (main at 477ac13c, still present on main today). RTX 3090, Linux (Ubuntu 24.04 base), engine compiled from source by setup.

Originally created by @kristoffern on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2872 ### What happened `./bench.sh` (with no `--url`) crashes before it starts the model: ``` File "tools/strata_bench.py", line 990, in main say(f"Starting {cfg_path.name} on port {port} (loading takes 1-3 minutes; the PC may be slow meanwhile) ...") NameError: name 'port' is not defined ``` Commit 69fe4055 (#2330) replaced ```python port = a.port or int(cfg.get("port", 8080)) base = f"http://127.0.0.1:{port}" ``` with `base = server_base(cfg.get("host"), a.port or int(cfg.get("port", 8080)))`, but `port` is still used at lines 987, 990 and 991 (`start_server(cfg_path, port, ...)`). Every run where bench.sh starts the server hits this. Running with `--url` against an already running server works, because it skips that branch. To reproduce: a set-up install with no server running, then `./bench.sh`. Suggested fix: keep the variable. ```python port = a.port or int(cfg.get("port", 8080)) base = server_base(cfg.get("host"), port) ``` Workaround until then: start the model with `./run-<model>.sh`, then `./bench.sh --url http://127.0.0.1:<port>`. ### Strata version, GPU, OS Engine 0.1.45 (main at 477ac13c, still present on main today). RTX 3090, Linux (Ubuntu 24.04 base), engine compiled from source by setup.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271331222 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1161
No description provided.