Actions
Issue #1734
closedThe Pulp streamer logs a traceback when a ConnectionError occurs.
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
2.8.1
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
For example:
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.threaded:WARNING: ('Connection aborted.', BadStatusLine("''",))
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) u'response_code'
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) Traceback (most recent call last):
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) File "/usr/lib/python2.7/site-packages/nectar/downloaders/base.py", line 145, in _fire_event_to_listener
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) event_listener_callback(*args, **kwargs)
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) File "/home/vagrant/devel/pulp/streamer/pulp/streamer/server.py", line 101, in download_failed
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) '%%(response_msg)s' %% error_report))
Mar 02 14:28:47 dev pulp_streamer[10439]: nectar.downloaders.base:ERROR: (10439-91008) KeyError: u'response_code'
A requests.ConnectionError was raised, and subsequently calls the `download_failed` method on the event listener. The streamer's event listener should be updated to not assume the 'response_code' field is present in the failure report.
Actions
Ensure a proper HTTP status code in the streamer on failure
If a non-HTTP error occurs in Nectar the streamer would fail to return a reasonable status code. An example of this is if the domain name is unresolvable or the host is not accepting connections. This resulted in an HTTP 200 from the streamer. It is now a HTTP 503.
closes #1734