mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3605] [Engine] During initial strata launch migrating from 0.1.45 to 0.2.1 it hangs while test-starting the engine #1488
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1488
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @njcray2 on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3605
Windows 11, 64GB, RTX 4070 Ti Super, source installation
Updated from 0.1.45 source installation.
Ran "M:\Strata.venv\Scripts\python.exe" strata.py launch
It found the installed model (iq3_xxs) and after I answered the setup questions it downloaded engine 0.1.47 windows-x86_64-cuda-cuda13 and then "test-started" it. This successfully starts the engine but it never responds and eventually times out. At this point the script deletes the engine.
I have tried this with and without
set STRATA_COMPONENTS_DIR=M:\Strata-Components. The 2nd time I allowed it to install into %appdata%\local\ but that did not help. The log is included below. It did leave a file in%appdata%\Local\Strata\components.updates\partial in both cases but also what seemed like a full engine in the .s directory before it was deleted. The failure method was the same in both cases.
test-start-0.1.7.log
state.json
@njcray2 commented on GitHub (Oct 21, 2026):
I have copied the contents of the engine folder from after it was downloaded and before it gets deleted into its old location (Strata/engine) and from there it works fine with an old config to start it up. So the engine itself seems functional but something isn't communicating with it.
@njcray2 commented on GitHub (Oct 21, 2026):
Qwen3.8-Flash Next has found the cause of the problem and fixed it:
What the fault is
*.venv\Scripts\python.exe was not the Python interpreter — it was the venv module's redirector, and that broke an identity check in the managed start.
python -m venv does not copy the interpreter into Scripts. It copies its own little helper (C:\Users\njcr\AppData\Local\Programs\Python\Python312\Lib\venv\scripts\nt\python.exe, 274,424 B — exactly the size that was sitting in M:\Strata.venv\Scripts). Windows has no in-place exec, so that helper starts the real interpreter as a child process and waits for it. Your venv was created that way (pyvenv.cfg says command = ...\Python312\python.exe -m venv M:\Strata.venv), and the process tree during a managed start showed the doubling twice over:
The host writes the ready file path and the PID of the process it started into its child marker, and runtime.py:901-904 only ever runs the readiness probe when
The ready record is published by the grandchild that bound the socket (37996), while the host believes its server is the launcher (20164). They can never agree. So the probe is never attempted, the phase never even becomes verifying_generation, and _status() keeps answering state: "starting" until start() runs out its min(test_timeout, 600) wait and returns startup_wait_expired — which the updater words as "it did not answer a one-token probe" and then acts on by deleting the staged engine.
That is why the engine looked innocent: it never received a request. In all three failed logs the engine loaded completely (session is up (engine 0.1.47), 4,661 cache slots, 1266 MiB of VRAM free with everything loaded) and then nothing, and the strata verify: capturing the 4-token window lines that always accompany a first decode never appear — because nothing was ever asked of it. Its command line was byte-identical to your working 17:02 run; only the supervision differed.
What I changed (and how to undo it)
In M:\Strata.venv\Scripts: python.exe → python.exe.orig, pythonw.exe → pythonw.exe.orig (kept), and a copy of C:\Users\njcr\AppData\Local\Programs\Python\Python312\python.exe / pythonw.exe put in their place. Nothing else was touched — the venv itself, its 28 packages and your running model are untouched. Verified afterwards with your own .venv: it is still a venv (sys.prefix = the venv, jinja2/regex/textual/numpy/PIL all import), no extra process hop, and the managed start reaches launch_attested: true, generation_ready: true.
Worth knowing for the future: START-HERE.bat:11 prefers a bundled python\python.exe (the terminal archive ships one) and only falls back to a venv. A bundled runtime has no redirector, which is why most Windows installs never meet this bug — yours took the venv path.
@gylinc commented on GitHub (Oct 21, 2026):
Third data point (Windows 11, RTX 5090, cuda13, git-source install, NVFP4 pack):
strata serve: 8161 MiB of VRAM free with everything loaded— yet the one-token probe never answered →startup_wait_expired,ok:false, engine auto-restored to 0.1.45.3. Same shape as the OP: engine starts, but the harness never hears from it.--vram-reserve-mib1100 → 2048 (the engine's own #2065 warning suggested >=1344 on a near-full card). With 2048 everything loads, ~1.6 GiB stays free, serving is stable. Greedy expert-cache sizing alone was not the solo test's failure, but flagging it since it's the only config delta I made.Happy to supply the feed state.json, test-start-0.1.47.log or fresh engine logs if useful.
@rkarp commented on GitHub (Oct 26, 2026):
I let DeepSeek-V4.1-Flash-1017 analyze this (after hitting it myself previously), it's already fixed:
Resolved — the Windows venv launcher broke the ready-file check; fixed in v0.2.3 and later
Same failure shape on a source install, matching @njcray2's analysis. With a
.venv,Scripts\python.exeis the venv redirector (255,200 B here; the real interpreter is 105,696), so the process that publishes the ready file sits one process below the pidPopenreturned. The checkready.get("pid") == child.pidnever matched, no probe was ever sent,_status()kept answeringstarting, the deadline ran out, and the updater deleted the staged engine withstartup_wait_expired— although the engine had loaded completely and never received a request.Fix:
72d0bf66— "Fix #3683: the test start no longer waits out its 10 minutes when a Windows venv launcher sits above the server" (merged in0788a91c). It accepts a ready pid within three parents of the host's child, Windows only. First release containing it: v0.2.3.Evidence from a source checkout at v0.2.6 (RTX 3090, sm_86, driver 610.62):
Passed:
test_ready_pid_may_be_a_child_of_the_launcher_on_windows_onlyandtest_server_started_through_a_launcher_process_becomes_ready(the second starts the server through a launcher, asserts the ready pid differs from the host's child pid, and still reachesready+generation_ready).Passed:
.\START-HERE.bat --update, engine test-started and switched to 0.1.50. The newtest-start-0.1.50.logends with:The failing
test-start-0.1.47.logfrom 2026-10-21 stops atstrata serve: 1144 MiB of VRAM free with everything loadedwith no verify window after it — 7strata verifylines in the new log, 1 in the old.Not tested: I did not reproduce the original hang on the old code (that checkout is gone), and I did not run the desktop app.
For anyone still hitting this: pull a build from v0.2.3 or later and run
UPDATE.bat/.\START-HERE.bat --update. There is nothing to move inside.venv\Scripts— the redirector can stay. If a version is already marked failed in<components>\.updates\state.json,strata update --forcere-offers it; a stale partial download never resumes, since the file is named by the new package's SHA-256. Check<components>\.updates\logs\test-start-<version>.log: the tell is a load that reaches "everything loaded" and then nostrata verifywindow. After the fix, the failure'sphasefield saysloading,verifying_generationorready_file_not_matched— attach the log with it.@Niko1221 commented on GitHub (Oct 29, 2026):
Thank you, and thanks to rkarp for the analysis. Fixed in 0.2.3: the test start of a new engine accepts a ready file whose process is up to three parents below the launcher, which is what a Windows
.venvlauncher creates. Update and runstrata launchagain.Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.3