-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
st2 run --tail [action] error on Unicode output #4120
Comments
Thanks for reporting this. Can you please include the output of st2 run core.local cmd="printf '\xE2\x98\xA0'" --tail
2018-05-10 17:00:04,744 WARNING - Auth API server is not available, skipping authentication.
Tailing execution "5af47a940640fd35b085f7a4"
Execution 5af47a940640fd35b085f7a4 has started.
☠
Execution 5af47a940640fd35b085f7a4 has completed (status=succeeded).
id: 5af47a940640fd35b085f7a4
status: succeeded
parameters:
cmd: printf 'â� '
result:
failed: false
return_code: 0
stderr: ''
stdout: "☠"
succeeded: true I wonder if it's related to a locale setting on your machine or similar? Output of |
It looks like it's indeed an issue related to your environment (locale being used - most likely place where you are running StackStorm CLI is using C locale). StackStorm simply uses and respects locale which is set as a default on the system (as the apps should do). On the distros we support out of the box, the default should be It works just fine for me out of the box, but if I explicitly specify a non-utf8 locale, it breaks (as expected). LC_ALL=C st2 run core.local cmd="printf '\xE2\x98\xA0'" --tail
2018-05-10 17:06:21,017 WARNING - Auth API server is not available, skipping authentication.
Tailing execution "5af47c0d0640fd35b085f7b6"
Execution 5af47c0d0640fd35b085f7b6 has started.
ERROR: 'ascii' codec can't encode character u'\u2620' in position 0: ordinal not in range(128) Which distro are you using? And how did you install the StackStorm? It doesn't seem to be related to StackStorm, but getting more information about the environment you are using wouldn't hurt either (distro, version, locale, how was stackstorm installed, etc.). |
This is the st2-docker stackstorm image (stackstorm/stackstorm:2.7.1)
It appears that the st2-docker container does not account for locale. Filed an issue on st2-docker to resolve this StackStorm/st2-docker#129 |
Would we want to handle this exception and provide a useful error like "Please check your system locale (None, None)" ?
|
I'm not sure that's the right thing to do since there are many places where that exception could be thrown (too many places to handle that exception). In theory we could also check the locale and throw on service start up if it's not UTF-8, but I'm not convinced yet that's a good idea either. Maybe we could include default and used system locale in And thanks for filing this issue on our docker repo 👍 |
Yes, I agree that forcing/quiting on non-expected locale is too agressive. Showing a warning somewhere makes more sense (on any st2 command to stderr, in st2 logs or just st2 --version). |
Closing since it's an issue in st2-docker images. Continuation in StackStorm/st2-docker#129. Thanks again for reporting this. I looked at adding locale information to st2 --version / --st2 debug, but |
Version
Description
st2 action run --tail errors out when unicode output exists in stdout/stderr of task
Steps to reproduce
The text was updated successfully, but these errors were encountered: