[nailgun] Do not write HTML encoded messages to action log

Bug #1398445 reported by Aleksey Kasatkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Aleksey Kasatkin

Bug Description

Action log may contain such records:

{
  "request_data": {
    "url": "/api/clusters/23/changes/",
    "http_method": "PUT",
    "data": {

    }
  },
  "response_data": {
    "status": "500 Internal Server Error",
    "data": {
      "message": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"robots\" content=\"NONE,NOARCHIVE\" />\n <title>&lt;class &#39;nailgun.errors.DeploymentAlreadyStarted&#39;&gt; at /clusters/23/changes/</title>\n <style type=\"text/css\">\n html * { padding:0; margin:0; }\n body * { padding:10px 20px; }\n body * * { padding:0; }\n body { font:small sans-serif; }\n body>div { border-bottom:1px solid #ddd; }\n h1 { font-weight:normal; }\n h2 { margin-bottom:.8em; }\n h2 span { font-size:80%; color:#666; font-weight:normal; }\n h3 { margin:1em 0 .5em 0; .......

This happens when exception is HTML-encoded.
Such messages should be extracted and saved in plane text.

Tags: nailgun stats
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Aleksey Kasatkin (alekseyk-ru)
status: New → In Progress
Revision history for this message
Mike Scherbakov (mihgen) wrote :

Are you guys sure it's High for 6.0? Also, in what cases this happens? In all when we have 500 from API?
It affects only developers, who work agains our API, right?

Revision history for this message
Aleksey Kasatkin (alekseyk-ru) wrote :

Not sure it is High for 6.0. We could save message as is and parse later when required.
AFAIK, Nick is working on this for 6.1.
As I remember, html-encoded messages come on every 500.
Alex checked in prod (collected logs) - no messages. Seems it is relevant for debug mode only.

Changed in fuel:
status: In Progress → Confirmed
importance: High → Medium
milestone: 6.0 → 6.1
Revision history for this message
Alexander Kislitsky (akislitsky) wrote :

On the prod we have 500 errors without HTML. I guess HTML appears in the logs only in debug mode.

Revision history for this message
Aleksey Kasatkin (alekseyk-ru) wrote :

This https://review.openstack.org/#/c/153608/ should've been fixed the issue.

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