Firmware update fails on Gen 8.1 due to newline in cookie header
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
proliantutils |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I am trying to update firmware on a Gen 8.1 ilo using an ironic clean step. Here is my step:
[{
"interface": "management",
"step": "update_firmware",
"args": {
{
}
]
}
}]
This failed with the following error:
NodeCleaningFai
I added an exception log in the ironic ilo driver, and got this traceback:
doh: IloConnectionError: Invalid return character or leading space in header: Cookie
Traceback (most recent call last):
File "/usr/lib/
clean_
File "/usr/lib/
'update_
File "/usr/lib/
return method(*args, **kwargs)
File "/usr/lib/
return func(self, filename, component_type)
File "/usr/lib/
d = self._request_
File "/usr/lib/
raise exception.
IloConnectionError: Invalid return character or leading space in header: Cookie
I then manually used a python interpreter with the IloClient client to call update_firmware, and found that the cookie has a '\r' newline. Adding the following line allowed the update to complete successfully:
cookie = cookie.strip()
Seen on proliantutils 2.4.0, also tested on 2.9.2.
Reviewed: https:/ /review. opendev. org/702423 /git.openstack. org/cgit/ x/proliantutils /commit/ ?id=37afea2bbc5 fdd17f69a094d81 a060f9140ed24a
Committed: https:/
Submitter: Zuul
Branch: master
commit 37afea2bbc5fdd1 7f69a094d81a060 f9140ed24a
Author: Mark Goddard <email address hidden>
Date: Tue Jan 14 13:37:33 2020 +0000
Strip whitespace from cookie in firmware update
When updating firmware, some devices return a cookie with a newline in.
This can result in the following error:
Invalid return character or leading space in header: Cookie
This is due to the header validation in the requests library, which
requires no newlines in headers.
This change fixes the issue by stripping whitespace from the cookie.
Change-Id: Ib2dab7beef0da4 15e8f2358b459ec 1205bf688b4
Closes-Bug: #1859616