2012-06-12 22:47:30 |
Robert Collins |
description |
I regularly receive errors when trying to access the attachments of bug reports (all private afaict) using the API.
Here is some sample code:
for attachment in bug.attachments:
f = attachment.data.open()
print(f.filename)
I'll receive errors like:
ServerError Traceback (most recent call last)
/home/theman/documents/canonical/launchpadlib/<ipython-input-8-649cbaee9cc1> in <module>()
1 for attachment in bug.attachments:
----> 2 f = attachment.data.open()
3 print(f.filename)
/usr/lib/python2.7/dist-packages/lazr/restfulclient/resource.pyc in open(self, mode, content_type, filename)
397 """Open the file on the server for read or write access."""
398 if mode in ('r', 'w'):
--> 399 return HostedFileBuffer(self, mode, content_type, filename)
400 else:
401 raise ValueError("Invalid mode. Supported modes are: r, w")
/usr/lib/python2.7/dist-packages/lazr/restfulclient/resource.pyc in __init__(self, hosted_file, mode, content_type, filename)
1016 "specify filename.")
1017 response, value = hosted_file._root._browser.get(
-> 1018 self.url, return_response=True)
1019 content_type = response['content-type']
1020 last_modified = response.get('last-modified')
/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.pyc in get(self, resource_or_uri, headers, return_response)
289 method = resource_or_uri.get_method('get')
290 url = method.build_request_url()
--> 291 response, content = self._request(url, extra_headers=headers)
292 if return_response:
293 return (response, content)
/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.pyc in _request(self, url, data, method, media_type, extra_headers)
279 error = error_for(response, content)
280 if error is not None:
--> 281 raise error
282 return response, content
283
ServerError: HTTP Error 500: Internal Server Error
Response headers:
---
-content-encoding: gzip
cache-control: max-age=604800
connection: close
content-length: 95
content-type: text/html
date: Thu, 17 May 2012 14:55:03 GMT
server: TwistedWeb/11.1.0
status: 500
transfer-encoding: chunked
vary: Accept-Encoding
via: 1.0 banana.canonical.com:3128 (squid/2.7.STABLE7), 1.1 wildcard.restricted.launchpadlibrarian.net
x-cache: MISS from banana.canonical.com
x-cache-lookup: MISS from banana.canonical.com:3128
---
Response body:
---
<html><head><title>Processing Failed</title></head><body><b>Processing Failed</b></body></html>
The server name and the specific attachment it happens with will change. |
The librarian is erroring intermittently and is receiving socket errors in its backend.
-ops are restarting it when this happens, which appears to fix the symptoms.
I regularly receive errors when trying to access the attachments of bug reports (all private afaict) using the API.
Here is some sample code:
for attachment in bug.attachments:
f = attachment.data.open()
print(f.filename)
I'll receive errors like:
ServerError Traceback (most recent call last)
/home/theman/documents/canonical/launchpadlib/<ipython-input-8-649cbaee9cc1> in <module>()
1 for attachment in bug.attachments:
----> 2 f = attachment.data.open()
3 print(f.filename)
...
status: 500
transfer-encoding: chunked
vary: Accept-Encoding
via: 1.0 banana.canonical.com:3128 (squid/2.7.STABLE7), 1.1 wildcard.restricted.launchpadlibrarian.net
x-cache: MISS from banana.canonical.com
x-cache-lookup: MISS from banana.canonical.com:3128
---
Response body:
---
<html><head><title>Processing Failed</title></head><body><b>Processing Failed</b></body></html> |
|