Unexpected error in render when colorList param has a string value instead of int

Bug #1088458 reported by Dushyanth Harinath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Won't Fix
Undecided
Unassigned

Bug Description

For a uri like below

"render?width=400&height=170&target=PREFIX.tx_pkts_lo.sum&hideLegend=true&vtitle=pkts%2Fsec&areaMode=all&colorList=555555&from=1354597675&until=1354601275&yMin=&yMax=&bgcolor=FFFFFF&fgcolor=000000&title=++last+hour"

render bails out with the below error

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/render/views.py", line 168, in renderView
    image = doImageRender(requestOptions['graphClass'], graphOptions)
  File "/opt/graphite/webapp/graphite/render/views.py", line 354, in doImageRender
    img = graphClass(**graphOptions)
  File "/opt/graphite/webapp/graphite/render/glyph.py", line 173, in __init__
    colorList = unquote_plus( params['colorList'] ).split(',')
  File "/usr/lib64/python2.6/urllib.py", line 1197, in unquote_plus
    s = s.replace('+', ' ')
AttributeError: 'int' object has no attribute 'replace'

A patch against glyph.py to fix this issue is below

# diff -u /opt/graphite/webapp/graphite/render/glyph.py.orig /opt/graphite/webapp/graphite/render/glyph.py
--- /opt/graphite/webapp/graphite/render/glyph.py.orig 2012-12-05 15:21:34.582289813 +0530
+++ /opt/graphite/webapp/graphite/render/glyph.py 2012-12-04 12:17:25.772290831 +0530
@@ -170,7 +170,7 @@
     self.drawRectangle( 0, 0, self.width, self.height )

     if 'colorList' in params:
- colorList = unquote_plus( params['colorList'] ).split(',')
+ colorList = unquote_plus( str(params['colorList'] )).split(',')
     else:
       colorList = self.defaultColorList
     self.colors = itertools.cycle( colorList )

Revision history for this message
Dushyanth Harinath (dushyanth) wrote :

Oops - this affects graphite-web-0.9.10

Revision history for this message
Michael Leinartas (mleinartas) wrote :
Changed in graphite:
status: New → Won't Fix
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.