Skip to content

Stacktrace for master_finger mismatch on minion #32999

Closed

Description

@basepi

Description of Issue/Question

If the master_finger configuration option on the minion doesn't match the fingerprint of the master to which it's connecting, it stacktraces and hangs, rather than giving a nice error and failing gracefully as it does when the public key itself doesn't match:

root@vagrant-ubuntu-trusty-64:~# salt-minion
[ERROR   ] Exception in callback <functools.partial object at 0x7fbb68467158>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 600, in _run_callback
    ret = callback()
  File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 615, in <lambda>
    self.add_future(ret, lambda f: f.result())
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1014, in run
    yielded = self.gen.throw(*exc_info)
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 433, in _authenticate
    creds = yield self.sign_in()
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1008, in run
    value = future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1017, in run
    yielded = self.gen.send(value)
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 563, in sign_in
    self._finger_fail(self.opts['master_finger'], m_pub_fn)
AttributeError: 'AsyncAuth' object has no attribute '_finger_fail'

Steps to Reproduce Issue

Set master_finger on the minion to a fingerprint which doesn't match the master RSA key

Versions Report

Salt Version:
           Salt: 2015.8.5

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
           Mako: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
           RAET: Not Installed
        Tornado: 4.3
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
        libgit2: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: Not Installed
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-85-generic
         system: Ubuntu 14.04 trusty

Activity

  1. added
    Core
    severity-high
    P4
    bug
    on May 3, 2016
  2. added this to the Approved milestone on May 3, 2016
  3. jfindlay commented on May 3, 2016

    @jfindlay
    Contributor

    Thanks for reporting, @basepi.

  4. basepi commented on May 3, 2016

    @basepi
    ContributorAuthor

    I think this should actually be medium severity. Nothing is broken, it should just give a better error and quit graciously. I'm going to fix the labels.

  5. added
    severity-low
    help-wanted
    and removed
    severity-high
    on May 3, 2016
  6. abednarik commented on May 7, 2016

    @abednarik
    Contributor

    Hi @basepi

    I think the issue is related to method _finger_fail because is defined inside SAuth class but in this case is called in the class AsyncAuth. The issue is that SAuth is a subclass of AsyncAuth, so this last class doesn't know about the method, that's why we get an Attribute error.

    AttributeError: 'AsyncAuth' object has no attribute '_finger_fail'
    

    Moving that method to the parent class should fix the issue probably. I will send a PR for you to review.

    Thanks

  7. abednarik commented on May 7, 2016

    @abednarik
    Contributor

    Here is the PR #33106

  8. basepi commented on May 9, 2016

    @basepi
    ContributorAuthor

    @abednarik awesome! I knew it would be something simple I just didn't have time to look into it myself.

  9. abednarik commented on May 9, 2016

    @abednarik
    Contributor

    No problem :) Glad I can help.

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

    CoreP4bughelp-wantedseverity-low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions