Skip to content

[Bug]: Installer fails with Permission denied on /root/uv.toml when run via sudo -u <user> #21269

@substratesurfer

Description

@substratesurfer

Bug Description

The installer fails during the Python 3.11 step when run under a dedicated service account (tested with sudo -u and sudo -u -H). uv resolves config paths against the process owner's home directory (root) rather than the effective user's, so the service account can't read /root/uv.toml.

Error:
error: failed to open file /root/uv.toml: Permission denied (os error 13)
✗ Failed to install Python 3.11

Steps to Reproduce

  1. Create a dedicated non-root service account
  2. Run the installer via: sudo -u bash -c 'curl -fsSL | bash'
  3. Installer fails at the Python 3.11 step with Permission denied on /root/uv.toml

Expected Behavior

The installer should complete successfully when run under a non-root service account. Internal uv python install calls should pass --no-config so no config file is read regardless of who runs the installer.

Actual Behavior

The installer exits with a permission error and fails to complete. Python 3.11 is not installed and the setup cannot proceed.

error: failed to open file /root/uv.toml: Permission denied (os error 13)
✗ Failed to install Python 3.11
→ Install Python 3.11 manually, then re-run this script

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

No response

Debug Report

System info: https://paste.rs/ynhBL
Agent log: https://paste.rs/Cpqtv
Gateway log: https://paste.rs/pBOZv

Note: links expire after 6 hours.

Operating System

Ubuntu 24.04 LTS

Python Version

3.11.9

Hermes Version

2.1.0

Additional Logs / Traceback (optional)

Attempted workarounds that did not resolve the issue:
- sudo -u <service-account> -H (sets HOME correctly but uv still reads /root/uv.toml)
- Pre-installing Python 3.11 manually as the service account with --no-config before running the installer — installer calls uv python install internally anyway and hits the same error

Partial workaround: running as root with UV_PYTHON_INSTALL_DIR=/usr/local/lib/uv-python bypasses the error, but all files land in /root/.hermes/ and the service runs as root — defeating the purpose of a non-root deployment.

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

Pass --no-config to all internal uv python install calls in the installer script so that uv does not attempt to read any config file regardless of who runs the installer.

Are you willing to submit a PR for this?

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

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 codetype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions