Skip to content

[Bug]: Windows installer fails with "Access Denied" on pythonw.exe during auto-update #48100

Closed as not planned

Description

@FullRuQA

Bug Description

Environment

  • OS: Windows 11, Build 26H1
  • Hermes version: 0.16.0
  • Installation path: C:\Users\user\AppData\Local\hermes\

Problem
When the installer tries to auto-update Hermes, it fails with the error:
> "Не удается удалить элемент C:\Users\user\AppData\Local\hermes\hermes-agent\venv\Scripts\pythonw.exe: Отказано в доступе по пути 'pythonw.exe'."

Steps to reproduce

  1. Hermes desktop app is running (with gateway profile active)
  2. Installer starts auto-update on launch
  3. Installer tries to remove old release\win-unpacked directory
  4. Error dialog appears: "INSTALL DIDN'T FINISH"

What I tried

  • Restarted PC and retried - same error
  • Killed Hermes.exe and pythonw.exe via Task Manager - same error
  • Ran installer as Administrator - same error

Root cause hypothesis
pythonw.exe from venv\Scripts\ remains locked by a running process (Hermes gateway, Electron main process, or a child process spawned by the desktop app). The installer waits for Hermes to exit and even force-kills stragglers, but the venv pythonw.exe is not terminated, preventing deletion of the old build directory.

Suggested fix
Ensure all child processes including venv\Scripts\pythonw.exe are fully terminated before attempting to delete release\win-unpacked during the update stage. Alternatively, stage the new build to a temporary directory and swap atomically to avoid locking conflicts.

Logs
See attached bootstrap-installer.log covering multiple update attempts from 2026-06-09 to 2026-06-16.

Steps to Reproduce

  1. Hermes desktop app is running (with gateway profile active)
  2. Installer starts auto-update on launch
  3. Installer tries to remove old release\win-unpacked directory
  4. Error dialog appears: "INSTALL DIDN'T FINISH"

Expected Behavior

Installer should successfully terminate all Hermes-related processes
(including pythonw.exe from venv) before attempting to delete
the old build directory, then complete the update and launch
the new version without errors.

Actual Behavior

Installer fails with "Access Denied" error when trying to delete
pythonw.exe during the update process. Error message:

"Не удается удалить элемент C:\Users\user\AppData\Local\hermes
hermes-agent\venv\Scripts\pythonw.exe: Отказано в доступе
по пути 'pythonw.exe'."

The "INSTALL DIDN'T FINISH" dialog appears with "Retry install"
and "Open log folder" buttons. Retrying or running as Administrator
does not resolve the issue.

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

No response

Debug Report

Unable to run `hermes debug share` because the installer fails 
before Hermes can launch. Full bootstrap logs are attached 
to this issue instead (see `bootstrap-installer.log`).

Operating System

Windows 11 (Build 26H1)

Python Version

3.11.15

Hermes Version

0.16.0

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
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    P2Medium — degraded but workaround exists
    duplicateThis issue or pull request already exists
    on Jun 17, 2026
  2. alt-glitch commented on Jun 17, 2026

    @alt-glitch

    Duplicate of #43268 — same Windows Desktop auto-update venv-lock family: a venv child process (here pythonw.exe) holds a file lock under venv\Scripts\, so the updater cannot delete the old release\win-unpacked build directory and the update aborts ("INSTALL DIDN'T FINISH"). #43268 is the canonical open issue; open fix PR #43381 extends the pre-update kill to untracked hermes processes. The suggested atomic-swap-to-temp-dir mitigation here is a useful addition to that discussion.

  3. teknium1 commented on Jul 14, 2026

    @teknium1
    Collaborator

    Thanks for the detailed report. This is an automated hermes-sweeper review; the Windows venv-lock failure is implemented on current main.

    • scripts/install.ps1:1670 explicitly handles pythonw.exe gateway processes that the prior hermes.exe tree-kill missed, then stops processes whose executable path resides under the old venv.
    • scripts/install.ps1:1694 performs a bounded repeated sweep to handle respawning processes before recreation.
    • scripts/install.ps1:1712 uses rename-then-best-effort-delete for the old venv, so a lingering mapped .pyd does not prevent a fresh venv from being created.
    • tests/test_install_unmerged_index.py:155 covers the reported pythonw.exe / locked-.pyd regression class.
    • The later hardening shipped in v2026.7.7.2 via 87ae4ae94bc13e302be2a37b30226f2b19909227.

    The prior duplicate discussion (#43268) and the linked installer work in #51682 identified this same failure mode.

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/tuiTerminal UI (ui-tui/ + tui_gateway/)duplicateThis issue or pull request already existssweeper: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