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

gpg binary pillar error when using test=true to update file. #56402

Closed
whytewolf opened this issue Mar 17, 2020 · 2 comments
Closed

gpg binary pillar error when using test=true to update file. #56402

whytewolf opened this issue Mar 17, 2020 · 2 comments
Assignees
Labels
Aluminium Release Post Mg and Pre Si Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-high 2nd top severity, seen by most users, causes major problems ZD The issue is related to a Zendesk customer support ticket.
Milestone

Comments

@whytewolf
Copy link
Collaborator

Description of Issue

This is a followup to #51879

The original problem was fixed in that issue, however, a new issue is now happening that wasn't caught before because it wasn't getting to the file creation part.

Now if the file exists and you use test=true to see if it wants to change the file on linux it will throw the following error.

salt sse\* state.apply test.test test=true
sse.wolfnet.bad4.us:
----------
          ID: /tmp/foo
    Function: file.managed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.6/site-packages/salt/state.py", line 1981, in call
                  **cdata['kwargs'])
                File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1977, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/states/file.py", line 3037, in managed
                  **kwargs
                File "/usr/lib/python3.6/site-packages/salt/modules/file.py", line 4863, in check_managed_changes
                  group, mode, attrs, saltenv, contents)
                File "/usr/lib/python3.6/site-packages/salt/modules/file.py", line 4967, in check_file_meta
                  tmp_.write(salt.utils.stringutils.to_str(contents))
                File "/usr/lib/python3.6/site-packages/salt/utils/stringutils.py", line 102, in to_str
                  raise exc  # pylint: disable=raising-bad-type
                File "/usr/lib/python3.6/site-packages/salt/utils/stringutils.py", line 95, in to_str
                  return _normalize(s.decode(enc, errors))
              UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 0: invalid start byte
     Started: 12:43:01.057323
    Duration: 13.77 ms
     Changes:

Summary for sse.wolfnet.bad4.us
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:  13.770 ms
ERROR: Minions returned with non-zero exit code

Under windows, I get a different issue, which states that the file wants to replace a text file with a binary file. no matter what kind of file is in place.

Setup

The setup is the same as before with the instructions in
#46934
Once setup, run the file.managed once. then run it again with test=true.

For further testing replace the /tmp/foo file with a text file. The error should continue to happen with test=true

Steps to Reproduce Issue

Setup as above, run the state once, then run the state with test

Versions Report

salt sse\* test.versions
sse.wolfnet.bad4.us:
    Salt Version:
               Salt: 3000

    Dependency Versions:
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: Not Installed
          docker-py: Not Installed
              gitdb: Not Installed
          gitpython: Not Installed
             Jinja2: 2.8.1
            libgit2: Not Installed
           M2Crypto: 0.35.2
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.6.2
       mysql-python: Not Installed
          pycparser: Not Installed
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 3.6.8 (default, Aug  7 2019, 17:28:10)
       python-gnupg: Not Installed
             PyYAML: 3.12
              PyZMQ: 15.3.0
              smmap: Not Installed
            timelib: Not Installed
            Tornado: 4.5.3
                ZMQ: 4.1.4

    System Versions:
               dist: centos 7.7.1908 Core
             locale: UTF-8
            machine: x86_64
            release: 3.10.0-1062.4.3.el7.x86_64
             system: Linux
            version: CentOS Linux 7.7.1908 Core
@whytewolf whytewolf added the ZD The issue is related to a Zendesk customer support ticket. label Mar 17, 2020
@whytewolf
Copy link
Collaborator Author

ZD-3312

@whytewolf whytewolf added Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE labels Mar 17, 2020
@frogunder frogunder added this to the Approved milestone Mar 17, 2020
@sagetherage sagetherage added severity-high 2nd top severity, seen by most users, causes major problems Aluminium Release Post Mg and Pre Si labels Jul 6, 2020
@sagetherage sagetherage modified the milestones: Approved, Aluminium Jul 29, 2020
@garethgreenaway
Copy link
Contributor

I spent a few hours digging into this one and was not seeing the same errors, I did observe a similar traceback when pillarcache was enabled but checking with @whytewolf that option was not enabled in the original scenario. Closing this one out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aluminium Release Post Mg and Pre Si Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-high 2nd top severity, seen by most users, causes major problems ZD The issue is related to a Zendesk customer support ticket.
Projects
None yet
Development

No branches or pull requests

4 participants