Closed non7top closed 7 years ago
I am unable to replicate this error.
[root@salt ~]# cat /srv/salt/test.sls
sudo:
pkg:
- latest
[root@salt ~]# rpm -q sudo
package sudo is not installed
[root@salt ~]# salt-call --local state.apply test
local:
----------
ID: sudo
Function: pkg.latest
Result: True
Comment: The following packages were successfully installed/upgraded: sudo
Started: 16:06:19.446604
Duration: 7279.253 ms
Changes:
----------
sudo:
----------
new:
1.8.6p3-27.el6
old:
Summary for local
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 7.279 s
[root@salt ~]# salt-call --local state.apply test
local:
----------
ID: sudo
Function: pkg.latest
Result: True
Comment: Package sudo is already up-to-date
Started: 16:06:30.231881
Duration: 3836.558 ms
Changes:
Summary for local
------------
Succeeded: 1
Failed: 0
------------
Total states run: 1
Total run time: 3.837 s
Can you run the commands that the yum module is running, and see if you get the same results as the yum module on your system?
Thanks, Daniel
I was able to track this down to option showdupesfromrepos=1, which breaks detection of available updates. This code appears to have changed since version 2015, where I had no issues. Issues started after I updated to 2016.11
# showdupesfromrepos=0
s0 ~ # yum --quiet list available sudo
Error: No matching Packages to list
# showdupesfromrepos=1
s0 ~ # yum --quiet list available sudo
Available Packages
sudo.x86_64 1.8.6p3-27.el6 base
s0 ~ # yum -y install sudo
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.corbina.net
* epel: fedora-mirror01.rbc.ru
* extras: mirror.corbina.net
* updates: mirror.corbina.net
Package sudo-1.8.6p3-27.el6.x86_64 already installed and latest version
Nothing to do
# rpm -qa --queryformat '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'|grep sudo
sudo_|-(none)_|-1.8.6p3_|-27.el6_|-x86_64_|-(none)
salt-2015.5.11-1.el6.noarch - not affected 2015.8.13-1.el6 - affected
Yup, so it looks like the problem is that showdups is the problem. I am able to replicate this now.
I would say that the fix is to remove that setting for now until we can have a closer look.
@terminalmage you will want to see this.
I have created the docker container gtmanfred/issues:41234
to illustrate this issue.
$ docker run -ti --rm gtmanfred/issues:41234 salt-call state.apply test
[ERROR ] Package sudo failed to update.
local:
----------
ID: sudo
Function: pkg.latest
Result: False
Comment: Package sudo failed to update.
Started: 20:13:38.096000
Duration: 4839.494 ms
Changes:
Summary for local
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 4.839 s
Thanks for reporting this. Daniel
Description of Issue/Question
Trace log attached.