Ticket #8686 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

HTTPError 414 Request-URI Too Large

Reported by: falkb Assigned to: hoessler
Priority: normal Component: EstimationToolsPlugin
Severity: normal Keywords:
Cc: osimons Trac Release: 0.12

Description

My Trac project logging is growing with these errors:

2011-04-08 08:32:46,602 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\web\main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\estimationtools\utils.py", line 74, in process_request
    chart = opener.open(url.encode('utf-8'))
  File "D:\BITNAM~1.2\apache2\bin\lib\urllib2.py", line 387, in open
    response = meth(req, response)
  File "D:\BITNAM~1.2\apache2\bin\lib\urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
  File "D:\BITNAM~1.2\apache2\bin\lib\urllib2.py", line 425, in error
    return self._call_chain(*args)
  File "D:\BITNAM~1.2\apache2\bin\lib\urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "D:\BITNAM~1.2\apache2\bin\lib\urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 414: Request-URI Too Large

Nevertheless, the burndown graph is shown on the web page like in the attached image.

The web page source code is:

<image src="/XXXXXXXX/estimationtools/chart?data=chxt%3Dx%252Cx%252Cy%26chco%3Dff9900%252Cffddaa%26chd%3Dt%253A0.00%252C1.10%252C2.20%252C3.30%252C4.40%252C5.49%252C6.59%252C7.69%252C8.79%252C9.89%252C10.99%252C12.09%252C13.19%252C14.29%252C15.38%252C16.48%252C17.58%252C18.68%252C19.78%252C20.88%252C21.98%252C23.08%252C24.18%252C25.27%252C26.37%252C27.47%252C28.57%252C29.67%252C30.77%252C31.87%252C32.97%252C34.07%252C35.16%252C36.26%252C37.36%252C38.46%252C39.56%252C40.66%252C41.76%252C42.86%252C43.96%252C45.05%252C46.15%252C47.25%252C48.35%252C49.45%252C50.55%252C51.65%252C52.75%252C53.85%252C54.95%252C56.04%252C57.14%252C58.24%252C59.34%252C60.44%252C61.54%252C62.64%252C63.74%252C64.84%252C65.93%252C67.03%252C68.13%252C69.23%252C70.33%252C71.43%252C72.53%252C73.63%252C74.73%252C75.82%252C76.92%252C78.02%252C79.12%252C80.22%252C81.32%252C82.42%252C83.52%252C84.62%252C85.71%252C86.81%252C87.91%252C89.01%252C90.11%252C91.21%252C92.31%252C93.41%252C94.51%252C95.60%252C96.70%252C97.80%252C98.90%252C100.00%257C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C0.00%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C11.59%252C13.04%252C13.04%252C13.04%252C13.04%252C13.04%252C13.04%252C13.04%252C15.94%252C15.94%252C15.94%252C15.94%252C15.94%252C75.36%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%252C100.00%26chf%3Dc%252Cs%252Cffffff00%257Cbg%252Cs%252C00000000%26chxr%3D2%252C0%252C69.0%26chg%3D100.0%252C100.0%252C1%252C0%26chm%3DR%252Cccccccaa%252C0%252C0.00%252C0.03%257CR%252Cccccccaa%252C0%252C0.08%252C0.11%257CR%252Cccccccaa%252C0%252C0.15%252C0.19%257CR%252Cccccccaa%252C0%252C0.23%252C0.26%257CR%252Cccccccaa%252C0%252C0.31%252C0.34%257CR%252Cccccccaa%252C0%252C0.39%252C0.42%257CR%252Cccccccaa%252C0%252C0.46%252C0.49%257CR%252Cccccccaa%252C0%252C0.54%252C0.57%257CR%252Cccccccaa%252C0%252C0.62%252C0.65%257CR%252Cccccccaa%252C0%252C0.69%252C0.72%257CR%252Cccccccaa%252C0%252C0.77%252C0.80%257CR%252Cccccccaa%252C0%252C0.85%252C0.88%257CR%252Cccccccaa%252C0%252C0.92%252C0.96%26chs%3D800x200%26cht%3Dlxy%26chtt%3DP2-DS1%2B-%2Bv2.0.1%26chxl%3D0%253A%257C7%257C8%257C9%257C10%257C11%257C12%257C13%257C14%257C15%257C16%257C17%257C18%257C19%257C20%257C21%257C22%257C23%257C24%257C25%257C26%257C27%257C28%257C29%257C30%257C31%257C1%257C2%257C3%257C4%257C5%257C6%257C7%257C8%257C9%257C10%257C11%257C12%257C13%257C14%257C15%257C16%257C17%257C18%257C19%257C20%257C21%257C22%257C23%257C24%257C25%257C26%257C27%257C28%257C1%257C2%257C3%257C4%257C5%257C6%257C7%257C8%257C9%257C10%257C11%257C12%257C13%257C14%257C15%257C16%257C17%257C18%257C19%257C20%257C21%257C22%257C23%257C24%257C25%257C26%257C27%257C28%257C29%257C30%257C31%257C1%257C2%257C3%257C4%257C5%257C6%257C7%257C8%257C1%253A%257C1%252F2011%257C4%252F2011" alt="Burndown Chart (server)"></image>

Attachments

burndownGraph#8686.JPG (15.3 kB) - added by fbrettschneider@baumer.com on 04/08/11 08:41:38.
burndownGraph8686.JPG (15.2 kB) - added by fbrettschneider@baumer.com on 04/08/11 08:47:45.

Change History

04/08/11 08:41:38 changed by fbrettschneider@baumer.com

  • attachment burndownGraph#8686.JPG added.

04/08/11 08:47:45 changed by fbrettschneider@baumer.com

  • attachment burndownGraph8686.JPG added.

04/08/11 08:50:13 changed by anonymous

  • release changed from 0.11 to 0.12.

04/08/11 09:06:45 changed by falkb

Now I found out the error does not happen when I just show the single milestone web page https://172.20.7.11/XXXXXXXX/milestone/XX-XXX%20-%20XX, but it does happen when I go to the roadmap page https://172.20.7.11/XXXXXXXX/roadmap where also other charts are displayed.

So it looks like urllib2 sends the data of all charts of the roadmap page in one request which leads to that "URI Too Large" error, so only in that case the error happens. And not if I only have 1 chart on a certain milestone pages.

04/08/11 11:20:49 changed by osimons

Could you try this patch, please:

diff --git a/estimationtools/utils.py b/estimationtools/utils.py
--- a/estimationtools/utils.py
+++ b/estimationtools/utils.py
@@ -66,7 +66,10 @@
         req.perm.require('TICKET_VIEW')
         url = 'http://chart.apis.google.com/chart?%s' % req.args.get('data', '')
         self.log.debug("Fetching chart using url: %s" % repr(url))
-        chart = urllib2.urlopen(url.encode('utf-8'))
+        opener = urllib2.build_opener()
+        chart_req = urllib2.Request('GET', url.encode('utf-8'), '', {})
+        chart = opener.open(chart_req)
+        #chart = urllib2.urlopen(url.encode('utf-8'))
         for header, value in chart.headers.items():
             req.send_header(header, value)
         req.write(chart.read())

-> See if making a new opener each time helps (instead of using some shared unknown implementation buried inside urllib2).

04/08/11 11:38:40 changed by anonymous

your patch leads to this error: http://tinypaste.com/e063ce

04/08/11 11:59:37 changed by osimons

Oops. Patch bugs... Now I've actually tested the patch, so at least verified to work for regular chart requests. See if it help with your reported bug too:

diff --git a/estimationtools/utils.py b/estimationtools/utils.py
--- a/estimationtools/utils.py
+++ b/estimationtools/utils.py
@@ -66,7 +66,9 @@
         req.perm.require('TICKET_VIEW')
         url = 'http://chart.apis.google.com/chart?%s' % req.args.get('data', '')
         self.log.debug("Fetching chart using url: %s" % repr(url))
-        chart = urllib2.urlopen(url.encode('utf-8'))
+        opener = urllib2.build_opener(urllib2.HTTPHandler())
+        chart_req = urllib2.Request(url.encode('utf-8'))
+        chart = opener.open(chart_req)
         for header, value in chart.headers.items():
             req.send_header(header, value)
         req.write(chart.read())

04/08/11 14:06:31 changed by falkb

I was wrong and looked at another chart. The right chart that causes the error exceeds the limit of 50 days. So this ticket is a duplicate of #5555 and could be closed. Sorry for any trouble.

04/08/11 14:18:23 changed by osimons

  • status changed from new to closed.
  • resolution set to duplicate.

Oki. Follow #5555 though, adding a patch there.


Add/Change #8686 (HTTPError 414 Request-URI Too Large)




Change Properties
Action