[GH-ISSUE #4824] [TUI] strata launch: a runtime host left in "failed" blocks the start after tuning, and --save-preset is lost #2215

Open
opened 2026-11-04 01:57:34 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @gdevenyi on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4824

Area

[TUI] (the Terminal: strata launch)

Desktop app, Terminal or source?

Terminal (strata launch).

What happened

A strata launch with thorough tuning finished tuning, then failed to start the server. The launch preset named by --save-preset was not saved. I ran nothing else during this launch.

Tuning result: faster. Done: answers are about 16% faster with the tuned settings.  100%
  Starting the engine and loading the model. The first start can take a few minutes.
  Loading the model… 1 s
  Loading the model… 2 s
  Loading the model… 3 s
strata: The server could not start: this profile already has a live managed runtime Another Strata server for this preset is still running or starting, so this start never began and there is no engine log for it. Run the command again; if it repeats, `strata launch --stop` ends the other server first.

Three things go wrong together:

  1. The launch finds the blocker only after tuning. stop_own_server_for_tuning and Runner.start stop a server only in state ready or starting (strata_cli/launch/runner.py:1635, :1796). _stop_all also handles failed and stale (strata_cli/launch/cmd.py:499). A runtime host still alive in failed is therefore skipped twice, and runtime.start then refuses it at strata_control/runtime.py:308-309. Here that came after a tune that can take up to 2 hours.
  2. The message is misleading. It says another server is "still running or starting", but in the reproduction below the host's server had already exited. Its advice to run the command again would, with --retune in the command, measure everything again.
  3. The preset is lost. store.save runs only after runner.run() succeeds (strata_cli/launch/cmd.py:855-859), so a failed start drops --save-preset even though the tuning result exists.

The host that stays alive after its server exits is #4574. This report is about what strata launch does when it meets one.

Smallest steps or command that reproduce it

The real run:

strata launch --family qwen --model iq3_s --context 256k --vision on --parallel 8 --gpu 0,1 \
  --tune thorough --tune-allow-small --retune --no-api-key --port 8000 --save-preset A6000-8-256k --yes --no-tui --drafting auto

A reproduction of the mechanism, with no GPU. It uses the fake engine and tokenizer from setUp in tests/terminal/test_runtime.py, in a throwaway folder:

  1. runtime.start(name, wait=60).
  2. Send SIGKILL to the server (child_pid in runtime.status).
  3. Call the real Runner.stop_own_server_for_tuning, then the real Runner.start, on a stand-in object with the other launch steps stubbed. Tuning itself is not run.

Output:

1 first start ok: True ready None
2 serving: state=ready error=None host_pid=3980052 child_pid=3980164
3 after the server child was killed: state=failed error=server_exited host_pid=3980052 child_pid=3980164
  host process alive: True
4 stop_own_server_for_tuning emitted: []
  after that step (tuning would run now): state=failed error=server_exited host_pid=3980052 child_pid=3980164
  host process alive: True
5 Runner.start raised: The server could not start: this profile already has a live managed runtime | Another Strata server for this preset is still running or starting, so this start never began and there is no engine log for it. Run the command again; if it repeats, `strata launch --stop` ends the other server first.
  emitted: ['Starting the engine and loading the model. The first start can take a few minutes.']
6 after the failed start: state=stopped error=None host_pid=None child_pid=None
  host process alive: False
7 second start ok: True ready None

Step 6 shows that the failed start's own cleanup (end_failed_start) removes the host. So the blocker is gone after the error, a second start works, and looking for it afterwards finds nothing.

Reproduction status

  • Observed once on real hardware: the error output above.
  • Reproduced with a fake engine at c62d5e3a: the same error text, through the steps above, using a killed server to create the failed state.
  • Not confirmed: that a failed host caused the real failure. I did not capture its state before the error. The output fits: it has no "Stopping the model to measure" line and no "already running; restarting" line, so neither check saw a ready or starting server. From reading the code, the tuner does not start a runtime host itself, so such a host would have to come from an earlier launch of this preset. I have not confirmed that either, or why its server exited.
  • From reading the code only (unconfirmed static analysis): the lost preset (item 3). strata launch --status also hides this host, because it lists only ready and starting (strata_cli/launch/cmd.py:613).

Suggested fix

  1. Look for a live host in any state before tuning starts, and stop it the way _stop_all does, so the problem cannot appear after a long tune. A stop from another process may return before the host has released its lock (unconfirmed static analysis), so the start should wait for the lock.
  2. Save --save-preset once the choices and tuning result exist, or save it on a failed start too, so the next run does not lose them.
  3. Say what was actually found ("the last server for this preset had stopped"), and do not suggest repeating a command that contains --retune without saying it will measure again.

Fixing #4574 would stop most of these hosts appearing, but items 2 and 3 are needed either way.

Strata version

Engine 0.1.55, from the output. The Terminal version on that machine was not recorded. The reproduction ran from a source checkout at c62d5e3a (0.2.9).

Graphics card, memory and system

2x RTX 6000 Ada Generation 48 GB, 512 GB RAM. OS not recorded. The reproduction ran on a different Linux machine and used no GPU.

Model, size and settings

Qwen3.8-Flash-Next IQ3_S, 256K context, pictures on, --parallel 8, as in the command above.

Logs

The output above is what I have. I did not keep the runtime host or server logs from the real run.

Written with AI assistance (Claude Code). I checked the code references against the commit named and ran the reproduction shown.

Originally created by @gdevenyi on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4824 ### Area [TUI] (the Terminal: `strata launch`) ### Desktop app, Terminal or source? Terminal (`strata launch`). ### What happened A `strata launch` with thorough tuning finished tuning, then failed to start the server. The launch preset named by `--save-preset` was not saved. I ran nothing else during this launch. ``` Tuning result: faster. Done: answers are about 16% faster with the tuned settings. 100% Starting the engine and loading the model. The first start can take a few minutes. Loading the model… 1 s Loading the model… 2 s Loading the model… 3 s strata: The server could not start: this profile already has a live managed runtime Another Strata server for this preset is still running or starting, so this start never began and there is no engine log for it. Run the command again; if it repeats, `strata launch --stop` ends the other server first. ``` Three things go wrong together: 1. **The launch finds the blocker only after tuning.** `stop_own_server_for_tuning` and `Runner.start` stop a server only in state `ready` or `starting` (`strata_cli/launch/runner.py:1635`, `:1796`). `_stop_all` also handles `failed` and `stale` (`strata_cli/launch/cmd.py:499`). A runtime host still alive in `failed` is therefore skipped twice, and `runtime.start` then refuses it at `strata_control/runtime.py:308-309`. Here that came after a tune that can take up to 2 hours. 2. **The message is misleading.** It says another server is "still running or starting", but in the reproduction below the host's server had already exited. Its advice to run the command again would, with `--retune` in the command, measure everything again. 3. **The preset is lost.** `store.save` runs only after `runner.run()` succeeds (`strata_cli/launch/cmd.py:855-859`), so a failed start drops `--save-preset` even though the tuning result exists. The host that stays alive after its server exits is #4574. This report is about what `strata launch` does when it meets one. ### Smallest steps or command that reproduce it The real run: ```sh strata launch --family qwen --model iq3_s --context 256k --vision on --parallel 8 --gpu 0,1 \ --tune thorough --tune-allow-small --retune --no-api-key --port 8000 --save-preset A6000-8-256k --yes --no-tui --drafting auto ``` A reproduction of the mechanism, with no GPU. It uses the fake engine and tokenizer from `setUp` in `tests/terminal/test_runtime.py`, in a throwaway folder: 1. `runtime.start(name, wait=60)`. 2. Send SIGKILL to the server (`child_pid` in `runtime.status`). 3. Call the real `Runner.stop_own_server_for_tuning`, then the real `Runner.start`, on a stand-in object with the other launch steps stubbed. Tuning itself is not run. Output: ``` 1 first start ok: True ready None 2 serving: state=ready error=None host_pid=3980052 child_pid=3980164 3 after the server child was killed: state=failed error=server_exited host_pid=3980052 child_pid=3980164 host process alive: True 4 stop_own_server_for_tuning emitted: [] after that step (tuning would run now): state=failed error=server_exited host_pid=3980052 child_pid=3980164 host process alive: True 5 Runner.start raised: The server could not start: this profile already has a live managed runtime | Another Strata server for this preset is still running or starting, so this start never began and there is no engine log for it. Run the command again; if it repeats, `strata launch --stop` ends the other server first. emitted: ['Starting the engine and loading the model. The first start can take a few minutes.'] 6 after the failed start: state=stopped error=None host_pid=None child_pid=None host process alive: False 7 second start ok: True ready None ``` Step 6 shows that the failed start's own cleanup (`end_failed_start`) removes the host. So the blocker is gone after the error, a second start works, and looking for it afterwards finds nothing. ### Reproduction status - **Observed once on real hardware:** the error output above. - **Reproduced with a fake engine at c62d5e3a:** the same error text, through the steps above, using a killed server to create the `failed` state. - **Not confirmed:** that a `failed` host caused the real failure. I did not capture its state before the error. The output fits: it has no "Stopping the model to measure" line and no "already running; restarting" line, so neither check saw a `ready` or `starting` server. From reading the code, the tuner does not start a runtime host itself, so such a host would have to come from an earlier launch of this preset. I have not confirmed that either, or why its server exited. - **From reading the code only (unconfirmed static analysis):** the lost preset (item 3). `strata launch --status` also hides this host, because it lists only `ready` and `starting` (`strata_cli/launch/cmd.py:613`). ### Suggested fix 1. Look for a live host in any state before tuning starts, and stop it the way `_stop_all` does, so the problem cannot appear after a long tune. A stop from another process may return before the host has released its lock (unconfirmed static analysis), so the start should wait for the lock. 2. Save `--save-preset` once the choices and tuning result exist, or save it on a failed start too, so the next run does not lose them. 3. Say what was actually found ("the last server for this preset had stopped"), and do not suggest repeating a command that contains `--retune` without saying it will measure again. Fixing #4574 would stop most of these hosts appearing, but items 2 and 3 are needed either way. ### Strata version Engine 0.1.55, from the output. The Terminal version on that machine was not recorded. The reproduction ran from a source checkout at c62d5e3a (0.2.9). ### Graphics card, memory and system 2x RTX 6000 Ada Generation 48 GB, 512 GB RAM. OS not recorded. The reproduction ran on a different Linux machine and used no GPU. ### Model, size and settings Qwen3.8-Flash-Next IQ3_S, 256K context, pictures on, `--parallel 8`, as in the command above. ### Logs The output above is what I have. I did not keep the runtime host or server logs from the real run. Written with AI assistance (Claude Code). I checked the code references against the commit named and ran the reproduction shown.
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#2215
No description provided.