{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/16139","labels_url":"https://api.github.com/repos/saltstack/salt/issues/16139/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/16139/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/16139/events","html_url":"https://github.com/saltstack/salt/issues/16139","id":43913093,"number":16139,"title":"UnicodeDecodeError in highstate outputter","user":{"login":"Jille","id":460628,"avatar_url":"https://avatars.githubusercontent.com/u/460628?v=3","gravatar_id":"","url":"https://api.github.com/users/Jille","html_url":"https://github.com/Jille","followers_url":"https://api.github.com/users/Jille/followers","following_url":"https://api.github.com/users/Jille/following{/other_user}","gists_url":"https://api.github.com/users/Jille/gists{/gist_id}","starred_url":"https://api.github.com/users/Jille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jille/subscriptions","organizations_url":"https://api.github.com/users/Jille/orgs","repos_url":"https://api.github.com/users/Jille/repos","events_url":"https://api.github.com/users/Jille/events{/privacy}","received_events_url":"https://api.github.com/users/Jille/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Medium%20Severity","name":"Medium Severity","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2165,"closed_issues":1894,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-04-29T19:22:55Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2014-09-25T12:26:01Z","updated_at":"2015-04-29T19:33:53Z","closed_at":null,"body":"I get this crash when running state.highstate test=True:\r\n\r\n```\r\nmaster# salt -t 60 minion state.highstate test=True\r\n[ERROR   ] An un-handled exception was caught by salt's global exception handler:\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 99: ordinal not in range(128)\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/salt\", line 10, in <module>\r\n    salt_main()\r\n  File \"/usr/lib/pymodules/python2.7/salt/scripts.py\", line 240, in salt_main\r\n    client.run()\r\n  File \"/usr/lib/pymodules/python2.7/salt/cli/__init__.py\", line 189, in run\r\n    self._output_ret(ret_, out)\r\n  File \"/usr/lib/pymodules/python2.7/salt/cli/__init__.py\", line 243, in _output_ret\r\n    salt.output.display_output(ret, out, self.config)\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/__init__.py\", line 36, in display_output\r\n    display_data = get_printout(out, opts)(data).rstrip()\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/highstate.py\", line 74, in output\r\n    return _format_host(host, hostdata)[0]\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/highstate.py\", line 203, in _format_host\r\n    u'\\n' + u' ' * 14)\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 99: ordinal not in range(128)\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/salt\", line 10, in <module>\r\n    salt_main()\r\n  File \"/usr/lib/pymodules/python2.7/salt/scripts.py\", line 240, in salt_main\r\n    client.run()\r\n  File \"/usr/lib/pymodules/python2.7/salt/cli/__init__.py\", line 189, in run\r\n    self._output_ret(ret_, out)\r\n  File \"/usr/lib/pymodules/python2.7/salt/cli/__init__.py\", line 243, in _output_ret\r\n    salt.output.display_output(ret, out, self.config)\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/__init__.py\", line 36, in display_output\r\n    display_data = get_printout(out, opts)(data).rstrip()\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/highstate.py\", line 74, in output\r\n    return _format_host(host, hostdata)[0]\r\n  File \"/usr/lib/pymodules/python2.7/salt/output/highstate.py\", line 203, in _format_host\r\n    u'\\n' + u' ' * 14)\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 99: ordinal not in range(128)\r\n```\r\n\r\nThe state:\r\n```\r\n/some-file:\r\n    file.managed:\r\n        - source: 'salt://some-file'\r\n        - show_diff: true\r\n```\r\n\r\nIt'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.\r\n\r\nI'm running 2014.7.0rc1 at 20f2334"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/97554285","html_url":"https://github.com/saltstack/salt/issues/16139#issuecomment-97554285","issue_url":"https://api.github.com/repos/saltstack/salt/issues/16139","id":97554285,"user":{"login":"freshnewpage","id":9811121,"avatar_url":"https://avatars.githubusercontent.com/u/9811121?v=3","gravatar_id":"","url":"https://api.github.com/users/freshnewpage","html_url":"https://github.com/freshnewpage","followers_url":"https://api.github.com/users/freshnewpage/followers","following_url":"https://api.github.com/users/freshnewpage/following{/other_user}","gists_url":"https://api.github.com/users/freshnewpage/gists{/gist_id}","starred_url":"https://api.github.com/users/freshnewpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshnewpage/subscriptions","organizations_url":"https://api.github.com/users/freshnewpage/orgs","repos_url":"https://api.github.com/users/freshnewpage/repos","events_url":"https://api.github.com/users/freshnewpage/events{/privacy}","received_events_url":"https://api.github.com/users/freshnewpage/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T19:33:52Z","updated_at":"2015-04-29T19:33:52Z","body":"This may be a locale issue.\r\nSalt sets the locale to LC_ALL=C but a minion directly locale had LC_ALL=\"en_US.UTF-8\". \r\nA cmd.run that previously failed with a \"UnicodeDecodeError: 'ascii' codec can't decode byte\" error succeeded after explicitly setting the locale as an env variable.\r\n\r\n             - env:\r\n                - LANG: 'en_US.UTF-8'\r\n                - LC_ALL: 'en_US.UTF-8'"}}