Skip to content

fix(installer): set UV_NO_CONFIG=1 to avoid permission denied under sudo -u#21288

Closed
hllqkb wants to merge 1 commit into
NousResearch:mainfrom
hllqkb:fix/installer-uv-no-config
Closed

fix(installer): set UV_NO_CONFIG=1 to avoid permission denied under sudo -u#21288
hllqkb wants to merge 1 commit into
NousResearch:mainfrom
hllqkb:fix/installer-uv-no-config

Conversation

@hllqkb

@hllqkb hllqkb commented May 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #21269

Problem

When the installer is run via sudo -u <service-account>, uv resolves config file paths against the process owner's (root) home directory rather than the effective user's. This causes a Permission denied error when trying to read /root/uv.toml:

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

Root Cause

uv automatically discovers config files (uv.toml, pyproject.toml) by walking up from $HOME. Under sudo -u, $HOME is typically still /root (or inherited from the sudo caller), so uv tries to read root-owned files that the effective user can't access.

Fix

Set export UV_NO_CONFIG=1 early in both install scripts. This prevents uv from discovering any config files during installation, which is the correct behavior for a bootstrap script that manages its own isolated environment.

Files changed:

  • scripts/install.sh — main installer (used by curl | bash)
  • setup-hermes.sh — developer setup script (used after git clone)

Both scripts already clear PYTHONPATH and PYTHONHOME to prevent env leakage; UV_NO_CONFIG=1 follows the same pattern for uv's config discovery.

Verification

# Under sudo -u, uv commands should no longer try to read /root/uv.toml:
sudo -u nobody bash -c 'UV_NO_CONFIG=1 uv python find 3.11'
# → finds system Python without permission errors

…udo -u

When the installer is run via , uv resolves config file
paths against the process owner's (root) home directory rather than the
effective user's, causing a Permission denied error when trying to read
/root/uv.toml.

Setting UV_NO_CONFIG=1 prevents uv from discovering any config files
(uv.toml, pyproject.toml) during installation, which is the correct
behavior for a bootstrap script that manages its own environment.

Fixes NousResearch#21269
@substratesurfer

Copy link
Copy Markdown

Same issue for me, thanks for merging

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists python:uv Pull requests that update python:uv code comp/cli CLI entry point, hermes_cli/, setup wizard labels May 7, 2026
@teknium1

teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Merged via #21537 — your commit was cherry-picked onto current main with authorship preserved (rebase-merge). Thanks for the clean fix! UV_NO_CONFIG is the right lever; it covers every uv subcommand the installer calls, not just python install.

@teknium1 teknium1 closed this May 7, 2026
RationallyPrime pushed a commit to RationallyPrime/hermes-agent that referenced this pull request May 8, 2026
rmulligan pushed a commit to rmulligan/hermes-agent that referenced this pull request May 11, 2026
JinyuID pushed a commit to JinyuID/hermes-agent that referenced this pull request May 11, 2026
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists python:uv Pull requests that update python:uv code type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants