Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
UnicodeDecodeError in highstate outputter #16139
Comments
|
Thanks for the report. I was under the impression we had most of these unicode errors solved, but apparently not. We'll investigate this. |
basepi
added
Bug
Medium Severity
labels
Sep 25, 2014
basepi
added this to the Approved milestone
Sep 25, 2014
perry-mitchell
commented
Nov 6, 2014
|
Another error dump in-case it helps:
Is there any workaround for this? |
mpaolini
commented
Nov 6, 2014
|
@basepi there is plenty of unsolved unicode errors: just add a non-ascii char in a state name and you'll see |
perry-mitchell
commented
Nov 7, 2014
|
@mpaolini Why would you want to mention that in the docs? This is most certainly a bug IMHO, as it's unreasonable to expect unicode incompatibility across config files. Unicode support should be trivial. A colleague is running the same Salt setup as I am in the same project, and his is working whilst mine is not. The only difference is our host machines, his being Ubuntu and mine being Debian. I've torn-down and up'd our Vagrant machines a ton of times to no avail. Desperately hoping for a fix or workaround... |
mpaolini
commented
Nov 7, 2014
|
@perry-mitchell I would mention it in the docs under known bugs. I am triying to cook a patch for fixing these issues but it won't be soon |
perry-mitchell
commented
Nov 8, 2014
|
@mpaolini Muchly appreciated. Do you know what particular area is causing the problem here? |
mpaolini
commented
Nov 8, 2014
|
@perry-mitchell mostly is A quick fix is to use Nevertheless this small change requires very thorough analysis of were these strings flow in the program and where they touch the outside world (a pipe, a file...) |
|
Yes, you would expect unicode support to be a solved problem. But that's the primary reason that Python3 exists, is because Python2 unicode support is....painful. Thanks for the updates, @mpaolini, I look forward to seeing your fix. |
|
Adding onto this. salt-minion 2014.1.13 (Hydrogen)
|
mpaolini
commented
Nov 12, 2014
|
@kylegato exactly like the issue I found previously. The whole string formatting usage is just plain broken, and has nothing to do with py3 or py2 |
juangarciavargas
commented
Nov 20, 2014
|
I've got similar issue:
|
mpaolini
commented
Nov 20, 2014
|
@juangarciavargas that's a different issue. You don't seem to have (by the way: |
juangarciavargas
commented
Nov 21, 2014
|
@mpaolini Great! thanks all good now. The problem started after I upgrade the minions to Freebsd10.1 |
rallytime
added
the
Fixed Pending Verification
label
Nov 21, 2014
joshmule
commented
Jan 29, 2015
|
So in what version is this (or will this be) fixed? |
|
The fix in #18376 is in 2014.7.1. |
|
The current implementation of sdecode loops through encodings, which cannot be a solution, and it even fails for Windows. Please use sys.stdin.encoding, as suggested in #19166. I would like to discuss why the encoding is not part of the grain or pillar. |
|
Running into this by just using a unicode char in a comment of a YAML/SLS on # RHEL7/CentOS7 ships the quite outdated systemd version 208
# The RedHat developer Lukáš Nykrýn provides a COPR with newer versions
{% if grains['os'] in ('RedHat', 'CentOS') %}
systemd-copr:
pkgrepo.managed:
- humanname: Builds of newer systemd versions for CentOS7/RHEL7
- baseurl: http://copr-be.cloud.fedoraproject.org/results/lnykryn/systemd/{{ repotype }}-{{ salt['grains.get']('osmajorrelease', 'unknown') }}-$basearch/
- gpgkey: https://copr-be.cloud.fedoraproject.org/results/lnykryn/systemd/pubkey.gpg
- gpgcheck: 1
- skip_if_unavailable: True
- enabled: 1
- order: 1
{% endif %}
OS: Ubuntu 14.04.2 Minion:
OS: CentOS 7 |
|
Thanks for the update @eliasp. I've removed the "Fixed Pending Verification" label. |
rallytime
removed
the
Fixed Pending Verification
label
Apr 3, 2015
ghost
commented
Apr 29, 2015
|
This may be a locale issue.
|
twisty7867
referenced this issue
May 1, 2015
Closed
Unicode paths break file states with masterless minion on Vagrant/Ubuntu 14.04 #23271
jfindlay
added
High Severity
P3
Platform
and removed
Medium Severity
labels
May 4, 2015
|
At least some of these are due to mixing the unicode strings (type 'unicode') and byte strings (type 'str'). Consider the following example:
In the case of highstate failing on "return '\n'.join(hstrs), changed" (one of the examples above), all input save one were byte strings, but the "Changes" part is a unicode string. This small tweak standardizing on str (the smallest change) made my run succeed (on 2014.1.13): --- /usr/lib/python2.7/dist-packages/salt/output/highstate.py 2015-10-05 02:26:49.000000000 +0200
+++ /usr/lib/python2.7/dist-packages/salt/output/highstate.py 2015-10-05 02:27:03.000000000 +0200
@@ -138,7 +138,7 @@
hstrs.extend([sline.format(**svars) for sline in state_lines])
changes = ' Changes: ' + ctext
hstrs.append(
- u'{0}{1}{2[ENDC]}'.format(tcolor, changes, colors)
+ '{0}{1}{2[ENDC]}'.format(tcolor, changes, colors)
)
# Append result counts to end of outputI haven't tried the latest version yet, I'll try to whip up a pull request if it's still an issue there. |
Jille commentedSep 25, 2014
I get this crash when running state.highstate test=True:
The state:
It's easy to reproduce: Put an lorem ipsum on /srv/salt/some-file, highstate it, log in to the minion, add some non-ascii (like \xc2\xb5) to /some-file and run another highstate and it will crash like above.
I'm running 2014.7.0rc1 at 20f2334