Repository navigation
Closed
Description
When I change the provider for pkg to pkng the minion fails to start.
This is FreeBSD 10.2 and salt 2015.8.0_1
[WARNING ] ** Restarting minion **
[INFO ] Sleeping random_reauth_delay of 8 seconds
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/_schedule.conf
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/grains.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/grains.conf
[DEBUG ] Configuration file path: /usr/local/etc/salt/minion
[INFO ] Setting up the Salt Minion "kostej"
[DEBUG ] Created pidfile: /var/run/salt-minion.pid
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/_schedule.conf
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/grains.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/grains.conf
[DEBUG ] Please install 'virt-what' to improve results of the 'virtual' grain.
[INFO ] The salt minion is starting up
[INFO ] Minion is starting as user 'root'
[DEBUG ] AsyncEventPublisher PUB socket URI: ipc:///var/run/salt/minion/minion_event_e3d2b40525_pub.ipc
[DEBUG ] AsyncEventPublisher PULL socket URI: ipc:///var/run/salt/minion/minion_event_e3d2b40525_pull.ipc
[INFO ] Starting pub socket on ipc:///var/run/salt/minion/minion_event_e3d2b40525_pub.ipc
[INFO ] Starting pull socket on ipc:///var/run/salt/minion/minion_event_e3d2b40525_pull.ipc
[DEBUG ] Minion 'kostej' trying to tune in
[DEBUG ] sync_connect_master
[DEBUG ] Initializing new SAuth for ('/usr/local/etc/salt/pki/minion', 'kostej', 'tcp://37.59.112.xx:4506')
[DEBUG ] Generated random reconnect delay between '1000ms' and '11000ms' (10576)
[DEBUG ] Setting zmq_reconnect_ivl to '10576ms'
[DEBUG ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/usr/local/etc/salt/pki/minion', 'kostej', 'tcp://37.59.112.xx:4506', 'clear')
[DEBUG ] Decrypting the current master AES key
[DEBUG ] Loaded minion key: /usr/local/etc/salt/pki/minion/minion.pem
[DEBUG ] Loaded minion key: /usr/local/etc/salt/pki/minion/minion.pem
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/usr/local/etc/salt/pki/minion', 'kostej', 'tcp://37.59.112.xx:4506', 'aes')
[DEBUG ] Re-using SAuth for ('/usr/local/etc/salt/pki/minion', 'kostej', 'tcp://37.59.112.xx:4506')
[DEBUG ] Loaded minion key: /usr/local/etc/salt/pki/minion/minion.pem
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/_schedule.conf
[DEBUG ] Including configuration from '/usr/local/etc/salt/minion.d/grains.conf'
[DEBUG ] Reading configuration from /usr/local/etc/salt/minion.d/grains.conf
[DEBUG ] Please install 'virt-what' to improve results of the 'virtual' grain.
[ERROR ] Exception raised when processing __virtual__ function for ifttt. Module will not be loaded global name '__salt__' is not defined
[WARNING ] salt.loaded.int.module.ifttt.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If
you're the developer of the module 'ifttt', please fix this.
[ERROR ] Exception raised when processing __virtual__ function for victorops. Module will not be loaded global name '__salt__' is not defi
ned
[WARNING ] salt.loaded.int.module.victorops.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name
. If you're the developer of the module 'victorops', please fix this.
[DEBUG ] Error loading module.tls: ['PyOpenSSL version 0.10 or later must be installed before this module can be used.']
[DEBUG ] SMBIOS: neither dmidecode nor smbios found!
[DEBUG ] Error loading module.nacl: libnacl import error, perhaps missing python libnacl package
[ERROR ] Exception raised when processing __virtual__ function for zfs. Module will not be loaded global name '__salt__' is not defined
[WARNING ] salt.loaded.int.module.zfs.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If y
ou're the developer of the module 'zfs', please fix this.
[DEBUG ] Error loading module.ipmi: No module named pyghmi.ipmi
[DEBUG ] Error loading module.npm: npm execution module could not be loaded because the npm binary could not be located
[INFO ] The salt minion is shut down
[ERROR ] Minion failed to start:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/scripts.py", line 81, in minion_process
minion.start()
File "/usr/local/lib/python2.7/site-packages/salt/cli/daemons.py", line 272, in start
self.minion.tune_in()
File "/usr/local/lib/python2.7/site-packages/salt/minion.py", line 1596, in tune_in
self.sync_connect_master()
File "/usr/local/lib/python2.7/site-packages/salt/minion.py", line 724, in sync_connect_master
raise six.reraise(*future_exception)
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python2.7/site-packages/salt/minion.py", line 732, in connect_master
yield self._post_master_init(master)
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 879, in run
yielded = self.gen.send(value)
File "/usr/local/lib/python2.7/site-packages/salt/minion.py", line 763, in _post_master_init
self.returners)
File "/usr/local/lib/python2.7/site-packages/salt/utils/schedule.py", line 318, in __init__
self.time_offset = self.functions.get('timezone.get_offset', lambda: '0000')()
File "/usr/local/lib/python2.7/site-packages/salt/modules/timezone.py", line 94, in get_offset
out = __salt__['cmd.run'](cmd)
NameError: global name '__salt__' is not definedMetadata
Metadata
Assignees
Labels
LoaderP3Priority 3PlatformRelates to OS, containers, platform-based utilities like FS, system based appsbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
palica commentedon Oct 23, 2015
with the default provider values the packages don't get upgraded.
jfindlay commentedon Oct 26, 2015
@palica, thanks for the report. It seems that there are three issues here:
pkgng__salt__, which crashes the minion.palica commentedon Oct 26, 2015
Thank you. I couldn't have said it nicer :). If there is something I can do
to debug it more, let me know.
On Mon, Oct 26, 2015 at 5:41 PM, Justin Findlay [email protected]
wrote:
kraileth commentedon Oct 27, 2015
On friday I ran into the same or a related issue, I think. Perhaps I can supply a bit more of information that may be helpful. My test machine is also FreeBSD 10.2 and I'm also using Salt Stack version 2015.8.0 for evaluation. I begun with a simple masterless setup and specifying programs to install does work. What does not is using "latest" - it will install the package if it is absent but then error out for some reason.
For example this works as intended:
sudo:
pkg.installed
Whereas this causes the same problem that palica described above:
sudo:
pkg.latest
Using "latest" leads to this output if sudo is not yet present on the system:
I have no idea why Salt Stack thinks that installing failed. The change that it detected is exactly what it was meant to apply. And here's what happens if the current version of sudo is already present:
I've tested the commands from the "[INFO ] Executing command" lines and they all result in a return code of 0 so that should not be a problem.
If any more information is needed, I'd also gladly provide it.
jfindlay commentedon Oct 27, 2015
ping @cedwards, @kim0.
cedwards commentedon Oct 27, 2015
On FreeBSD 10.x the pkg provider will default to pkgng, so setting the value is not required. It was primarily put in place (and perhaps @terminalmage can comment here) for use during the transitional period between 9.x and 10.x as people on-boarded to pkgng.
According to the
__virtual__function:Sounds to me like we need to clarify when/if
providersshould be set.cedwards commentedon Oct 28, 2015
I can confirm that
pkg.latestgives false-negative output. It tells me that thelatestfails, but it actually looks to be successful. I have not caught this before because I prefer not to use latest to avoid surprise updates.amontalban commentedon Apr 5, 2016
+1
amontalban commentedon Apr 5, 2016
This are my findings so far:
Salt Versions (I'm using latest version available in FreeBSD packages)
My example SLS:
My scenario:
The lines that mark the package upgrade as failed are present in salt/states/pkg.py.
So for the help of any developer this are some useful outputs:
Command:
pkg search -q nginxCommand:
pkg info -ao | grep -i nginxWhat I found is that pkg.py targets to version
1.8.1,2and when it does the following comparision:changes[x]['new']will be different thantargets[x]becausechanges[x]['new']will be1.8.1_1,2andtargets[x]will be1.8.1,2.So the proper way to fix this will be to parse the output of
pkg search -q packagenameand select the higher version and assign it totargetsso it compares the proper versions.Hope this helps someone to get on the right direction, unfortunately I'm lacking of time to take this but if no one takes it maybe I can do it over weekend.
Thanks!
4 remaining items
terminalmage commentedon Apr 5, 2016
Awesome. I just wanted to make sure that we preserved expected behavior when a package is already up-to-date.
Can you submit a pull request?
amontalban commentedon Apr 5, 2016
Sure thing! Should I do it against 2015.8.8 or develop branch?
Thanks
terminalmage commentedon Apr 5, 2016
Open it against the 2015.8 branch, please. Thanks!
amontalban commentedon Apr 5, 2016
@terminalmage sorry for the noise, but github was acting funny and the commits were not visible. I have created PR #32376.
Thanks!
Merge pull request #32376 from amontalban/2015.8
terminalmage commentedon Apr 6, 2016
Thanks, I've merged the pull request.
Merge pull request #32399 from amontalban/2015.5
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)
[develop] Merge forward from 2016.3 to develop (#32494)