saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.11k stars 5.47k forks source link

All targeted 12 packages failed to update. The following packages were already up-to-date #9348

Closed DaveQB closed 10 years ago

DaveQB commented 10 years ago

Hi,

Preamble:

Ubuntu 12.04.2 I have this stanza that this pertains to, in case this info is needed.

soe-packages:
  pkg.latest:
    - pkgs:
      - glusterfs-client
      - nscd
      - krb5-user
      - libpam-krb5
      - libnss-ldapd
      - debconf-utils
      - at
      - snmpd
      - openssh-server
      - denyhosts
      - mailutils
      - ssmtp
      - zsh
      - nethogs
      - iftop
      - sysstat
      - dctrl-tools
      - atop
      - acct
      - goaccess
      - net-tools

Issue:

I have found that if a client/minion doesn't have the gpg key for a repository you get this somewhat cryptic error.

    State: - pkg
    Name:      soe-packages
    Function:  latest
        Result:    False
        Comment:   All targeted 12 packages failed to update. The following packages were already up-to-date: at, dctrl-tools, debconf-utils, mailutils, net-tools, openssh-server, snmpd, ssmtp, zsh
        Changes:  

After finding this issue, I removed iftop and removed the trusted.gpg file to reproduce this error for the below debug output.


[ERROR   ] Command '['apt-get', '-q', '-y', '-o', 'DPkg::Options::=--force-confold', '-o', 'DPkg::Options::=--force-confdef', 'install', 'iftop']' failed with return code: 100
[ERROR   ] stdout: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  iftop
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/35.9 kB of archives.
After this operation, 105 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  iftop
[ERROR   ] stderr: E: There are problems and -y was used without --force-yes
[INFO    ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/root'
[ERROR   ] Package iftop failed to update.20 packages were already up-to-date.
[INFO    ] Executing state file.managed for /etc/nsswitch.conf

Solution?

So I think with A) a little better error message, or/and B) offer an option to ignore authenticity of a repository/package. edit: Just found skip_verify, d0H. So it's more just a error message that helps the admin identify the problem easily.

I hope this is useful.

Thanks for the great software.

basepi commented 10 years ago

Yes, it looks like this error message could be improved a bit. Thanks for the report and for doing your due diligence.

basepi commented 10 years ago

Ah, turns out the reporting is correct, 12 packages didn't get updated, the other 9 did. The misleading part is the "All" at the beginning of the sentence. I'll fix that shortly.

DaveQB commented 10 years ago

Right. @basepi The "already up-to-date" leads on to think that those packages were already up-to-date when they were updated? Certainly the message confused the heck out of me. A reference to the packages not being authenticated as a reason for fail, if sale detects that, would be nice too.

Thanks.