Bug 1366916 - [engine-setup] When SSHing to the engine machine form an OSX client engine-setup might fail due to locale settings
Summary: [engine-setup] When SSHing to the engine machine form an OSX client engine-se...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Engine
Version: 4.0.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Yedidyah Bar David
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-14 20:23 UTC by Gil Klein
Modified: 2022-02-25 08:36 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-09-08 08:57:02 UTC
oVirt Team: Integration
Embargoed:


Attachments (Terms of Use)
ovirt engine setup log (252.25 KB, text/plain)
2016-08-14 20:27 UTC, Gil Klein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-44930 0 None None None 2022-02-25 08:36:12 UTC
Red Hat Knowledge Base (Solution) 2790341 0 None None None 2016-12-02 00:33:58 UTC

Description Gil Klein 2016-08-14 20:23:14 UTC
Description of problem:

engine-setup for a 4.0 engine failed when restored from a 3.6.8 backup


Version-Release number of selected component (if applicable):
From: rhevm-3.6.8.1-0.1.el6
To: rhevm-4.0.2.6-0.1.el7ev


How reproducible:
100% on this specific system


Steps to Reproduce:
1. On the 3.6.8 engine (el6) run: engine-backup --scope=all --mode=backup --file=backup.bck --log=backuplog.log
2. Copy backup.bck over to a scratched installed el7 (7.2)
3. Switch to the el7 machine
4. yum install rhevm
5. engine-backup --mode=restore --file=backup.bck --log=restore.log --provision-db --no-restore-permissions
6. engine-setup

Actual results:
# engine-setup
[ ERROR ] Yum unknown locale: UTF-8
[ ERROR ] Yum unknown locale: UTF-8
[ INFO  ] Stage: Initializing
[ INFO  ] Stage: Environment setup
          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20160814230752-uum2rv.log
          Version: otopi-1.5.1 (otopi-1.5.1-3.el7ev)
[ ERROR ] Failed to execute stage 'Environment setup': unknown locale: UTF-8
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20160814230752-uum2rv.log
[ ERROR ] Failed to execute stage 'Clean up': 'NoneType' object has no attribute 'cleanup'
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20160814230753-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed 


Expected results:
engine-setup should run successfully


Additional info:

2016-08-14 23:07:53 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/otopi/plugins/otopi/packagers/yumpackager.py", line 216, in _setup
    with self._miniyum.transaction():
  File "/usr/lib/python2.7/site-packages/otopi/miniyum.py", line 336, in __enter__
    self._managed.beginTransaction()
  File "/usr/lib/python2.7/site-packages/otopi/miniyum.py", line 718, in beginTransaction
    self._transactionBase = self._yb.history.last()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1106, in <lambda>
    history = property(fget=lambda self: self._getHistory(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1051, in _getHistory
    pdb_path = self.conf.persistdir + "/history"
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1083, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 382, in _getConfig
    startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 636, in doPluginSetup
    plugin_types, confpath, disabled_plugins, enabled_plugins)
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 166, in __init__
    self.run('config')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/langpacks.py", line 202, in config_hook
    (lang, encoding) = locale.getdefaultlocale()
  File "/usr/lib64/python2.7/locale.py", line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib64/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
2016-08-14 23:07:53 ERROR otopi.context context._executeMethod:151 Failed to execute stage 'Environment setup': unknown locale: UTF-8

Comment 1 Gil Klein 2016-08-14 20:27:25 UTC
Created attachment 1190775 [details]
ovirt engine setup log

Comment 2 Yedidyah Bar David 2016-08-15 05:42:49 UTC
A quick search for 'yum "unknown locale: UTF-8"' finds:

http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-error-valueerror-unknown-locale-utf-8
https://bugs.python.org/issue18378

Can you please check your environment? If not sure please attach sosreport.

Comment 3 Gil Klein 2016-08-15 08:50:48 UTC
(In reply to Yedidyah Bar David from comment #2)
> A quick search for 'yum "unknown locale: UTF-8"' finds:
> 
> http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-
> error-valueerror-unknown-locale-utf-8
> https://bugs.python.org/issue18378
> 
> Can you please check your environment? If not sure please attach sosreport.
Look like: export LC_ALL=en_US.UTF-8 solved it.

I see that  LC_ALL is not set even on other systems. 

Can we consider setting it to workaround this issue?

Comment 4 Yedidyah Bar David 2016-08-15 09:21:09 UTC
(In reply to Gil Klein from comment #3)
> (In reply to Yedidyah Bar David from comment #2)
> > A quick search for 'yum "unknown locale: UTF-8"' finds:
> > 
> > http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-
> > error-valueerror-unknown-locale-utf-8
> > https://bugs.python.org/issue18378
> > 
> > Can you please check your environment? If not sure please attach sosreport.
> Look like: export LC_ALL=en_US.UTF-8 solved it.

In the shell where you ran engine-setup?

What's the output of 'locale'?

> 
> I see that  LC_ALL is not set even on other systems. 

On my machine I don't have LC_ALL but do have LANG=en_US.UTF-8 .

> 
> Can we consider setting it to workaround this issue?

Yes.

Comment 5 Gil Klein 2016-08-15 09:52:59 UTC
(In reply to Yedidyah Bar David from comment #4)
> (In reply to Gil Klein from comment #3)
> > (In reply to Yedidyah Bar David from comment #2)
> > > A quick search for 'yum "unknown locale: UTF-8"' finds:
> > > 
> > > http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-
> > > error-valueerror-unknown-locale-utf-8
> > > https://bugs.python.org/issue18378
> > > 
> > > Can you please check your environment? If not sure please attach sosreport.
> > Look like: export LC_ALL=en_US.UTF-8 solved it.
> 
> In the shell where you ran engine-setup?
Yes, if I set it on the same shell, I was able to continue with the setup process.
> 
> What's the output of 'locale'?
# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
> 
> > 
> > I see that  LC_ALL is not set even on other systems. 
> 
> On my machine I don't have LC_ALL but do have LANG=en_US.UTF-8 .
> 
> > 
> > Can we consider setting it to workaround this issue?
> 
> Yes.

Comment 6 Yedidyah Bar David 2016-08-15 10:55:05 UTC
(In reply to Gil Klein from comment #5)
> (In reply to Yedidyah Bar David from comment #4)
> > What's the output of 'locale'?
> # locale
> locale: Cannot set LC_CTYPE to default locale: No such file or directory
> locale: Cannot set LC_ALL to default locale: No such file or directory
> LANG=en_US.UTF-8
> LC_CTYPE=UTF-8

Perhaps this one is causing this.

What do you have in /etc/sysconfig/i18n ? and in /root/.i18n ?

Comment 7 Gil Klein 2016-08-15 11:00:31 UTC
(In reply to Yedidyah Bar David from comment #6)
> (In reply to Gil Klein from comment #5)
> > (In reply to Yedidyah Bar David from comment #4)
> > > What's the output of 'locale'?
> > # locale
> > locale: Cannot set LC_CTYPE to default locale: No such file or directory
> > locale: Cannot set LC_ALL to default locale: No such file or directory
> > LANG=en_US.UTF-8
> > LC_CTYPE=UTF-8
> 
> Perhaps this one is causing this.
> 
> What do you have in /etc/sysconfig/i18n ? and in /root/.i18n ?
# ls -l /etc/sysconfig/i18n
ls: cannot access /etc/sysconfig/i18n: No such file or directory
# ls -l /root/.i18n
ls: cannot access /root/.i18n: No such file or directory

Comment 8 Yedidyah Bar David 2016-08-15 11:44:07 UTC
(In reply to Gil Klein from comment #7)
> (In reply to Yedidyah Bar David from comment #6)
> > (In reply to Gil Klein from comment #5)
> > > (In reply to Yedidyah Bar David from comment #4)
> > > > What's the output of 'locale'?
> > > # locale
> > > locale: Cannot set LC_CTYPE to default locale: No such file or directory
> > > locale: Cannot set LC_ALL to default locale: No such file or directory
> > > LANG=en_US.UTF-8
> > > LC_CTYPE=UTF-8
> > 
> > Perhaps this one is causing this.
> > 
> > What do you have in /etc/sysconfig/i18n ? and in /root/.i18n ?
> # ls -l /etc/sysconfig/i18n
> ls: cannot access /etc/sysconfig/i18n: No such file or directory

That's normally created during installation, should always exist imo.

If you ssh to this machine from another one, can also be set in the client - you can check with 'ssh -v', and/or 'ssh -F /dev/null'. Perhaps you ssh from a Mac [1]?

I'd close this bug. If you want to keep it, should probably be set on otopi, to emit a warning or error if locale seems wrong. Not sure it's worth it though - mis-configured locale probably causes many other problems.

[1] http://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-cannot-change-locale/

Comment 9 Gil Klein 2016-08-15 15:09:44 UTC
(In reply to Yedidyah Bar David from comment #8)
> (In reply to Gil Klein from comment #7)
> > (In reply to Yedidyah Bar David from comment #6)
> > > (In reply to Gil Klein from comment #5)
> > > > (In reply to Yedidyah Bar David from comment #4)
> > > > > What's the output of 'locale'?
> > > > # locale
> > > > locale: Cannot set LC_CTYPE to default locale: No such file or directory
> > > > locale: Cannot set LC_ALL to default locale: No such file or directory
> > > > LANG=en_US.UTF-8
> > > > LC_CTYPE=UTF-8
> > > 
> > > Perhaps this one is causing this.
> > > 
> > > What do you have in /etc/sysconfig/i18n ? and in /root/.i18n ?
> > # ls -l /etc/sysconfig/i18n
> > ls: cannot access /etc/sysconfig/i18n: No such file or directory
> 
> That's normally created during installation, should always exist imo.
> 
> If you ssh to this machine from another one, can also be set in the client -
> you can check with 'ssh -v', and/or 'ssh -F /dev/null'. Perhaps you ssh from
> a Mac [1]?
You got it right, I opened the SSH session from an OSX machine.

I can confirm the suggested workaroud solved this issue.
> 
> I'd close this bug. If you want to keep it, should probably be set on otopi,
> to emit a warning or error if locale seems wrong. Not sure it's worth it
> though - mis-configured locale probably causes many other problems.
Two suggestions here:
1. Can we detect this issue and send OSX users a reference to the suggested workaround?
2. I would suggested adding a documention / kb article to help unblock OSX users from running engine-setup
> 
> [1]
> http://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-
> cannot-change-locale/

Comment 10 Yaniv Lavi 2016-09-08 08:57:02 UTC
Please open a bug on freebsd.
Can you create a KB?

Comment 11 Gil Klein 2016-09-08 09:00:52 UTC
(In reply to Yaniv Dary from comment #10)
> Please open a bug on freebsd.
> Can you create a KB?
I'm not sure how to create a KB article.

Marina, can you please assist?

Comment 12 Marina Kalinin 2016-12-02 20:23:38 UTC
Thanks, Germano, for the KCS: https://access.redhat.com/solutions/2790341

Comment 13 Yedidyah Bar David 2019-03-21 09:26:55 UTC
See also bug 1670376.


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