Bug 1271547 - Invalid multibyte char error
Invalid multibyte char error
Status: CLOSED WONTFIX
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance (Show other bugs)
5.4.0
x86_64 Linux
medium Severity low
: GA
: cfme-future
Assigned To: Gregg Tanzillo
Dave Johnson
automate
:
Depends On:
Blocks: 1291833
  Show dependency treegraph
 
Reported: 2015-10-14 05:24 EDT by Martin Welk
Modified: 2017-06-07 14:46 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1291833 (view as bug list)
Environment:
Last Closed: 2017-06-07 14:46:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Welk 2015-10-14 05:24:36 EDT
Description of problem:
I have a a method that contains special characters like äöü. CloudForms complains about these characters after an evmserverd restart from the command line.

Version-Release number of selected component (if applicable):
CFME 5.4.2.0.20150820153254_83e434d

How reproducible:
1. Start CFME appliance
2. Create a method that assigns special characters to a string variable. In our case, this is a part of the mail subject
3. Login as ssh as root, run service evmserverd restart
4. Try to execute the method

Actual results:
See the error message below.

Expected results:
No error message.

Additional info:
[----] I, [2015-10-14T10:37:09.941704 #8289:8c1ea0]  INFO -- : Q-task_id([service_template_provision_request_1000000000289]) <AEMethod [/eww-Cloud-Automation/Service/Provisioning/Email/ServiceTemplateProvisi
onRequest_Denied]> Starting 
[----] E, [2015-10-14T10:37:10.133617 #8289:8c1ea0] ERROR -- : Q-task_id([service_template_provision_request_1000000000289]) Method STDERR: -:123: invalid multibyte char (US-ASCII)
[----] E, [2015-10-14T10:37:10.133782 #8289:8c1ea0] ERROR -- : Q-task_id([service_template_provision_request_1000000000289]) Method STDERR: -:123: invalid multibyte char (US-ASCII)
[----] E, [2015-10-14T10:37:10.133917 #8289:8c1ea0] ERROR -- : Q-task_id([service_template_provision_request_1000000000289]) Method STDERR: -:123: syntax error, unexpected end-of-input, expecting keyword_end
[----] E, [2015-10-14T10:37:10.134082 #8289:8c1ea0] ERROR -- : Q-task_id([service_template_provision_request_1000000000289]) Method STDERR: body += "Beste Grüße "
[----] E, [2015-10-14T10:37:10.134225 #8289:8c1ea0] ERROR -- : Q-task_id([service_template_provision_request_1000000000289]) Method STDERR: ^
[----] I, [2015-10-14T10:37:10.134771 #8289:8c1ea0]  INFO -- : Q-task_id([service_template_provision_request_1000000000289]) <AEMethod [/eww-Cloud-Automation/Service/Provisioning/Email/ServiceTemplateProvisionRequest_Denied]> Ending
Comment 2 mkanoor 2015-10-20 09:54:40 EDT
This seems to be happening only in versions prior to ruby 2.2
One way I have been able to solve the problem is on setting the encoding for the script in the pre amble before executing the method.
Doing further research on the differences between ruby 2.0 and ruby 2.2
Comment 3 mkanoor 2015-10-27 09:29:09 EDT
On further research on this issue, we found that the LANG environment variable is not set when the server is started using "service evmserverd restart". That is the nature of "service", it starts with a clean environment and none of the environment variables are passed down to the child processes.
 
If we need to pass specific environment variables we would have to set them in our configuration files.

# Verify this is needed to fix bundle install issue: ArgumentError: invalid byte sequence in US-ASCII
# Perhaps during kickstart the locale/lang is not set and defaults to US-ASCII.
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Comment 4 mkanoor 2015-10-28 16:37:49 EDT
The /etc/default/evm file should have these additional following environments set

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Comment 5 mkanoor 2015-10-29 12:04:45 EDT
When run via 'service evmserverd start" the env variables are, note LANG is missing

Environment Keys ["MANPATH", "GEM_HOME", "TERM", "EVMSERVER", "KEY_ROOT", "LIBRARY_PATH", "QPID_LOAD_MODULE", "X_SCLS", "LD_LIBRARY_PATH", "MALLOC_MMAP_THRESHOLD", "CPATH", "MALLOC_ARENA_MAX", "MIQ_GUID", "PATH", "_", "PWD", "APPLIANCE", "EXECJS_RUNTIME", "SHLVL", "HOME", "QPID_SSL_CERT_DB", "RAILS_ENV", "PYTHONPATH", "PKG_CONFIG_PATH", "PORT", "RUBYOPT", "RUBYLIB"]

When run from appliance console "Start EVM Server Processes" LANG is missing

Environment Keys ["MANPATH", "GEM_HOME", "TERM", "EVMSERVER", "KEY_ROOT", "LIBRARY_PATH", "QPID_LOAD_MODULE", "X_SCLS", "LD_LIBRARY_PATH", "MALLOC_MMAP_THRESHOLD", "CPATH", "MALLOC_ARENA_MAX", "MIQ_GUID", "PATH", "_", "PWD", "APPLIANCE", "EXECJS_RUNTIME", "SHLVL", "HOME", "QPID_SSL_CERT_DB", "RAILS_ENV", "PYTHONPATH", "PKG_CONFIG_PATH", "PORT", "RUBYOPT", "RUBYLIB"]

If the appliance is restarted, LANG is present

Environment Keys ["MANPATH", "GEM_HOME", "TERM", "EVMSERVER", "KEY_ROOT", "LIBRARY_PATH", "QPID_LOAD_MODULE", "X_SCLS", "LD_LIBRARY_PATH", "MALLOC_MMAP_THRESHOLD", "CPATH", "MALLOC_ARENA_MAX", "MIQ_GUID", "PATH", "_", "runlevel", "RUNLEVEL", "LANGSH_SOURCED", "PWD", "LANG", "APPLIANCE", "previous", "PREVLEVEL", "EXECJS_RUNTIME", "CONSOLETYPE", "SHLVL", "HOME", "QPID_SSL_CERT_DB", "RAILS_ENV", "UPSTART_INSTANCE", "UPSTART_EVENTS", "PYTHONPATH", "PKG_CONFIG_PATH", "PORT", "UPSTART_JOB", "RUBYOPT", "RUBYLIB"]

When run via bin/rake evm:start the LANG is present

Environment Keys ["MANPATH", "HOSTNAME", "SELINUX_ROLE_REQUESTED", "GEM_HOME", "SHELL", "TERM", "EVMSERVER", "HISTSIZE", "SSH_CLIENT", "KEY_ROOT", "LIBRARY_PATH", "SELINUX_USE_CURRENT_RANGE", "SSH_TTY", "QPID_LOAD_MODULE", "X_SCLS", "USER", "LS_COLORS", "LD_LIBRARY_PATH", "MALLOC_MMAP_THRESHOLD", "CPATH", "MALLOC_ARENA_MAX", "MIQ_GUID", "PATH", "MAIL", "_", "PWD", "LANG", "APPLIANCE", "EXECJS_RUNTIME", "SELINUX_LEVEL_REQUESTED", "HISTCONTROL", "HOME", "SHLVL", "QPID_SSL_CERT_DB", "RAILS_ENV", "LOGNAME", "PYTHONPATH", "CVS_RSH", "SSH_CONNECTION", "PKG_CONFIG_PATH", "LESSOPEN", "PORT", "RUBYOPT", "RUBYLIB", "G_BROKEN_FILENAMES"]
Comment 6 mkanoor 2015-10-29 13:26:58 EDT
One of the possible solutions here is to set the
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

in /etc/default/evm so that it works for service starts as well was when the appliance reboots.
Comment 9 Chris Pelland 2017-06-07 14:46:44 EDT
This BZ has been closed since it was opened on a version of CloudForms that has reached the end of its lifecycle.  If you find that this bug is still relevant, please open a new BZ against the relevant supported version of CloudForms.

Note You need to log in before you can comment on or make changes to this bug.