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

pkg.installed produces command with u"u'string'" instead of u"string" #55620

Closed
arthurzenika opened this issue Dec 12, 2019 · 1 comment
Closed

Comments

@arthurzenika
Copy link
Contributor

Description of Issue

Upgrading to 2019.2 with https://github.com/saltstack-formulas/nagios-formula/ we get this problem :

# salt-call state.apply nagios.plugins
[WARNING ] /var/cache/salt/minion/extmods/modules/selinux.py:50: DeprecationWarning: Use of 'salt.utils.which' detected. This function has been moved to 'salt.utils.path.which' as of Salt 2018.3.0. This warning will be removed in Salt Neon.

[ERROR   ] Command '[u'systemd-run', u'--scope', u'apt-get', u'-q', u'-y', u'-o', u'DPkg::Options::=--force-confold', u'-o', u'DPkg::Options::=--force-confdef', u'install', u"u'nagios-plugins-contrib'"]' failed with return code: 100
[ERROR   ] stdout: Reading package lists...
Building dependency tree...
Reading state information...
[ERROR   ] stderr: Running scope as unit: run-r3f5248f9cfaf44ffa46a5f8ec0bf4547.scope
E: Unable to locate package u'nagios-plugins-contrib'
[ERROR   ] retcode: 100
[ERROR   ] Problem encountered installing package(s). Additional info follows:

errors:
    - Running scope as unit: run-r3f5248f9cfaf44ffa46a5f8ec0bf4547.scope
      E: Unable to locate package u'nagios-plugins-contrib'
local:
----------
          ID: nagios-extra-plugin-pkgs
    Function: pkg.installed
      Result: False
     Comment: Problem encountered installing package(s). Additional info follows:
              
              errors:
                  - Running scope as unit: run-r3f5248f9cfaf44ffa46a5f8ec0bf4547.scope
                    E: Unable to locate package u'nagios-plugins-contrib'
     Started: 10:15:39.921346
    Duration: 2129.829 ms
     Changes:   

Summary for local
------------
Succeeded: 1
Failed:    1
------------
Total states run:     2
Total run time:   2.163 s

The package is installable or installed :

root@default-debian-9:/home/vagrant# dpkg -l nagios-plugins-contrib
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version          Architecture     Description
+++-=======================-================-================-====================================================
ii  nagios-plugins-contrib  21.20170222      amd64            Plugins for nagios compatible monitoring systems
root@default-debian-9:/home/vagrant# apt policy nagios-plugins-contrib
nagios-plugins-contrib:
  Installed: 21.20170222
  Candidate: 21.20170222
  Version table:
 *** 21.20170222 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

state :

nagios-extra-plugin-pkgs:
  pkg.installed:
    - pkgs: {{ salt['pillar.get']("nagios:plugins:extra_pkgs") }}

pillar :

nagios:
  plugins:
    extra_pkgs:
      - nagios-plugins-contrib

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

salt-call state.apply nagios.testplugins
salt-call --output yaml state.show_sls nagios.testplugins
local:
  nagios-extra-plugin-pkgs:
    pkg:
    - pkgs:
      - u'nagios-plugins-contrib'
    - installed
    - order: 10000
    __sls__: nagios.testplugins
    __env__: base

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

salt-call --versions-report
Salt Version:
           Salt: 2019.2.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.13 (default, Sep 26 2018, 18:42:22)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1
 
System Versions:
           dist: debian 9.11 
         locale: UTF-8
        machine: x86_64
        release: 4.9.0-11-amd64
         system: Linux
        version: debian 9.11 
@garethgreenaway
Copy link
Contributor

Looks like this is resolved by adding | json. I'm going to close it out, if the issue still persists please feel free to re-open. Thanks!

[Test] Triage automation moved this from Needs triage to Closed Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
[Test] Triage
  
Closed
Development

No branches or pull requests

2 participants