salt icon indicating copy to clipboard operation
salt copied to clipboard

Latest boot strap doesn't create private keys.

Open ldelossa opened this issue 11 years ago • 7 comments

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

ldelossa avatar Nov 02 '15 18:11 ldelossa

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

gravyboat avatar Nov 03 '15 02:11 gravyboat

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.

hemebond avatar Nov 03 '15 08:11 hemebond

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.

ldelossa avatar Nov 03 '15 11:11 ldelossa

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

jfindlay avatar Nov 03 '15 21:11 jfindlay

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

ldelossa avatar Nov 03 '15 22:11 ldelossa

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

s0undt3ch avatar Nov 04 '15 12:11 s0undt3ch

Moved to saltstack/salt-bootstrap#684.

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