Skip to content

[Bug]: hermes update fails on Windows with Access is denied (os error 5) during uv pip install. #23327

Closed as not planned

Description

@grizdum

Bug Description

This is the hermes beta windows version running in powershell.

did a hermes update and got a lot of "Access is denied. (os error 5)" and "raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Users\******\.local\bin\uv.EXE', 'pip', 'install', '-e', '.']' returned non-zero exit status 2."

my wsl hermes told me: Cause: Windows prevents overwriting hermes.exe while the process is active.
Fix: hermes_cli/main.py needs to rename the active hermes.exe before calling the installer.

Steps to Reproduce

run hermes update in powershell.

Expected Behavior

Just a nice update without any problems.

Actual Behavior

Lot's of access is denied.

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/4JMDs
  agent.log  https://paste.rs/z6nKA

Operating System

windows 11

Python Version

3.11.15

Hermes Version

v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/cliCLI entry point, hermes_cli/, setup wizard
    python:uvPull requests that update python:uv code
    on May 10, 2026
  2. added a commit that references this issue on May 10, 2026
    d6f79ed
  3. teknium1 commented on Jun 11, 2026

    @teknium1
    Collaborator

    This looks implemented on current main by the Windows update quarantine work.

    Automated hermes-sweeper review evidence:

    • hermes_cli/main.py:6773 defines _quarantine_running_hermes_exe; its docstring explicitly names the reported failure mode: Windows blocks replacing the running hermes.exe, so uv/pip install can fail with Access is denied. (os error 5), and the fix renames live shims to hermes.exe.old.<timestamp> before install.
    • hermes_cli/main.py:7046 routes editable install attempts through _run_quarantined_install, which calls the quarantine helper before running the install.
    • hermes_cli/main.py:8501 shows the hermes update dependency install path calling _install_python_dependencies_with_optional_fallback([uv_bin, "pip"], ...), so the Windows quarantine is on the update path that failed here.
    • Regression coverage exists in tests/hermes_cli/test_update_concurrent_quarantine.py:348 and following for successful quarantine, retry, reboot-deferred fallback, and actionable warning behavior.
    • The implementation landed in 4d9dcbc47ae40ad1ddc2f02221fe7283c65106b6 (fix(windows): unbreak install + update on Windows (#23394)), which git tag --contains shows is included in v2026.5.16.

    Closing as implemented on main.

  4. sizzlled1-blip commented on Aug 12, 2026

    @sizzlled1-blip

    Reproducible on v0.20.0 (Windows 11) on 2026-08-12, and the closed fixes do NOT cover this case.

    What actually fails

    The updater pulls code fine, then runs uv pip install -e . to reinstall deps. But the running hermes process has already imported cryptography (for Nous Portal OAuth / TLS), so its compiled Lib\site-packages\cryptography\hazmat\bindings\_rust.pyd is loaded into the live process. uv pip install then tries to reinstall cryptography and replace that exact _rust.pyd → Windows refuses (file in use) → WinError 5: Access is denied → the uv pip install -e . step exits code 2 → the install is left half-broken. Every subsequent hermes doctor / hermes setup then re-runs the same uv pip install, re-locks the same file, and re-fails — a self-deadlock. (PR #26677 / #23408 only rename hermes.exe; they do not release the cryptography .pyd, so the wedge persists.)

    Reliable workaround (verified)

    Run the dependency reinstall from a process that does NOT have cryptography loaded:

    1. End the chat / close all Hermes windows (so nothing holds the .pyd).
    2. taskkill /F /IM Hermes.exe /T
    3. D:\hermes\bin\uv.exe pip install -e D:\hermes\hermes-agent --python D:\hermes\hermes-agent\venv
      (uv.exe uses its own bundled python, so it never loads the venv's cryptography and can replace the file freely.)
    4. Relaunch D:\hermes\hermes-agent\venv\Scripts\hermes.exe fresh.

    Suggested real fixes

    • Do the dependency reinstall in a child process that has NOT imported cryptography (e.g. spawn a fresh python -m pip install after the portal/TLS handshake, or release the module before install).
    • Or stage the new venv into a temp dir and atomically swap it, the same way the .exe quarantine works.
    • Or in _run_quarantined_install, first taskkill /F /IM Hermes.exe /T (the running instance) before uv pip install, so no live process holds the venv files.

    Happy to test a patch on Windows if it helps.

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

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardpython:uvPull requests that update python:uv codesweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions