Actions
Bug #12456
closedHandilng non-utf characters ssh exceptions
Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Description
The exception comming from ssh or scp can include some non-utf characters,
that causes json serialization errors, such in this case:
1. configure the remote_working_dir on smart_proxy_remote_execution_ssh to point to a directory where the user doens't
have write permissions
2. run a command
3. an exception is raised no the proxy side
[#<Proxy::RemoteExecution::Ssh::CommandUpdate::DebugData:0x000000047b6390 @data="Error initializing command #<Proxy::RemoteExecution::Ssh::Dispatcher::Command:0x00000004822590>\nRuntimeError Unable to create directory on remote system /var/tmp/no-perms/foreman-ssh-cmd-70dd8044-816a-47a9-b69c-2a68b3c75c1f: exit code: 1\n mkdir: cannot create directory \xE2\x80\x98/var/tmp/no-perms/foreman-ssh-cmd-70dd8044-816a-47a9-b69c-2a68b3c75c1f\xE2\x80\x99: Permission denied\n", @timestamp=2015-11-12 14:42:16 +0100>, #<Proxy::RemoteExecution::Ssh::CommandUpdate::StatusData:0x000000047b62f0 @data="EXCEPTION", @timestamp=2015-11-12 14:42:16 +0100>] [2015-11-12 14:42:16.473 #10986] DEBUG -- dynflow: command [#<Proxy::RemoteExecution::Ssh::Dispatcher::Command:0x00000004822590>] finished with status EXCEPTION [2015-11-12 14:42:16.474 #10986] DEBUG -- dynflow: closing session to inecas@172.17.0.88 [2015-11-12 14:42:16.475 #10986] DEBUG -- dynflow: closing session for command [#<Proxy::RemoteExecution::Ssh::Dispatcher::Command:0x00000004822590>], 0 session(s) left
4. this error doesn't propagate to the output due to another exception:
E, [2015-11-12T14:42:16.481503 #10986] ERROR -- : "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) /home/inecas/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/multi_json-1.11.2/lib/multi_json/adapters/json_common.rb:19:in `encode' /home/inecas/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/multi_json-1.11.2/lib/multi_json/adapters/json_common.rb:19:in `to_json'
Actions