Skip to content

Unable to run rootless with custom directories #55971

Closed as not planned
Closed as not planned

Description

@vlina

Description of Issue

Trying to set up a container image running salt-master rootless (see setup below for Dockerfile), and while I specify all the directories (see master config below) I get the following error:

Failed to create directory path "/var/cache/salt/master/queues" - [Errno 13] Permission denied: '/var/cache/salt'

In the master config I've specified:

cachedir: /tmp/salt/cache

This seems to be ignored.
Yes, I'm aware of the root_dir option, I'm trying to define a custom directory structure.

Setup

Dockerfile (minimal reference):

FROM alpine:3
RUN apk add --no-cache salt-master && \
    adduser -DU -u 100 foo && \
    mkdir /data /config && \
    chown 100:100 /data /config
COPY --chown=100:100 /tmp/master /config/master
USER 100:100
CMD ["/usr/bin/salt-master", "--config-dir=/config"]

/tmp/master:

pki_dir: /data/pki
cachedir: /tmp/salt/cache
pidfile: /tmp/salt/master.pid
sock_dir: /tmp/salt/master
log_file: /data/logs/master
conf_file: /config/master

file_roots:
  base:
    - /data/states
pillar_roots:
  base:
    - /data/pillars

Steps to Reproduce Issue

See above files then run (as a normal user):

podman build -t saltmaster:latest .
podman run --rm saltmaster:latest

Versions Report

Salt Version:
           Salt: 2019.2.2

Dependency Versions:
           cffi: 1.13.2
       cherrypy: Not Installed
       dateutil: 2.8.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10.3
        libgit2: 0.28.4
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 1.0.0
         Python: 3.8.1 (default, Dec 30 2019, 15:43:37)
   python-gnupg: Not Installed
         PyYAML: 5.2
          PyZMQ: 18.1.1
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 6.0.3
            ZMQ: 4.3.2

System Versions:
           dist: alpine 3.11.3
         locale: utf-8
        machine: x86_64
        release: 5.4.10-200.fc31.x86_64
         system: Linux
        version: Alpine Linux 3.11.3

Activity

  1. added
    bug
    severity-medium
    P3
    and removed on Feb 7, 2020
  2. added this to the Approved milestone on Feb 7, 2020
  3. garethgreenaway commented on Feb 7, 2020

    @garethgreenaway
    Contributor

    @vlina Thanks for the report and apologies for the delay in responding. I was able to reproduce the above error and will continue to investigate the cause.

  4. garethgreenaway commented on Feb 7, 2020

    @garethgreenaway
    Contributor

    @vlina One thing I did notice is that Python 3.8 is being installed by Alpine, that version is currently not supported. It might not be the issue but something to point out.

  5. garethgreenaway commented on Feb 7, 2020

    @garethgreenaway
    Contributor

    @vlina Found the issue, the Salt master is attempting to use the default location for the sqlite_queue_dir options which lives under /var/cache/salt/master/queues, if you override that configuration option then it should work as expected.

  6. vlina commented on Feb 9, 2020

    @vlina
    Author

    That solved the that specific permission issue and I'm able to start the master. Thank you for looking into this.

    That option is not present in the configuration page for some reason.

  7. added
    documentation
    on Feb 10, 2020
  8. garethgreenaway commented on Feb 10, 2020

    @garethgreenaway
    Contributor

    @vlina Glad that got you going again, this is a documentation bug then. Thanks!

  9. removed
    P3
    on Jun 3, 2020
  10. dwoz commented on Oct 15, 2026

    @dwoz
    Contributor

    Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.

    Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.

    If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.

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

    bugdocumentationseverity-mediumstaletime-estimate-sprint

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions