saltstack / saltstack/relenv

relenv attempts to create / extract files into the installation directory (no permission, not run as root)

Open
#252 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
38
Forks
23
Avg merge
2h 48m
Merged PRs (30d)
5

Description

When starting the salt-master I get the following traceback.

Error processing line 1 of /opt/saltstack/salt/lib/python3.10/site-packages/relenv.pth:
  Traceback (most recent call last):
    File "/opt/saltstack/salt/lib/python3.10/site.py", line 195, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 1072, in bootstrap
      install_cargo_config()
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 851, in install_cargo_config
      toolchain = common().get_toolchain()
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/common.py", line 231, in get_toolchain
      os.makedirs(DATA_DIR, exist_ok=True)
    File "/opt/saltstack/salt/lib/python3.10/os.py", line 215, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/opt/saltstack/salt/lib/python3.10/os.py", line 225, in makedirs
      mkdir(name, mode)
  PermissionError: [Errno 13] Permission denied: '/opt/saltstack/salt/.local'
Remainder of file ignored
Error processing line 1 of /opt/saltstack/salt/lib/python3.10/site-packages/relenv.pth:
  Traceback (most recent call last):
    File "/opt/saltstack/salt/lib/python3.10/site.py", line 195, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 1072, in bootstrap
      install_cargo_config()
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 851, in install_cargo_config
      toolchain = common().get_toolchain()
    File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/common.py", line 231, in get_toolchain
      os.makedirs(DATA_DIR, exist_ok=True)
    File "/opt/saltstack/salt/lib/python3.10/os.py", line 215, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/opt/saltstack/salt/lib/python3.10/os.py", line 225, in makedirs
      mkdir(name, mode)
  PermissionError: [Errno 13] Permission denied: '/opt/saltstack/salt/.local'
Remainder of file ignored

The process is run as non-root, so it does not have permissions to create directories. I am observing this behavior with Salt 3007.8 / relenv 20.6.

Salt Version:
          Salt: 3007.8
 
Python Version:
        Python: 3.10.18 (main, Sep  5 2025, 22:48:51) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.16.0
      cherrypy: unknown
  cryptography: 42.0.5
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.6
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.5.2
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: 0.20.6
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.4.2
           ZMQ: 4.3.4
 
Salt Package Information:
  Package Type: onedir
 
System Versions:
          dist: rhel 9.6 Plow
        locale: utf-8
       machine: x86_64
       release: 5.14.0-570.41.1.el9_6.x86_64
        system: Linux
       version: Red Hat Enterprise Linux 9.6 Plow

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in relenv/runtime.py around bootstrap() and install_cargo_config(), then inspect relenv/common.py around get_toolchain(), where the traceback shows DATA_DIR creation. Reproduce startup as a non-root user and ensure relenv no longer attempts to create or extract files in the read-only installation directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.