salt icon indicating copy to clipboard operation
salt copied to clipboard

Unable to run salt-master as non-root (on develop branch)

Open jasonrm opened this issue 11 years ago • 4 comments

Appears that post 08f74bb4c39cf43c823b1679a4282a2542ae0a0f (and relating to #20715, #20872, #20882, #20883, and #20887) running as non-root is not possible.

Far as I can tell, this is fixed on 2015.2 branch, but develop is still broken.

$ ls -l
-rw-r--r--   1 jason  staff    13 Feb 21 02:02 master

$ salt-master -l debug --config-dir=. --user=jason
[DEBUG   ] Reading configuration from /Users/jason/repos/jasonrm/salt-master-non-root/master
Usage: salt-master

salt-master: error: Failed to load configuration: [Errno 1] Operation not permitted: '/Users/jason/repos/jasonrm/salt-master-non-root/master'

If I create a Saltfile it dumps a traceback.

$ touch Saltfile
$ salt-master -l debug --config-dir=. --user=jason
[INFO    ] Loading Saltfile from '/Users/jason/repos/jasonrm/salt-master-non-root/Saltfile'
[DEBUG   ] Reading configuration from /Users/jason/repos/jasonrm/salt-master-non-root/Saltfile
[ERROR   ] [Errno 1] Operation not permitted: '/Users/jason/repos/jasonrm/salt-master-non-root/Saltfile'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 153, in parse_args
    process_option_func()
  File "/usr/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 321, in process_saltfile
    saltfile_config = config._read_conf_file(saltfile)
  File "/usr/local/lib/python2.7/site-packages/salt/config.py", line 759, in _read_conf_file
    with salt.utils.fopen(path, 'r') as conf_file:
  File "/usr/local/lib/python2.7/site-packages/salt/utils/__init__.py", line 1056, in fopen
    os.chown(path, uid, gid)
OSError: [Errno 1] Operation not permitted: '/Users/jason/repos/jasonrm/salt-master-non-root/Saltfile'
Usage: salt-master

salt-master: error: Error while processing <bound method Master.process_saltfile of <salt.cli.daemons.Master object at 0x1010f58d0>>: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 153, in parse_args
    process_option_func()
  File "/usr/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 321, in process_saltfile
    saltfile_config = config._read_conf_file(saltfile)
  File "/usr/local/lib/python2.7/site-packages/salt/config.py", line 759, in _read_conf_file
    with salt.utils.fopen(path, 'r') as conf_file:
  File "/usr/local/lib/python2.7/site-packages/salt/utils/__init__.py", line 1056, in fopen
    os.chown(path, uid, gid)
OSError: [Errno 1] Operation not permitted: '/Users/jason/repos/jasonrm/salt-master-non-root/Saltfile'

master

root_dir: ./

Versions

$ uname -a
Darwin presto 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64

$ salt --versions-report
           Salt: 2015.2.0-545-gc85d38c
         Python: 2.7.9 (default, Dec 19 2014, 06:00:59)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.5
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.4.1
           RAET: Not Installed
            ZMQ: 4.0.5
           Mako: Not Installed

jasonrm avatar Feb 21 '15 09:02 jasonrm

@jasonrm, 2015.2 is regularly merged into develop. There is a pull request now waiting to come in, except for a few test failures. If you're having this issue on develop and not on 2015.2, then I suppose that this merge or the next would propagate the fix to develop.

jfindlay avatar Feb 23 '15 17:02 jfindlay

Cool. So it should be safe to assume that if something is fixed on a release branch, it should be be fixed on develop within a short period of time (I see 2-3 days mentioned, as a rough guide of course, not the rule). Thanks for looking into this.

jasonrm avatar Feb 24 '15 03:02 jasonrm

@jasonrm Yep! We merge each release branch into the relatively newer branches, so 2014.7 --> 2015.2, then 2015.2 --> develop. Naturally, it will take fixes a little longer to get from 2014.7 to develop than they will from 2015.2, but you get the idea. We typically try to merge forward every day, but sometimes resolving merge conflicts and getting through the test suite takes some time.

rallytime avatar Feb 24 '15 04:02 rallytime

The merge forwards should all have gone in now. As such, I am closing this issue. If this issue pops up again, please leave a comment and we can open this issue once more. Thanks!

rallytime avatar Mar 10 '15 04:03 rallytime