Skip to content

Missing /etc/salt/pki/minion/minion.pub when running salt-call without salt-minion running #15471

Closed

Description

@Jille

I'm trying to run salt-call from kickseed (Ubuntu "post"-install scripts). The main difference I can think of is that service won't be started automatically so salt-minion isn't running.

My master has auto_accept so that shouldn't be the problem.

This worked for me with 2014.1.10-1precise1 and fails with 2014.7.0rc1-20f2334.

[ERROR   ] An un-handled exception was caught by salt's global exception handler:
IOError: [Errno 2] No such file or directory: '/etc/salt/pki/minion/minion.pub'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 128, in salt_call
    client.run()
  File "/usr/lib/pymodules/python2.7/salt/cli/__init__.py", line 409, in run
    caller = salt.cli.caller.Caller.factory(self.config)
  File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 65, in factory
    return ZeroMQCaller(opts, **kwargs)
  File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 88, in __init__
    self.minion = salt.minion.SMinion(opts)
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 265, in __init__
    self.gen_modules()
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 277, in gen_modules
    self.opts['environment'],
  File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 54, in get_pillar
    }.get(opts['file_client'], Pillar)(opts, grains, id_, saltenv, ext)
  File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 68, in __init__
    self.sreq = salt.transport.Channel.factory(opts)
  File "/usr/lib/pymodules/python2.7/salt/transport/__init__.py", line 48, in factory
    return ZeroMQChannel(opts, **kwargs)
  File "/usr/lib/pymodules/python2.7/salt/transport/__init__.py", line 190, in __init__
    self.auth = salt.crypt.SAuth(opts)
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 718, in __init__
    self.crypticle = self.__authenticate()
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 736, in __authenticate
    self.opts.get('auth_tries', 1)
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 549, in sign_in
    self.minion_sign_in_payload(),
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 332, in minion_sign_in_payload
    with salt.utils.fopen(self.pub_path, 'r') as fp_:
  File "/usr/lib/pymodules/python2.7/salt/utils/__init__.py", line 1110, in fopen
    fhandle = open(*args, **kwargs)
IOError: [Errno 2] No such file or directory: '/etc/salt/pki/minion/minion.pub'

Activity

  1. Jille commented on Sep 3, 2014

    @Jille
    ContributorAuthor

    If I add salt-minion -d; sleep 5 before using salt-call it works.

  2. basepi commented on Sep 3, 2014

    @basepi
    Contributor

    That's....weird. salt-call should definitely be generating the keys if they do not exist. Thanks for the report.

  3. added this to the Approved milestone on Sep 3, 2014
  4. starchy commented on May 29, 2015

    @starchy

    I'm seeing the same thing with 2015.5.0+ds-1~bpo8+1 on Debian Jessie. The behavior is the same either running salt-call or starting salt-minion. Everything works fine if I create minion.pub by hand.

  5. added
    Core
    P3
    severity-medium
    and removed
    severity-low
    on Jun 30, 2015
  6. himadrisingh001 commented on Dec 7, 2016

    @himadrisingh001

    We are facing similar issue a number of times on our cluster too.

    [DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', '<minion-id>', '<master>')
    [INFO    ] Generating keys: /etc/salt/pki/minion
    [DEBUG   ] Generated random reconnect delay between '3000ms' and '180000ms' (59295)
    [DEBUG   ] Setting zmq_reconnect_ivl to '59295ms'
    [DEBUG   ] Setting zmq_reconnect_ivl_max to '180000ms'
    [DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', '<minion-id>', 'tcp://<master>', 'clear')
    [ERROR   ] Exception in callback <functools.partial object at 0x7ff3db2ed680>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 592, in _run_callback
        ret = callback()
      File "/usr/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper
        return fn(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 598, in <lambda>
        self.add_future(ret, lambda f: f.result())
      File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
        raise_exc_info(self._exc_info)
      File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
        yielded = self.gen.throw(*exc_info)
      File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 447, in _authenticate
        creds = yield self.sign_in(channel=channel)
      File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
        value = future.result()
      File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
        raise_exc_info(self._exc_info)
      File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 230, in wrapper
        yielded = next(result)
      File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 515, in sign_in
        sign_in_payload = self.minion_sign_in_payload()
      File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 639, in minion_sign_in_payload
        with salt.utils.fopen(self.pub_path) as f:
      File "/usr/lib/python2.7/dist-packages/salt/utils/__init__.py", line 1216, in fopen
        fhandle = open(*args, **kwargs)
    IOError: [Errno 2] No such file or directory: '/etc/salt/pki/minion/minion.pub'
    Terminated
    

    There is no way to recover from it until manually fixing the salt keys.

  7. DaveQB commented on Feb 8, 2017

    @DaveQB
    Contributor

    We're seeing this now too:

    2017-02-08 15:48:40,543 [tornado.application][ERROR   ][10718] Future exception was never retrieved: Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 230, in wrapper
        yielded = next(result)
      File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 598, in handle_message
        stream.send(self.serial.dumps(self._auth(payload['load'])))
      File "/usr/lib/python2.7/dist-packages/salt/transport/mixins/auth.py", line 406, in _auth
        with salt.utils.fopen(pubfn) as f:
      File "/usr/lib/python2.7/dist-packages/salt/utils/__init__.py", line 1221, in fopen
        fhandle = open(*args, **kwargs)
    IOError: [Errno 2] No such file or directory: '/etc/salt/pki/master/minions/ply-ezproxy61-ap-southeast-2a.think.vpc'
    

    MINION

               Salt: 2016.3.3
     
    Dependency Versions:
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: 2.5.3
              gitdb: Not Installed
          gitpython: Not Installed
              ioflo: Not Installed
             Jinja2: 2.6
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: 0.21.1
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.3.0
       mysql-python: 1.2.3
          pycparser: Not Installed
           pycrypto: 2.6.1
             pygit2: Not Installed
             Python: 2.7.3 (default, Dec 18 2014, 19:10:20)
       python-gnupg: Not Installed
             PyYAML: 3.10
              PyZMQ: 14.0.1
               RAET: Not Installed
              smmap: Not Installed
            timelib: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.0.5
     
    System Versions:
               dist: Ubuntu 12.04 precise
            machine: x86_64
            release: 3.2.0-84-virtual
             system: Linux
            version: Ubuntu 12.04 precise

    MASTER

               Salt: 2016.3.3
     
    Dependency Versions:
               cffi: Not Installed
           cherrypy: 3.2.2
           dateutil: 2.5.3
              gitdb: 0.5.4
          gitpython: 0.3.2 RC1
              ioflo: Not Installed
             Jinja2: 2.6
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: 0.21.1
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.3.0
       mysql-python: 1.2.3
          pycparser: Not Installed
           pycrypto: 2.6.1
             pygit2: Not Installed
             Python: 2.7.3 (default, Dec 18 2014, 19:10:20)
       python-gnupg: Not Installed
             PyYAML: 3.10
              PyZMQ: 14.0.1
               RAET: Not Installed
              smmap: 0.8.2
            timelib: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.0.4
     
    System Versions:
               dist: Ubuntu 12.04 precise
            machine: x86_64
            release: 3.2.0-63-virtual
             system: Linux
            version: Ubuntu 12.04 precise
  8. colttt commented on Dec 18, 2017

    @colttt

    the problem still exist :(
    I just one run some IPMI things like from salt master server

    salt-call ipmi.get_health api_host=ipmi-zfs-.example.de api_user=admin api_pass=admin
    Could not access /etc/salt/pki/minion. Path does not exist.
    

    Setup

    salt-call --versions-report
    Salt Version:
               Salt: 2017.7.2
     
    Dependency Versions:
               cffi: 0.8.6
           cherrypy: Not Installed
           dateutil: 2.2
          docker-py: Not Installed
              gitdb: 0.5.4
          gitpython: 0.3.2 RC1
              ioflo: Not Installed
             Jinja2: 2.9.4
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: Not Installed
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.2
       mysql-python: 1.2.3
          pycparser: 2.10
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
       python-gnupg: Not Installed
             PyYAML: 3.11
              PyZMQ: 14.4.0
               RAET: Not Installed
              smmap: 0.8.2
            timelib: Not Installed
            Tornado: 4.4.3
                ZMQ: 4.0.5
     
    System Versions:
               dist: debian 8.10 
             locale: UTF-8
            machine: x86_64
            release: 3.16.0-4-amd64
             system: Linux
            version: debian 8.10 
    
    
    salt --versions-report
    Salt Version:
               Salt: 2017.7.2
     
    Dependency Versions:
               cffi: 0.8.6
           cherrypy: Not Installed
           dateutil: 2.2
          docker-py: Not Installed
              gitdb: 0.5.4
          gitpython: 0.3.2 RC1
              ioflo: Not Installed
             Jinja2: 2.9.4
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: Not Installed
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.2
       mysql-python: 1.2.3
          pycparser: 2.10
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
       python-gnupg: Not Installed
             PyYAML: 3.11
              PyZMQ: 14.4.0
               RAET: Not Installed
              smmap: 0.8.2
            timelib: Not Installed
            Tornado: 4.4.3
                ZMQ: 4.0.5
     
    System Versions:
               dist: debian 8.10 
             locale: UTF-8
            machine: x86_64
            release: 3.16.0-4-amd64
             system: Linux
            version: debian 8.10 
    
    
  9. stale commented on Apr 12, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

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

    CoreP3bugseverity-mediumstale

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions