[TUI] running_launches(): prof is read outside the try that binds it — traceback, or the wrong launch's config
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
The bug is in running_launches() in strata_cli/launch/cmd.py, lines 612-620: prof is bound only inside the try, but line 620 reads prof.get("source_config") after it. Start there, then reproduce by stubbing runtime.status to ready with one profile whose overrides.port is a string, which should raise UnboundLocalError. Done means a damaged profile costs only its own row, and a later bad row no longer inherits the previous profile's source_config.
Written by the indexing model from the issue text.
Description
Problem: in strata_cli/launch/cmd.py:612-619, prof is bound inside the try and the except sets only ov = {} — but line 620 reads prof.get("source_config") AFTER the try, unguarded. If profiles.load() raises for a profile whose RUNTIME state is ready/starting (status comes from the runtime state file, independent of the profile file): the first such row raises UnboundLocalError — a NameError, not a ValueError — which escapes both run_launch's handlers and _run's (ValueError/BrokenPipeError/OSError/ClientError/KeyboardInterrupt) → raw traceback from strata launch --status, --show-key, connect. On a LATER bad row, prof still holds the PREVIOUS profile's dict, so the row reports another launch's source_config — and launch_info() reads the API key from that wrong config.
Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag)
OS: Linux x86-64
Runtime: Python 3.14
Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own.
Reproduce (measured): with runtime.status stubbed to ready and exactly one profile present whose overrides are invalid (e.g. overrides.port as a string — profiles are owner-editable by design, and validate_overrides demands int): UnboundLocalError: cannot access local variable 'prof' where it is not associated with a value.
Expected: one damaged profile costs at most that row (or a clean one-line error).
Actual: traceback, or another launch's config reported for this row.
Reproduction status: crash measured at function level; the mis-attribution case read from the code. An AST sweep of strata_cli/ + strata_control/ (~34k lines) for this try-binding pattern found this as the only hit in scope.
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
Similar issues
-
bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
chipsalliance/verible#2644 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
grafana/pyroscope-dotnet#470 ·
Maintainers usually reply within 1 day
-
documentation P5 XS
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-astro/AlpacaBridge#1848 ·
Maintainers usually reply within 1 day
-
DiskANN AnnIterator returns unconverted IP distances after the graph walk runs out of candidatesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
zilliztech/knowhere#1933 ·
Maintainers usually reply within 1 day