-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
pkg.latest completely broken on FreeBSD in salt-ssh 2016.3 #33529
Comments
@dneades looks like i'm able to replicate this on a freebsd10 box:
To ensure this is only freebsd I was able to run this against a centos6 machine just fine. This is limited to freebsd. |
also verified this is not exclusive to salt-ssh. occurs on the minion when salt is installed on freebsd |
@Ch3LL Thank you for confirming this issue and providing the additional information, that’s very helpful. |
@dneades no problem :) Looks like we definitely need to get this one fixed. Thanks for reporting it. much appreciated |
@Ch3LL, yes I agree it needs to be fixed :-) I’ve changed all my |
@Ch3LL I think the problem was introduced in f4fb771 by @terminalmage. Check this:
As you can see the first command looks good, however second is ['pkg'] and therefore it fails. |
Fixed in #33648. You can work around this until we release 2016.3.1 by downloading this file and placing it into Once your FreeBSD minions have been updated to 2016.3.1 you can remove that file and re-run that sync_modules command to revert to using the copy of pkgng.py which is distributed with Salt. |
Hi @terminalmage, Thank you very much for the prompt fix, I think it fixes the original issue. I was going with the same approach and I found this that I'm not sure if it is correct: [root@devserver ~]# salt-call --local pkg.latest_version bash
[CRITICAL] Failed to load grains defined in grain file disks.disks in function <function disks at 0x80c3afe60>, error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 724, in grains
ret = fun()
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 31, in disks
return _freebsd_geom()
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 107, in _freebsd_geom
parse_geom_attribs(device)
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 102, in parse_geom_attribs
if tmp[_geomconsts.ROTATIONRATE] == 0:
KeyError: 'rotationrate'
[INFO ] Executing command ['pkg', 'info', '-ao'] in directory '/root'
[INFO ] Executing command ['pkg', '--version'] in directory '/root'
[INFO ] Executing command ['pkg', 'search', '-S', 'name', '-Q', 'version', '-e', '-q', 'bash'] in directory '/root'
local: As you can see this is returning empty string, however if I apply the following patch: @@ -307,7 +308,7 @@ def latest_version(*names, **kwargs):
if not installed:
ret[name] = pkgver
else:
- if not any(
+ if any(
(salt.utils.compare_versions(ver1=x,
oper='>=',
ver2=pkgver) And execute same command: [root@devserver ~]# salt-call --local pkg.latest_version bash
[CRITICAL] Failed to load grains defined in grain file disks.disks in function <function disks at 0x80c3afe60>, error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 724, in grains
ret = fun()
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 31, in disks
return _freebsd_geom()
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 107, in _freebsd_geom
parse_geom_attribs(device)
File "/usr/local/lib/python2.7/site-packages/salt/grains/disks.py", line 102, in parse_geom_attribs
if tmp[_geomconsts.ROTATIONRATE] == 0:
KeyError: 'rotationrate'
[INFO ] Executing command ['pkg', 'info', '-ao'] in directory '/root'
[INFO ] Executing command ['pkg', '--version'] in directory '/root'
[INFO ] Executing command ['pkg', 'search', '-S', 'name', '-Q', 'version', '-e', '-q', 'bash'] in directory '/root'
local:
4.3.42_1 I'm seeing the same behaviour with aptpkg.py so not sure if I'm interpreting this right. Thanks once again for the quick fix and help! |
@terminalmage please disregard my last message I read the docs and clearly says:
@cedwards Can you add this patch to FreeBSD package as a workaround until 2016.3.1 is launched? Thank you! |
The patch fixes some issues that are new with 2016.3.0 - saltstack/salt#33529 - saltstack/salt#33554 - saltstack/salt#33578 - saltstack/salt#33608 PR: 209829 Submitted by: ohauer, Andreas Montalban <amontalban@gmail.com> Approved by: christer.edwards@gmail.com (maintainer timeout) git-svn-id: svn+ssh://svn.freebsd.org/ports/head@416914 35697150-7ecd-e111-bb59-0022644237b5
The patch fixes some issues that are new with 2016.3.0 - saltstack/salt#33529 - saltstack/salt#33554 - saltstack/salt#33578 - saltstack/salt#33608 PR: 209829 Submitted by: ohauer, Andreas Montalban <amontalban@gmail.com> Approved by: christer.edwards@gmail.com (maintainer timeout)
I'm seeing some odd behaviour when running highstate on a second run on FreeBSD with the following state: p5-MIME-Lite:
pkg.latest The first time it works ok but on subsequent runs I see this error: [ERROR ] LooseVersion instance has no attribute 'version'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/utils/__init__.py", line 2294, in version_cmp
distutils.version.LooseVersion(pkg2):
File "/usr/local/lib/python2.7/distutils/version.py", line 300, in __cmp__
return cmp(self.version, other.version)
AttributeError: LooseVersion instance has no attribute 'version' Based on my prior comment #33529 (comment) this is caused because the returned version is empty and then https://github.com/saltstack/salt/blob/v2016.3.1/salt/states/pkg.py#L1597 fails because we try to do this in def __cmp__ (self, other):
if isinstance(other, StringType):
other = LooseVersion(other)
return cmp(self.version, other.version) What do you think? Thanks! |
I think that this traceback seems unrelated. Can you please open a new issue? |
Actually, nevermind. I've already fixed this in #34429. |
Wooot! That was a super fast fix thanks a lot @terminalmage! |
The patch fixes some issues that are new with 2016.3.0 - saltstack/salt#33529 - saltstack/salt#33554 - saltstack/salt#33578 - saltstack/salt#33608 PR: 209829 Submitted by: ohauer, Andreas Montalban <amontalban@gmail.com> Approved by: christer.edwards@gmail.com (maintainer timeout)
Description
I am running
salt-ssh
on Mac OS X 10.11.5 against a FreeBSD 10.3-RELEASE-p3 host.pkg.latest
appears to be completely broken on FreeBSD in the Salt 2016.3 release. For example, applying the following state:results in this stack trace:
Other
pkg.latest
states fail in a similar fashion. Using package origins (rather than names) does not make any difference. (pkg.installed
appears to work, however.)The states were working perfectly with Salt 2015.8.10. The only change is upgrading to Salt 2016.3.
Versions Report
Here is the versions report on the OS X machine on which I am running
salt-ssh
:The text was updated successfully, but these errors were encountered: