Metadata proxy process errors with binary user_data
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | neutron |
High
|
Henry Gessau | ||
| | neutron (Ubuntu) |
High
|
James Page | ||
Bug Description
Boot instances with binary user data content (rather than simple text) is not happy right now:
2015-10-01 13:19:39.109 10854 DEBUG neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.109 10854 ERROR neutron.
2015-10-01 13:19:39.112 10854 INFO neutron.wsgi [-] 192.168.21.15 - - [01/Oct/2015 13:19:39] "GET /openstack/
This is thrown be the log call just prior to it being served back to the instance.
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: neutron-
ProcVersionSign
Uname: Linux 4.2.0-11-generic x86_64
ApportVersion: 2.19-0ubuntu1
Architecture: amd64
Date: Thu Oct 1 13:38:21 2015
Ec2AMI: ami-000005ce
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small.osci
Ec2Kernel: None
Ec2Ramdisk: None
JournalErrors: -- No entries --
PackageArchitec
SourcePackage: neutron
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile.
Related branches
| James Page (james-page) wrote : | #1 |
| summary: |
- Metadata proxy process fails to provide user_data + Metadata proxy process errors with binary user_data |
| tags: | added: liberty-rc-potential |
| Changed in neutron: | |
| importance: | Undecided → High |
| Changed in neutron: | |
| assignee: | nobody → Ihar Hrachyshka (ihar-hrachyshka) |
| James Page (james-page) wrote : | #2 |
| Ihar Hrachyshka (ihar-hrachyshka) wrote : | #3 |
I have a test case to reproduce it.
| Changed in neutron: | |
| status: | New → Confirmed |
| James Page (james-page) wrote : | #4 |
Installing random unicode packages did not help.
Fix proposed to branch: master
Review: https:/
| Changed in neutron: | |
| status: | Confirmed → In Progress |
| Kyle Mestery (mestery) wrote : | #6 |
James, any chance you can try the patch here [1] to see if it fixes the issue? Thanks to Ihar for the quick turnaround!
| James Page (james-page) wrote : | #7 |
Kyle
Patch works OK for me.
| Changed in neutron: | |
| milestone: | none → mitaka-1 |
| Changed in neutron: | |
| assignee: | Ihar Hrachyshka (ihar-hrachyshka) → Cedric Brandily (cbrandily) |
| Changed in neutron: | |
| assignee: | Cedric Brandily (cbrandily) → Henry Gessau (gessau) |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 80e3d9be4923eca
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Oct 1 17:13:25 2015 +0200
metadata: don't crash proxy on non-unicode user data
We attempt to log every successful metadata response with LOG.debug. But
as per oslo.log docs [1], we should make sure that what we pass into the
library is unicode.
Http.request returns a tuple of Response object and a string, which is
bytes in Python 2.x [2].
That's why we need to convert the response content to unicode before
passing it into oslo.log.
To achieve it, we utilize encodeutils.
handling strategy, so that we don't get exceptions on input that does
not conform unicode.
For the unit test case, we pass a string that is not expected to convert
to unicode with errors='strict' strategy or similar, and check that we
still don't crash.
While at it, we remove a check for the number of log calls being
triggered, because it's something that we should avoid validating in
test cases, and it cannot trigger a real bug. The mock that was used to
count the number would also hide the bug that we try to reproduce.
Note that the bug does not require debug to be set because the crash
occurs before oslo.log machinery decides it should not log the message.
[1]: http://
[2]: http://
Closes-Bug: #1501772
Change-Id: I6a32c40ff117fa
| Changed in neutron: | |
| status: | In Progress → Fix Committed |
| Changed in neutron (Ubuntu): | |
| assignee: | nobody → James Page (james-page) |
| importance: | Undecided → High |
| status: | New → In Progress |
Fix proposed to branch: stable/liberty
Review: https:/
| Changed in neutron: | |
| milestone: | mitaka-1 → liberty-rc2 |
| no longer affects: | neutron/liberty |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit 13b6d76da361178
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Oct 1 17:13:25 2015 +0200
metadata: don't crash proxy on non-unicode user data
We attempt to log every successful metadata response with LOG.debug. But
as per oslo.log docs [1], we should make sure that what we pass into the
library is unicode.
Http.request returns a tuple of Response object and a string, which is
bytes in Python 2.x [2].
That's why we need to convert the response content to unicode before
passing it into oslo.log.
To achieve it, we utilize encodeutils.
handling strategy, so that we don't get exceptions on input that does
not conform unicode.
For the unit test case, we pass a string that is not expected to convert
to unicode with errors='strict' strategy or similar, and check that we
still don't crash.
While at it, we remove a check for the number of log calls being
triggered, because it's something that we should avoid validating in
test cases, and it cannot trigger a real bug. The mock that was used to
count the number would also hide the bug that we try to reproduce.
Note that the bug does not require debug to be set because the crash
occurs before oslo.log machinery decides it should not log the message.
[1]: http://
[2]: http://
Closes-Bug: #1501772
Change-Id: I6a32c40ff117fa
(cherry picked from commit 80e3d9be4923eca
| tags: | added: in-stable-liberty |
| Changed in neutron: | |
| status: | Fix Committed → Fix Released |
| Launchpad Janitor (janitor) wrote : | #11 |
This bug was fixed in the package neutron - 2:7.0.0~
---------------
neutron (2:7.0.
* Drop hard requirement on python-ryu for this cycle as it supports
a new alternative agent implementation for Open vSwitch and is not
the default, avoiding inclusion of ryu in main for Wily.
- d/control: Drop (Build-)Depends on ryu, add Suggests.
- d/p/drop-
-- James Page <email address hidden> Fri, 02 Oct 2015 18:10:49 +0100
| Changed in neutron (Ubuntu): | |
| status: | In Progress → Fix Released |
| tags: |
added: juno-backport-potential kilo-backport-potential removed: liberty-rc-potential |
Fix proposed to branch: stable/kilo
Review: https:/
| Ihar Hrachyshka (ihar-hrachyshka) wrote : | #13 |
oslo.log was not used in Juno, so not affected.
| tags: | removed: juno-backport-potential |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/kilo
commit 118a76fd651c19a
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Oct 1 17:13:25 2015 +0200
metadata: don't crash proxy on non-unicode user data
We attempt to log every successful metadata response with LOG.debug. But
as per oslo.log docs [1], we should make sure that what we pass into the
library is unicode.
Http.request returns a tuple of Response object and a string, which is
bytes in Python 2.x [2].
That's why we need to convert the response content to unicode before
passing it into oslo.log.
To achieve it, we utilize encodeutils.
handling strategy, so that we don't get exceptions on input that does
not conform unicode.
For the unit test case, we pass a string that is not expected to convert
to unicode with errors='strict' strategy or similar, and check that we
still don't crash.
While at it, we remove a check for the number of log calls being
triggered, because it's something that we should avoid validating in
test cases, and it cannot trigger a real bug. The mock that was used to
count the number would also hide the bug that we try to reproduce.
Note that the bug does not require debug to be set because the crash
occurs before oslo.log machinery decides it should not log the message.
[1]: http://
[2]: http://
Conflicts:
neutron/
neutron/
Closes-Bug: #1501772
Change-Id: I6a32c40ff117fa
(cherry picked from commit 80e3d9be4923eca
| tags: | added: in-stable-kilo |
Fix proposed to branch: stable/juno
Review: https:/
Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: stable/juno
Review: https:/
Reason: Actually, we don't use oslo.log, neither py34 in Juno, so no need for the change.
| Changed in neutron: | |
| milestone: | liberty-rc2 → 7.0.0 |
Fix proposed to branch: master
Review: https:/
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 6dcfe3a9362ae5f
Author: Kevin Benton <email address hidden>
Date: Tue Oct 6 19:28:47 2015 -0700
Mock oslo policy HTTPCheck instead of urllib
We were mocking internal behavior of oslo policy by
patching urllib. This will break with the upcoming oslo
release that switches to requests.
This patch changes the mock to the HTTPCheck level and we
can leave implementation details testing up to oslo_policy.
Change-Id: I07957f01307e25
Closes-Bug: #1503890
(cherry picked from commit a0f1d9d6de1560b
Add testresources used by oslo.db fixture
If we use oslo.db fixtures, we'll need the package or
the next version of oslo.db release will break us.
Closes-Bug: #1503501
Change-Id: I7dfbf240333095
(cherry picked from commit 86ad967e40c2c67
Fix functional test_server tests
Now oslo.service 0.10.0 no longer sends SIGHUP to parent and
children services.
This was a chance introduced by 286a6ea, and since it invalidated
the very logic under test, this must be revised.
(cherry picked from commit 090fe713592c2b6
Change-Id: I18a11283925369
Closes-bug: #1505438
(cherry picked from commit 090fe713592c2b6
Make test_server work with older versions of oslo.service
Change I18a11283925369
oslo.service >= 0.10.0, but it also broke it for older versions of
oslo.service. Since the library has minimal version of >= 0.7.0 in
requirement
Now, instead of validating that either reset() or restart() of workers
are triggered on SIGHUP, just validate that .start() is triggered the
expected number of times (either way, no matter how oslo.service decide
to clean up the children, they exit and then are respawned).
Change-Id: I41f9d3af780b31
Closes-Bug: #1505645
(cherry picked from commit 7bb40921660cf29
Fixed multiple py34 gate issues
1. Scope mock of 'open' to module
By mocking 'open' at the module level, we can avoid affecting
'open' calls from other modules.
2. Stop using LOG.exception in contexts with no sys.exc_info set
Python 3.4 logger fills in record.exc_info with sys.exc_info() result
[1], and then it uses it to determine the current exception [2] to
append to the log message. Since there is no exception, exc_info[1] is
None, and we get AttributeError inside traceback module.
It's actually a bug in Python interpreter that it attempt to access the
attribute when there is no exception. It turns out that it's fixed in
latest master of cPython [3] (...
This issue was fixed in the openstack/neutron 8.0.0.0b1 development milestone.


I'm just re-deploying the environment where I saw this issue - some other bug reports for this error code would indicate that maybe the unicode package is not installed.