salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

Latest boot strap doesn't create private keys.

Open saltstack-bot opened this issue 11 years ago • 11 comments

Issue by ldelossa Mon Nov 2 18:25:23 2015 Originally opened as https://github.com/saltstack/salt/issues/28499


I'm using the following commands:

curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh git develop

This is consistently not placing the pki keys in /etc/salt/pki/minion/

Here's error when trying to regen new keys with saltutil.

Seems to be a new issue.

http://hastebin.com/genezoyiva.vhdl

Update:

I can consistently fix the problem by first running

sudo sh install_salt.sh 

And then running

sudo sh install_salt.sh git develop

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by gravyboat Tue Nov 3 02:41:43 2015


hastebin paste in the event it is trashed:

[root@client04p ~]# salt-call --local saltutil.regen_keys
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 330, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 779, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 101, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 82, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 128, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 319, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 336, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 330, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 779, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 101, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 82, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 128, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 319, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 336, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
Exception ValueError: 'I/O operation on closed file' in <bound method SyncWrapper.__del__ of <salt.utils.async.SyncWrapper object at 0x3231490>> ignored

This might need to be moved to https://github.com/saltstack/salt-bootstrap

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by hemebond Tue Nov 3 08:56:56 2015


Running Debian Jessie I had to add the -P parameter when calling the bootstrap script (allow pip installs) but had no problem with the bootstrap script not creating keys. I accepted on the master and it works fine.

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by ldelossa Tue Nov 3 11:48:51 2015


I'm on Centos7.1

I just tried this on a completely fresh install of 7.1

CentOS Linux release 7.1.1503 (Core) 
Derived from Red Hat Enterprise Linux 7.1 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.1.1503 (Core) 
CentOS Linux release 7.1.1503 (Core) 
cpe:/o:centos:centos:7

Still get:

[root@client01p tmp]# salt-call --local saltutil.regen_keys
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 330, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 779, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 101, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 82, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 128, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 319, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 336, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 330, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 779, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 101, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 82, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 128, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 319, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 336, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
Exception ValueError: 'I/O operation on closed file' in <bound method SyncWrapper.__del__ of <salt.utils.async.SyncWrapper object at 0x18268d0>> ignored

On Tuesday, November 3, 2015, hemebond [email protected] wrote:

Running Debian Jessie I had to add the -P parameter when calling the bootstrap script (allow pip installs) but had no problem with the bootstrap script not creating keys. I accepted on the master and it works fine.

— Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/28499#issuecomment-153290665.

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by jfindlay Tue Nov 3 21:24:35 2015


I have asked @s0undt3ch to move this issue to salt-bootstrap, but @ldelossa, will you retry with:

curl -L https://bootstrap.saltstack.com/develop -o install_salt.sh
sudo sh install_salt.sh git develop

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by ldelossa Tue Nov 3 22:52:57 2015


No good - still no certs and same issue above when trying to generate

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

Comment by s0undt3ch Wed Nov 4 12:22:14 2015


This is happening because salt is not creating the necessary directories with the right ownership and permissions for performance reasons. That job was left to the packages, however, since a git based installation is not a packaged based installation, "no one" is creating the directories :|

saltstack-bot avatar Nov 04 '15 12:11 saltstack-bot

@s0undt3ch Weird. I've used the bootstrap to do an install from the develop branch in the past and it worked fine. Was there an addition or regression that broke this?

gravyboat avatar Nov 04 '15 18:11 gravyboat

Everything worked before Monday of this week.

On Wed, Nov 4, 2015 at 1:55 PM, Forrest [email protected] wrote:

@s0undt3ch https://github.com/s0undt3ch Weird. I've used the bootstrap to do an install from the develop branch in the past and it worked fine. Was there an addition or regression that broke this?

— Reply to this email directly or view it on GitHub https://github.com/saltstack/salt-bootstrap/issues/684#issuecomment-153829414 .

ldelossa avatar Nov 04 '15 19:11 ldelossa

@s0undt3ch @jfindlay Looks like this is an issue with Salt itself and not related to bootstrap. I've installed stable version from packages and got exactly the same Tracebacks with Exception ValueError never ending.

Salt Version:
           Salt: 2015.8.3

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
           Mako: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
         Python: 2.7.5 (default, Jun 24 2015, 00:41:19)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   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: centos 7.1.1503 Core
        machine: x86_64
        release: 3.10.0-229.7.2.el7.x86_64
         system: CentOS Linux 7.1.1503 Core

# salt-call -l debug --local saltutil.regen_keys            
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: c7-test
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Please install 'virt-what' to improve results of the 'virtual' grain.
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded saltutil.regen_keys
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'c7-test', None, 'aes')
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 331, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 53, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 800, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 105, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 78, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 121, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 316, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 333, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 331, in salt_call
    client.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 53, in run
    caller.run()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 133, in run
    ret = self.call()
  File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 196, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 800, in regen_keys
    channel = salt.transport.Channel.factory(__opts__)
  File "/usr/lib/python2.7/site-packages/salt/transport/__init__.py", line 29, in factory
    return ReqChannel.factory(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 22, in factory
    sync = SyncWrapper(AsyncReqChannel.factory, (opts,), kwargs)
  File "/usr/lib/python2.7/site-packages/salt/utils/async.py", line 59, in __init__
    self.async = method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/client.py", line 105, in factory
    return salt.transport.zeromq.AsyncZeroMQReqChannel(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 78, in __new__
    new_obj.__singleton_init__(opts, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/transport/zeromq.py", line 121, in __singleton_init__
    self.auth = salt.crypt.AsyncAuth(self.opts, io_loop=self._io_loop)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 316, in __new__
    key = cls.__key(opts)
  File "/usr/lib/python2.7/site-packages/salt/crypt.py", line 333, in __key
    opts['master_uri'],  # master ID
KeyError: 'master_uri'
[DEBUG   ] No message_client attr for AsyncZeroMQReqChannel found. Not destroying sockets.
Exception ValueError: 'I/O operation on closed file' in <bound method SyncWrapper.__del__ of <salt.utils.async.SyncWrapper object at 0x2e127d0>> ignored

vutny avatar Dec 25 '15 12:12 vutny

@gravyboat @s0undt3ch I believe this is no longer an issue, at least with bootstrap and could be closed.

vutny avatar Feb 24 '16 09:02 vutny

Thank You for getting back. Closing.

s0undt3ch avatar Feb 24 '16 10:02 s0undt3ch