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

2019.2.0: pkg.installed tries to push unicoded strings to apt #51925

Closed
syphernl opened this issue Mar 1, 2019 · 5 comments
Closed

2019.2.0: pkg.installed tries to push unicoded strings to apt #51925

syphernl opened this issue Mar 1, 2019 · 5 comments
Labels
expected-behavior intended functionality stale
Milestone

Comments

@syphernl
Copy link
Contributor

syphernl commented Mar 1, 2019

Description of Issue/Question

pkg.installed is feeding unicode values to apt which is causing state failures:

[INFO    ] Running state [u'grafana'] at time 13:47:36.741874
[INFO    ] Executing state pkg.installed for [u'grafana']
[DEBUG   ] Could not LazyLoad pkg.resolve_capabilities: 'pkg.resolve_capabilities' is not available.
[DEBUG   ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[DEBUG   ] Could not LazyLoad pkg.check_db: 'pkg.check_db' is not available.
[DEBUG   ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[INFO    ] Executing command [u'dpkg', u'--get-selections', u'*'] in directory '/home/vagrant'
[DEBUG   ] key: systemd.scope, ret: _|-
[INFO    ] Executing 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'grafana'"] in directory '/home/vagrant'
[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'grafana'"]' failed with return code: 100
[ERROR   ] stdout: Reading package lists...
Building dependency tree...
Reading state information...
[ERROR   ] stderr: Running scope as unit: run-r9608d9c90f5f483e8a871a8e79df611d.scope
E: Unable to locate package u'grafana'
[ERROR   ] retcode: 100
[INFO    ] Executing command [u'dpkg-query', u'--showformat', u'${Status} ${Package} ${Version} ${Architecture}', u'-W'] in directory '/home/vagrant'
[ERROR   ] Problem encountered installing package(s). Additional info follows:

errors:
    - Running scope as unit: run-r9608d9c90f5f483e8a871a8e79df611d.scope
      E: Unable to locate package u'grafana'

Setup

Using the Grafana formula, which boils down to:

grafana_packages:
  pkg.installed:
  - names: {{ server.pkgs }}

server.pkgs is:

- grafana

Steps to Reproduce Issue

See above

Versions Report

Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5
 
System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-29-generic
         system: Linux
        version: Ubuntu 18.04 bionic
@Ch3LL
Copy link
Contributor

Ch3LL commented Mar 1, 2019

you will need to use the |tojson filter like so:

grafana_packages:                                                                                                                                                                                
  pkg.installed:                                                                                                                                                                                 
  - names: {{ server.pkgs|tojson }}

due to this change: #48309

which was included in the fluorine release notes here: https://docs.saltstack.com/en/develop/topics/releases/2019.2.0.html#non-backward-compatible-change-to-yaml-renderer

@vutny
Copy link
Contributor

vutny commented Mar 4, 2019

Does the Salt serialization extension still works for YAML?
I mean, does this {{ data|yaml }} filter produce correct "yamlified" strings as described here:
https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html

@Ch3LL
Copy link
Contributor

Ch3LL commented Mar 4, 2019

I just tested both |yaml and |json and they work as well for this test case.

@vutny
Copy link
Contributor

vutny commented Mar 5, 2019

Awesome, thank you very much @Ch3LL !

@stale
Copy link

stale bot commented Jan 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 9, 2020
@stale stale bot closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expected-behavior intended functionality stale
Projects
None yet
Development

No branches or pull requests

3 participants