You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resume again, with the variable set: dstack preset resume <id>.
Actual behaviour
Step 4 refuses:
Preset <id> creation failed and cannot be resumed
Step 3 is what marked the session failed. create_preset wraps the whole creation in except BaseException: _close_agent_session(session, "failed") (create.py:437-439), so any exception is terminal: it writes failed and deletes the workspace (create.py:754-756, workspace.py:120-130). Step 3's exception is raised at create.py:415, before _create_preset is entered, so nothing had started and nothing had changed, yet the session became unresumable. load_resumable_session then refuses (session.py:331-332).
Not caused by reconcile: _is_reconcilable requires status running, an existing report, and a dead owner (create.py:252-262), so an interrupted session is never reconciled.
Expected behaviour
Step 3 leaves the session interrupted, and step 4 resumes it. A failure that happens before the agent is spawned is not a failed creation.
Steps to reproduce
enventry, e.g.env: [MODEL_LABEL=some-value].dstack preset stop <id> -y. It correctly recordsinterruptedand printsResume it with dstack preset resume <id>.dstack preset resume <id>. It fails withEnvironment variable MODEL_LABEL is not set([Bug]: [Presets] Resume requires literal env values in the local environment #4165).dstack preset resume <id>.Actual behaviour
Step 4 refuses:
Step 3 is what marked the session failed.
create_presetwraps the whole creation inexcept BaseException: _close_agent_session(session, "failed")(create.py:437-439), so any exception is terminal: it writesfailedand deletes the workspace (create.py:754-756,workspace.py:120-130). Step 3's exception is raised atcreate.py:415, before_create_presetis entered, so nothing had started and nothing had changed, yet the session became unresumable.load_resumable_sessionthen refuses (session.py:331-332).Not caused by reconcile:
_is_reconcilablerequires statusrunning, an existing report, and a dead owner (create.py:252-262), so an interrupted session is never reconciled.Expected behaviour
Step 3 leaves the session
interrupted, and step 4 resumes it. A failure that happens before the agent is spawned is not a failed creation.