Skip to content

[Bug] Windows installer fails with errors that aren't fatal #9804

Closed

Description

@fuutott

Environment

Where are you using Unsloth?

Unsloth desktop application

Operating system and version:

Windows x86_64.

GPU model(s) and accelerator backend:

NVIDIA GPU / CUDA (cu130).

Versions:

Unsloth Studio desktop: 0.1.803-beta
Unsloth: 2026.8.21
Python: 3.13.14
PyTorch: 2.10.0+cu130
What happened?

Steps to reproduce:

Start the initial Unsloth Studio desktop installation on Windows.
During the first attempts, the installer failed while checking/installing uv.
In my case, I already had uv running, which may explain why the installer could not successfully execute/replace it.
After closing the process using uv, run the installer again.
Installation then proceeds successfully through Python, PyTorch, Unsloth, dependencies, llama.cpp and the rest of Studio setup.
The installer prints Unsloth Studio Setup Complete.

Immediately afterwards it reports:

Error: Unsloth Studio update failed because the updated launcher is not on disk.

The installer then marks the entire installation as failed.
I stopped/closed the install window and opened Unsloth Studio again.
The application launched successfully and worked normally.

Expected behavior:

The installer should ideally recover gracefully from these situations where possible.

For the uv step, if a usable version of uv is already installed but cannot currently be replaced or executed because it is in use, it may be better to skip the update/replacement and continue using the existing installation where safe.

Similarly, if Studio setup has completed successfully but the final launcher/update step fails, the installer could check whether the installed launcher/application is already usable before treating the whole installation as failed.

Actual behavior:

The installer treats both situations as fatal installation failures.

The uv issue was likely caused by me already having uv running, so I do not think the inability to update uv itself is necessarily an Unsloth bug. However, it may be possible for the installer to detect that a working uv installation already exists and continue rather than failing the whole install.

On the successful attempt, Studio itself completed setup, but the final launcher/update check failed:

Unsloth Studio Setup Complete
────────────────────────────────────────────────────
launch unsloth studio -p 8888

Error: Unsloth Studio update failed because the updated launcher is not on disk.
Manual recovery copy retained at: <studio_home>\unsloth_studio\Scripts\unsloth.exe.update-backup
[TAURI:ERROR_DEFAULT] unsloth studio setup failed (exit code 1)

Windows Defender may have interfered with the launcher update/check in my case, although I have not confirmed that.

Despite the reported failure, simply closing the installer and reopening Unsloth Studio worked.

The main issue I am reporting is therefore the installer/recovery behaviour: these appear to be cases where the installer could potentially skip, retry, warn, or verify the existing installation rather than leaving the user with a hard installation failure.

Model and operation involved:

No model involved. Initial Windows desktop installation.

Diagnostics and logs

Full Copy Diagnostics attached.

Relevant final error:

Unsloth Studio Setup Complete

Error: Unsloth Studio update failed because the updated launcher is not on disk.
Manual recovery copy retained at: <studio_home>\unsloth_studio\Scripts\unsloth.exe.update-backup
[TAURI:ERROR_DEFAULT] unsloth studio setup failed (exit code 1)

Earlier uv failure:

Found uv [astral-sh.uv] Version 0.12.6
Successfully installed
...
uv --version gave no exit code; installing it unprobed.
the downloaded uv 0.12.1 could not run on this machine.
uv could not be installed
Additional context

The installation ultimately worked.

After the final error, I stopped/closed the installation window and reopened the Unsloth Studio desktop application. It launched normally.

So the suggestion is less about the underlying uv or Windows security behaviour and more about making the installer tolerant of these recoverable situations:

If uv is already installed and usable, avoid making an unsuccessful update/replacement fatal where possible.
If Studio setup is complete but the launcher update fails, check whether the existing launcher/app is usable.
If it is usable, show a warning and allow the user to continue rather than marking the whole installation as failed.

Activity

  1. added
    feature request
    on Aug 26, 2026
  2. Sletch commented on Aug 28, 2026

    @Sletch
    Contributor

    The two failures in this report have different causes, so they are probably worth separating.

    The launcher. The fix this looks like it needs — routing _LAUNCHER_ABSENT to the
    interpreter fallback the way _POLICY_BLOCKED is — already landed in #8592, and @fuutott is
    on 2026.8.21, so this is a post-fix report. _recovered_cli_health_error() does make that
    call, and _restore_runnable() consults it once every recovery candidate has been tried.

    What the log cannot say is why that call failed. validate_launcher() samples
    _launcher_health_error() before attempting recovery and reports that value, while
    _restore_runnable() returns a bare bool — so the verdict recovery actually acted on is
    computed and then discarded. With the launcher gone, the sampled value is _LAUNCHER_ABSENT
    whatever the underlying cause.

    In the output above, the updated launcher is not on disk together with Manual recovery copy retained at: means the interpreter probe failed too — that second line only prints
    when restored is false — on an install whose Studio then started normally. Nothing says
    why it failed.

    Reproduced at head using the existing fixtures in
    tests/python/test_windows_studio_update_launcher.py, with the launcher quarantined away
    and the managed CLI answering returncode = 3: _recovered_cli_health_error() returns
    the managed Python CLI returned 3 for --version, and the user is shown
    ...because the updated launcher is not on disk.

    I have a small PR ready that reports the reason recovery acted on instead, with regression
    tests for both reasons the interpreter fallback can give. It does not fix the underlying
    failure — it makes the next report of this able to name it. I will open it shortly, and am
    happy to close it if you would rather approach this differently.

    @fuutott if that install still exists, the fallback probes the managed interpreter beside
    the launcher with -X utf8 -I and the CLI entrypoint. Running

    <studio_home>\unsloth_studio\Scripts\python.exe -X utf8 -I -c "import unsloth_cli"
    

    exercises the part most likely to have failed, and whatever it prints is what the probe hit.
    Defender's protection history for that Scripts directory would confirm the quarantine.

    uv. Test-UvCandidateVersion in install.ps1 has no "unknown" verdict: a
    & $exe --version that throws returns $false, so a uv that is installed and current but
    momentarily in use fails Test-UvVersionOk and reaches
    Exit-InstallFailure "uv could not be installed". The sibling probe used on the freshly
    downloaded pinned binary does distinguish ok / failed / unknown, with a comment recording
    that treating unknown as broken turned three clean-machine CI legs into hard install
    failures. That reasoning looks like it applies to the gate as well, and would explain this
    half of the report.

    One more, adjacent rather than part of this: published = self.launcher.exists() is sampled
    before the health check, so a launcher quarantined between those two statements is fatal
    even when recovery succeeded. Absence and corruption are distinguishable there by the
    sentinel.

    Happy to take either of those as separate PRs if they would be useful.

  3. lonexreb commented on Sep 16, 2026

    @lonexreb
    Contributor

    Taking the uv half of this, since #9924 covers the launcher verdict and the uv analysis above has sat for a while. Credit to @Sletch for the split; the piece I can pin from the report's own steps is the replacement, not the gate: once Test-UvVersionOk fails, Install-UvFromRelease downloads and verifies the pinned build, runs it, and then Copy-Items over the existing uv.exe. With a uv running (the reporter's case) Windows refuses that overwrite, the loop sets $ok = $false, and the installer prints "the downloaded uv could not run on this machine", which is the one thing it had just proven false, then exits.

    PR coming with: skip the copy when the destination already holds the verified bytes (a running uv that is already ours needs no replacing), a short retry for a transient lock, and an honest "uv.exe at … is in use; close it and re-run" message otherwise. The Test-UvCandidateVersion "unknown" verdict you describe is left as is here: I have no evidence in the report that the gate, rather than the copy, is what failed, and treating a throwing probe as not-broken has consequences for which uv gets used afterwards. Happy to fold it in if the reporter's log says otherwise.

  4. lonexreb commented on Sep 16, 2026

    @lonexreb
    Contributor

    Opened #11081 for the uv half.

  5. Sletch commented on Sep 16, 2026

    @Sletch
    Contributor

    @lonexreb, thank you for taking this on. The reporter's log supports your reading over mine, so a correction to my comment above.

    Two lines in the uv output decide it. Line numbers are at f70af706b. Both messages were added in #8586 and the code around them is unchanged since, so this is the path the reporter's run took.

    • uv --version gave no exit code; installing it unprobed. is install.ps1:4590. Get-UvExecutableVerdict is called only at :4705, on the downloaded binary, and returns unknown right after this line.
    • the downloaded uv 0.12.1 could not run on this machine. is printed at :4706 and :4738. :4706 runs only on a failed verdict, so it came from :4738, after copying the new binaries into place (:4715-:4736) failed.

    That is the step #11081 changes. My comment blamed Test-UvCandidateVersion instead, for a probe that throws while uv is in use, and nothing in this log shows that.

    What the log leaves open is why Test-UvVersionOk still rejected uv after winget reported installing 0.12.6 (:4768-:4770, then :4777), which is what sent the installer to the pinned download. It was not the version: $UvMinVersion is 0.8.16. I agree the gate should not change on this evidence.

  6. lonexreb commented on Sep 16, 2026

    @lonexreb
    Contributor

    Thanks for checking it against the log, and for the line numbers; that settles which of the two messages the reporter hit. The open question you name (why Test-UvVersionOk still rejected uv after winget reported 0.12.6, with the floor at 0.8.16) is a real one and separate from #11081: nothing in that PR touches the gate, so if the answer turns out to be PATH refresh order after winget rather than the probe, it can be its own small change with its own evidence.

  7. danielhanchen commented on Sep 20, 2026

    @danielhanchen
    Member

    This issue should be fixed now hopefully! Please retry unsloth desktop from the latest update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions