upgrade-env fails when LC_ALL is empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Won't Fix
|
Wishlist
|
Unassigned | ||
Mitaka |
Won't Fix
|
Low
|
Registry Administrators | ||
Newton |
Won't Fix
|
Wishlist
|
Registry Administrators |
Bug Description
Step for reproduce:
[root@fuel bin]# LC_ALL="" octane upgrade-env 1
DEPRECATION WARNING: /etc/fuel/
2015-09-25 12:48:38 INFO octane.util.ssh Creating new SSH connection to node 2
2015-09-25 12:48:38 INFO paramiko.transport Connected (version 2.0, client OpenSSH_6.6.1p1)
2015-09-25 12:48:39 INFO paramiko.transport Authentication (publickey) successful!
2015-09-25 12:48:39 INFO paramiko.transport Secsh channel 1 opened.
2015-09-25 12:48:39 INFO octane.
2015-09-25 12:48:39 INFO octane.
Traceback (most recent call last):
File "/usr/lib64/
stream.write(fs % msg.encode(
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 63: ordinal not in range(128)
Changed in fuel: | |
assignee: | nobody → Fuel Octane Dev Team (fuel-octane) |
Changed in fuel: | |
milestone: | none → 8.0 |
importance: | Undecided → High |
tags: | added: module-octane |
Changed in fuel: | |
importance: | High → Medium |
tags: | added: area-octane |
tags: |
added: area-python removed: area-octane |
tags: | added: team-upgrades |
Changed in fuel: | |
status: | Confirmed → Won't Fix |
Changed in fuel: | |
assignee: | Registry Administrators (registry) → nobody |
Here's what leads to this problem:
- some IOError happens; format( msg)" (msg is still IOError here) and gets that str object; object, self.errors)" which expects object to be a unicode string, but it's not, so it tries implicitly convert it with ASCII encdoding and blows up; 'utf-8' )" in exception handler, which obviously blows up as well;
- IOError gets string associated with errno value based on current locale (which just happend to be ru_RU.UTF-8), gets UTF-8-encoded str object;
- cliff catches this IOError in "err" variable and does "log.error(err)";
- some dozen layers down we end up in StreamHandler.emit method;
- it calls "formatter.
- seeing that it's not a unicode, emit() then does "'%s\n' % msg" which succeeds in adding a newline to the string;
- then it passes it to stream.write();
- stream has 'UTF-8' encoding set, so first thing it does is "self.encode(
- emit() has nothing better to do but to try "msg.encode(
- we have new bug in Launchpad.
We should probably convert all messages passed to emit() to Unicode with UTF-8 encoding (or current system encoding) ourselves.