Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running salt as user fails. Naming conflict. #12699

Closed
victormuse opened this issue May 12, 2014 · 8 comments
Closed

Running salt as user fails. Naming conflict. #12699

victormuse opened this issue May 12, 2014 · 8 comments
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Duplicate Duplicate of another issue or PR - will be closed fixed-pls-verify fix is linked, bug author to confirm fix Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@victormuse
Copy link

It seems that ~/.salt is used both for local config file and local logging directory.

Running salt '*' test.ping exits with error code 1 and these messages:

[ERROR   ] An un-handled exception was caught by salt's global exception handler:
IOError: [Errno 21] Is a directory: '/var/data/services/jenkins/.salt'
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 135, in salt_main
    client.run()
  File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 56, in run
    local = salt.client.LocalClient(self.get_config_file_path())
  File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 110, in __init__
    self.opts = salt.config.client_config(c_path)
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 1994, in client_config
    os.path.expanduser('~/.salt')
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 590, in load_config
    opts = _read_conf_file(path)
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 515, in _read_conf_file
    with salt.utils.fopen(path, 'r') as conf_file:
  File "/usr/lib/python2.6/site-packages/salt/utils/__init__.py", line 1068, in fopen
    fhandle = open(*args, **kwargs)
IOError: [Errno 21] Is a directory: '/var/data/services/jenkins/.salt'
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 135, in salt_main
    client.run()
  File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 56, in run
    local = salt.client.LocalClient(self.get_config_file_path())
  File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 110, in __init__
    self.opts = salt.config.client_config(c_path)
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 1994, in client_config
    os.path.expanduser('~/.salt')
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 590, in load_config
    opts = _read_conf_file(path)
  File "/usr/lib/python2.6/site-packages/salt/config.py", line 515, in _read_conf_file
    with salt.utils.fopen(path, 'r') as conf_file:
  File "/usr/lib/python2.6/site-packages/salt/utils/__init__.py", line 1068, in fopen
    fhandle = open(*args, **kwargs)
IOError: [Errno 21] Is a directory: '/var/data/services/jenkins/.salt'

After that, the directory /var/data/services/jenkins/.salt is created and the file master.log in it. Running salt again, exit 2 and:

Usage: salt [options] '<target>' <function> [arguments]

salt: error: Failed to load configuration: [Errno 21] Is a directory: '/var/data/services/jenkins/.salt'

The environment:

           Salt: 2014.1.4
         Python: 2.6.9 (unknown, Mar 28 2014, 00:06:37)
         Jinja2: 2.6
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.4
@victormuse
Copy link
Author

P.S. Downgrading to 2014.1.3 fixes this issue.

@terminalmage
Copy link
Contributor

I've confirmed this by looking at the code. Thanks for the report, we'll get this sorted.

@terminalmage
Copy link
Contributor

This is fixed in develop, via 6ab1bca. I've just pushed that commit to the 2014.1 branch to ensure that the fix will be in 2014.1.5.

@terminalmage
Copy link
Contributor

Would you be able to test with the modification from that commit?

@terminalmage
Copy link
Contributor

This appears to be a duplicate of #12169

@victormuse
Copy link
Author

Yes, the patch at 6ab1bca fixes the issue. Thanks.

@terminalmage
Copy link
Contributor

Great, thanks for confirming!

@Jlaird
Copy link

Jlaird commented Jun 4, 2014

In case someone does not want to roll back you can remove the .salt folder and replace it with an empty .salt file. That fixes it on salt-master-2014.1.4-1.el6.noarch for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Duplicate Duplicate of another issue or PR - will be closed fixed-pls-verify fix is linked, bug author to confirm fix Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

3 participants