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

Not able to run Salt minion on MacOS High Sierra and Mojave #50495

Closed
ghost opened this issue Nov 13, 2018 · 15 comments
Closed

Not able to run Salt minion on MacOS High Sierra and Mojave #50495

ghost opened this issue Nov 13, 2018 · 15 comments
Labels
info-needed waiting for more info stale
Milestone

Comments

@ghost
Copy link

ghost commented Nov 13, 2018

Salt minions fails to start after installation on MacOS High Sierra (10.13) and Mojave (10.14)

Console output

command : sudo salt-minion -l debug

`[ERROR ] '' does not appear to be an IPv4 or IPv6 address
Traceback (most recent call last):
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 210, in parse_args
process_option_func()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 548, in process_config_dir
self.config.update(self.setup_config())
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 1789, in setup_config
ignore_config_errors=False)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 2390, in minion_config
minion_id=minion_id)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 3726, in apply_minion_config
cache_minion_id=cache_minion_id)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 3608, in get_id
newid = salt.utils.network.generate_minion_id()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 172, in generate_minion_id
ret = salt.utils.stringutils.to_unicode(_generate_minion_id().first())
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 161, in _generate_minion_id
return hosts.extend([addr for addr in ip_addrs()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 1202, in ip_addrs
return _ip_addrs(interface, include_loopback, interface_data, 'inet')
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 1190, in _ip_addrs
addr = ipaddress.ip_address(addr.get('address'))
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/ext/ipaddress.py", line 120, in ip_address
address)
ValueError: '' does not appear to be an IPv4 or IPv6 address
Usage: salt-minion [options]

salt-minion: error: Error while processing <bound method Minion.process_config_dir of <salt.cli.daemons.Minion object at 0x102b12ad0>>: Traceback (most recent call last):
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 210, in parse_args
process_option_func()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 548, in process_config_dir
self.config.update(self.setup_config())
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/parsers.py", line 1789, in setup_config
ignore_config_errors=False)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 2390, in minion_config
minion_id=minion_id)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 3726, in apply_minion_config
cache_minion_id=cache_minion_id)
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/config/init.py", line 3608, in get_id
newid = salt.utils.network.generate_minion_id()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 172, in generate_minion_id
ret = salt.utils.stringutils.to_unicode(_generate_minion_id().first())
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 161, in _generate_minion_id
return hosts.extend([addr for addr in ip_addrs()
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 1202, in ip_addrs
return _ip_addrs(interface, include_loopback, interface_data, 'inet')
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/utils/network.py", line 1190, in _ip_addrs
addr = ipaddress.ip_address(addr.get('address'))
File "/usr/local/Cellar/salt/2018.3.2/libexec/lib/python2.7/site-packages/salt/ext/ipaddress.py", line 120, in ip_address
address)
ValueError: '' does not appear to be an IPv4 or IPv6 address
`

@ghost ghost changed the title Not ablle to run Salt minion on MacOS High Sierra and Mojave Not able to run Salt minion on MacOS High Sierra and Mojave Nov 13, 2018
@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 13, 2018

@shahid3507 we did not see this during our high sierra package testing. can you elaborate on how you installed salt? Also as this a clean install or upgrade?

@Ch3LL Ch3LL added the info-needed waiting for more info label Nov 13, 2018
@Ch3LL Ch3LL added this to the Blocked milestone Nov 13, 2018
@ghost
Copy link
Author

ghost commented Nov 13, 2018

@Ch3LL These are the steps that I followed for installation.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install saltstack

export PATH="/usr/local/Cellar/saltstack/2017.7.4/libexec/bin/:$PATH"
pip2 install psutil
sudo curl -L
https://raw.githubusercontent.com/saltstack/salt/develop/pkg/darwin/com.saltstack.salt.minion.plist -o /Library/LaunchDaemons/com.saltstack.salt.minion.plist
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist

@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 14, 2018

do you see this error after attaching the minion to a master? Or on first startup?

Also i noticed in your steps you are doing the following: export PATH="/usr/local/Cellar/saltstack/2017.7.4/libexec/bin/:$PATH" shouldn't that be 2018.3.2

@ghost
Copy link
Author

ghost commented Nov 15, 2018

@Ch3LL
I have changed the PATH to the existing one the system i.e.
PATH="/usr/local/Cellar/salt/2018.3.2/libexec/bin/:$PATH"

The problem which occurred is that there isn't a directory named /etc/salt/ and on the lower versions of mac like 10.12 (Sierra) the directory was there.

@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 15, 2018

I was not able to replicate this. After brew installing it on 10.13 I see that directory:

Mac-3:~ jenkins$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.2
BuildVersion:   17C2120
Mac-3:~ jenkins$ ls /etc/salt/
minion.d        minion_id       pki
Mac-3:~ jenkins$ salt --version
salt 2018.3.2 (Oxygen)
Mac-3:~ jenkins$ 

Was there possibly an error during install? or when you try to start the salt-minion is there any other errors around not being able to create /etc/salt?

@ghost
Copy link
Author

ghost commented Nov 17, 2018

@Ch3LL
I am installing this on a virtual machine hosted over ESXi, does this error have anything to do with that?

@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 19, 2018

no it should not affect that. I was installing on a parallels VM. Can you answer my initial questions: Was there possibly an error during install? or when you try to start the salt-minion is there any other errors around not being able to create /etc/salt?

@ghost
Copy link
Author

ghost commented Nov 20, 2018

@Ch3LL
Here the complete details that you have asked for.
1. Installing salt.

==> Installing salt
==> Downloading https://homebrew.bintray.com/bottles/salt-2018.3.2.high_sierra.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/b0/b034cbf7bff9d1170413314e8fc7bc019056cd6143b9310ae9b08c7be74ebf79?__gda__=exp=1542699201~hmac=b0647850f7c8ba7f11d0483cd
######################################################################## 100.0%
==> Pouring salt-2018.3.2.high_sierra.bottle.1.tar.gz
==> Caveats
Sample configuration files have been placed in /usr/local/etc/saltstack.
Saltstack will not use these by default.
==> Summary
🍺  /usr/local/Cellar/salt/2018.3.2: 2,863 files, 47.3MB
==> Caveats
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

For compilers to find readline you may need to set:
  export LDFLAGS="-L/usr/local/opt/readline/lib"
  export CPPFLAGS="-I/usr/local/opt/readline/include"

==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have sqlite first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find sqlite you may need to set:
  export LDFLAGS="-L/usr/local/opt/sqlite/lib"
  export CPPFLAGS="-I/usr/local/opt/sqlite/include"

==> python@2
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> salt
Sample configuration files have been placed in /usr/local/etc/saltstack.
Saltstack will not use these by default.
HIGH_SIERRA:~ user$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.5
BuildVersion:	17F77
HIGH_SIERRA:~ user$ ls /etc/salt/
ls: /etc/salt/: No such file or directory
HIGH_SIERRA:~ user$ salt --version
salt 2018.3.2 (Oxygen)

@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 20, 2018

thanks for the additional information. ping @weswhet can you replicate this by chance?

@weswhet
Copy link
Contributor

weswhet commented Nov 20, 2018

having a 👀

@weswhet
Copy link
Contributor

weswhet commented Nov 20, 2018

On a 10.14.1 VMware VM /etc/salt/ does not appear to be present. Though the brew install does specify the below message.

Sample configuration files have been placed in /usr/local/etc/saltstack.
Saltstack will not use these by default.

@noelmcloughlin
Copy link
Contributor

For what it's worth I don't recall having this issue on Physical ("High Sierra, Version 10.13.6").
Salt was installed, and probably upgraded, via brew.

$ sudo salt --version
salt 2018.3.2 (Oxygen)
$ ls /etc/salt/
minion		minion.d	minion_id	minionorig	pki

@ghost
Copy link
Author

ghost commented Nov 22, 2018

@weswhet
So, what can be done in order to run salt in HighSierra vmware VM's ?

@weswhet
Copy link
Contributor

weswhet commented Dec 5, 2018

@shahid3507 sorry for the delay. Have you tried just installing the macOS pkg and not using brew as a work around?

@stale
Copy link

stale bot commented Jan 9, 2020

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.

@stale stale bot added the stale label Jan 9, 2020
@stale stale bot closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed waiting for more info stale
Projects
None yet
Development

No branches or pull requests

3 participants