mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3370] [Engine] serve: a temp cleaner that removes the idle vision encoder's work dir makes every later start fail ([WinError 267]) #1368
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#1368
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 @smallmj on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3370
Area
[Engine] (the server and API)
Desktop app, Terminal or source?
Source (the repo's
serve/server.py, started by our own launcher/router)What happened
With
idle_unload_sset, after the model had stayed unloaded for a while (overnight), the first request that loaded it again failed with a 503 whose message was:Every client retry failed the same way, seconds apart, for as long as the server process lived — only restarting the whole server healed it. The console showed a tight loop of full load attempts (the
before_loadhook ran, the free-VRAM check passed, then the vision start failed immediately; the engine was never reached):The engine's log had no trace of any of these attempts — no
engine startedlines (those are written before the spawn), no encoder stderr: the encoder process was never even spawned. Expected: the vision encoder starts again like it does after any other unload.Root cause
Vision.work_dir()runs once, at the server's start (Vision.__init__), and creates%TEMP%\strata-vision-*. The spawn usescwd=self.dirand nothing ever checks that the directory still exists (_start_reader()at current HEAD; the single spawn path in earlier versions).restart()reuses the stale path.While the model is unloaded, that directory sits empty and unheld in the temp directory — exactly what Windows' Storage Sense ("Delete temporary files that my apps aren't using", enabled on the affected machine) removes during a long idle window. The next request's
popen(cwd=<removed dir>)raisesOSError [WinError 267], whichensure_loadedwraps asEngineDied("the vision encoder failed to start: ...")→ 503 → the client retries → the identical failure, forever.#914madeshutdown()the only remover of the dir, but nothing defends it against external removal.Ruled out on the affected machine while diagnosing:
strata-vision.exe --gpuwith the config's real arguments started fine (mmproj load, warm-up, READY);Smallest steps that reproduce it
--lazywith a vision config.strata-vision-*directory in the temp directory.Reproduction status
Reproduced locally (twice on the affected machine, on different days; the second time with the client error text and the console loop captured).
Strata version
engine 0.1.45 · serve/server.py from this repo (the deployed checkout was unmodified; the bug is confirmed present at current main by reading the code,
e88ee39d)Graphics card, memory and system
RTX 3090 24 GB · 64 GB RAM · Windows 11 Pro
Model, size and settings
Qwen3.8-Flash-Next IQ3_S · 512K context (yarn ×2, k8v4 KV) · pictures on (
--vision, GPU encoder)Fix
In
Vision._start()(the wrapper at HEAD, so the CPU-fallback path is covered too), recreate the dir when it is gone and drop the cache — the encoded-image files lived in that dir, and the cache-hit branch ofencode()returns paths without checking they exist:PR #3372 carries the fix and a regression test (
serve/test_vision_dir.py).@github-actions[bot] commented on GitHub (Oct 20, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 20, 2026):
Thanks, this follows the format now.