nova scheduler log contains html

Bug #1765376 reported by do3meli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Unassigned

Bug Description

Description
===========
The nova scheduler log contains some HTML (see actual result). Log files should not contain any HTML. I suspect some wrong error message parsing here.

Actual result
=============
Log Message:
----
2018-04-19 13:12:53.109 12125 WARNING nova.scheduler.client.report [req-a35b4d7e-9914-48f1-b912-27cedb6eebdd cd9715e9b4714bc6b4d77f15f12ba5a9 fa976f761aad4d378706dfc26ddf6004 - default default] Unable to submit allocation for instance 6dc8e703-1174-499d-aa9b-4d05f83b7784 (409 <html>
 <head>
  <title>409 Conflict</title>
 </head>
 <body>
  <h1>409 Conflict</h1>
  There was a conflict when trying to complete your request.<br /><br />
Unable to allocate inventory: Unable to create allocation for 'VCPU' on resource provider '322b4b21-f3ff-4d59-b6c8-8c1a9fe2b530'. The requested amount would violate inventory constraints.

 </body>
</html>)
----

Steps to reproduce
==================
This log line occurred after trying to live-migrate a vm from one node to another. obviously the request failed to do so.

Expected result
===============
The log line should be better formatted. for example like this:

----
2018-04-19 13:12:53.109 12125 WARNING nova.scheduler.client.report [req-a35b4d7e-9914-48f1-b912-27cedb6eebdd cd9715e9b4714bc6b4d77f15f12ba5a9 fa976f761aad4d378706dfc26ddf6004 - default default] Unable to submit allocation for instance 6dc8e703-1174-499d-aa9b-4d05f83b7784 - HTTP Error 409 - There was a conflict when trying to complete your request. Unable to allocate inventory: Unable to create allocation for 'VCPU' on resource provider '322b4b21-f3ff-4d59-b6c8-8c1a9fe2b530'. The requested amount would violate inventory constraints.
----

Environment
===========
Ubuntu 16.04 with the following packages from Ubuntu Cloud Archive:

nova-api 2:16.0.4-0ubuntu1~cloud0
nova-common 2:16.0.4-0ubuntu1~cloud0
nova-conductor 2:16.0.4-0ubuntu1~cloud0
nova-consoleauth 2:16.0.4-0ubuntu1~cloud0
nova-novncproxy 2:16.0.4-0ubuntu1~cloud0
nova-placement-api 2:16.0.4-0ubuntu1~cloud0
nova-scheduler 2:16.0.4-0ubuntu1~cloud0
python-nova 2:16.0.4-0ubuntu1~cloud0
python-novaclient 2:9.1.0-0ubuntu1~cloud0

Tags: placement
do3meli (d-info-e)
description: updated
Revision history for this message
Matt Riedemann (mriedem) wrote :

I think this is just dumping the contents of a requests.Response.text entry, I'm not sure how much pretty formatting we can put on that. Chris Dent might have ideas.

tags: added: placement
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Chris Dent (cdent) wrote :

This happens because of requests that are not setting the accept header to 'application/json' when talking to placement. Before https://review.openstack.org/#/c/518223/ this could result in the above. After that change we default the accept header (if not otherwise set) to be JSON and thus the response will be JSON, which will format a bit cleaner when dumped into the log (notably line feeds (if any) will be escaped).

We could consider backporting the change?

Revision history for this message
do3meli (d-info-e) wrote :

given the fact that this is already fixed in newer releases i personally would not back port it with that low priority. i will leave the final decision to Matt.

Revision history for this message
Chris Dent (cdent) wrote :

Marking as fix released. If it becomes an issue we can consider backporting it.

Changed in nova:
status: Confirmed → Fix Released
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.