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

None value passed to valid_id() in salt/utils/verify.py #8050

Closed
suawekk opened this issue Oct 23, 2013 · 3 comments · Fixed by #8055
Closed

None value passed to valid_id() in salt/utils/verify.py #8050

suawekk opened this issue Oct 23, 2013 · 3 comments · Fixed by #8055
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists

Comments

@suawekk
Copy link

suawekk commented Oct 23, 2013

Hello!
I've just set up salt master and about 80 nodes.
The problem is: salt-master constantly throws exceptions to console.

Exceptions look like this one:

Process MWorker-12:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/dist-packages/salt/master.py", line 706, in run
    self.__bind()
  File "/usr/lib/python2.7/dist-packages/salt/master.py", line 611, in __bind
    ret = self.serial.dumps(self._handle_payload(payload))
  File "/usr/lib/python2.7/dist-packages/salt/master.py", line 635, in _handle_payload
    'clear': self._handle_clear}[key](load)
  File "/usr/lib/python2.7/dist-packages/salt/master.py", line 644, in _handle_clear
    return getattr(self.clear_funcs, load['cmd'])(load)
  File "/usr/lib/python2.7/dist-packages/salt/master.py", line 1715, in _auth
    if not salt.utils.verify.valid_id(self.opts, load['id']):
  File "/usr/lib/python2.7/dist-packages/salt/utils/verify.py", line 454, in valid_id
    return false
  File "/usr/lib/python2.7/dist-packages/salt/utils/verify.py", line 437, in clean_path
    if not os.path.isabs(path):
  File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

I replaced this function in /usr/lib/python2.7/dist-packages/salt/utils/verify.py , line 453 :

def valid_id(opts, id_):
    '''
    Returns if the passed id is valid
    '''

    return bool(clean_path(opts['pki_dir'], id_))

to something like:

def valid_id(opts, id_):
    '''
    Returns if the passed id is valid
    '''
    if id_ is None:
        return False

    return bool(clean_path(opts['pki_dir'], id_))

And exceptions stopped showing up.
However I'm not sure what are implications of this change.

So my question is: What should I do now?

Additional info:
Master and minions were set up by using salt-bootstrap script (installed version is marked as stable)

salt --version-report output

#salt --versions-report
           Salt: 0.17.1
         Python: 2.7.3 (default, Jan  2 2013, 13:56:14)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.3

OS on master: Debian GNU/Linux,version 7.2
OS on minions: Debian GNU/Linux, version 7.2 (wheezy) and 6.0.8 (squeeze)

@basepi
Copy link
Contributor

basepi commented Oct 23, 2013

Thanks for this, fix incoming.

@basepi
Copy link
Contributor

basepi commented Oct 23, 2013

If you could verify that this fixes your issue by testing on the current develop that would be helpful.

@suawekk
Copy link
Author

suawekk commented Oct 23, 2013

I confirm that issue is gone on develop branch. Thanks!

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 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

Successfully merging a pull request may close this issue.

2 participants