undercloud upgrades fails on non-english locale

Bug #1722792 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Thomas Herve

Bug Description

Running undercloud upgrade with a french locale:

2017-10-11 12:17:37,846 ERROR: sudo failed: An error has occurred:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 1769, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 878, in online_data_migrations
    print(_('Running batches of %i until complete') % max_count)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)

2017-10-11 12:17:37,847 DEBUG: An exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 1766, in install
    'online_data_migrations'])
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 576, in _run_command
    env=env).decode('utf-8')
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['sudo', '/usr/bin/nova-manage', 'db', 'online_data_migrations']' returned non-zero exit status 1
2017-10-11 12:17:37,848 ERROR:

As it turns out nova-manage is translated, so prints out utf-8. We should handle it.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to instack-undercloud (master)

Fix proposed to branch: master
Review: https://review.openstack.org/511238

Changed in tripleo:
assignee: nobody → Thomas Herve (therve)
status: New → In Progress
tags: added: upgrade
Changed in tripleo:
milestone: none → queens-1
importance: Undecided → High
Changed in tripleo:
milestone: queens-1 → queens-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to instack-undercloud (master)

Reviewed: https://review.openstack.org/511238
Committed: https://git.openstack.org/cgit/openstack/instack-undercloud/commit/?id=342109b9a618bc1a091b9bbb8e3397ea7b50d9b9
Submitter: Zuul
Branch: master

commit 342109b9a618bc1a091b9bbb8e3397ea7b50d9b9
Author: Thomas Herve <email address hidden>
Date: Wed Oct 11 15:22:31 2017 +0200

    Handle utf-8 when running python commands

    The openstack commands can be localized, and won't work when using
    subprocess.check_output as-is. Pass PYTHONIOENCODING to make it work.

    Change-Id: Ia4b015da432398d46878cff4ee58dd87f304e8b4
    Closes-Bug: #1722792

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/instack-undercloud 8.1.0

This issue was fixed in the openstack/instack-undercloud 8.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to instack-undercloud (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/534868

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to instack-undercloud (stable/pike)

Reviewed: https://review.openstack.org/534868
Committed: https://git.openstack.org/cgit/openstack/instack-undercloud/commit/?id=c0ff8d6ac2c749e007f6f580e0fef1846f065cbc
Submitter: Zuul
Branch: stable/pike

commit c0ff8d6ac2c749e007f6f580e0fef1846f065cbc
Author: Emilien Macchi <email address hidden>
Date: Wed Jan 17 10:10:58 2018 -0800

    [pike] Handle utf-8 when running python commands

    Manual backport of Ia4b015da432398d46878cff4ee58dd87f304e8b4
    The backport couldn't be clean so I proceeded to manual patch from
    master into stable/pike.

    Change-Id: Id483329cf680669e0b3d6a72b1bb030ef81ec3da
    Related-Bug: #1722792

tags: added: in-stable-pike
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.