Project

General

Profile

Actions

Bug #12456

closed

Handilng non-utf characters ssh exceptions

Added by Ivan Necas about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Fixed in Releases:
Found in Releases:

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'

Related issues 3 (0 open3 closed)

Related to Foreman Remote Execution - Bug #12437: unable to view host job detailClosedIvan Necas11/10/2015Actions
Related to Smart Proxy - Bug #10581: UTF8 encoding error on realm update with freeipaClosedIvan Necas05/21/2015Actions
Related to Foreman Remote Execution - Bug #18356: Smart proxy worker fails on encoding errorClosedAdam Ruzicka02/01/2017Actions
Actions

Also available in: Atom PDF