Issue #1734
closedThe Pulp streamer logs a traceback when a ConnectionError occurs.
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.
Updated by mhrivnak about 7 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 1. Low
- Triaged changed from No to Yes
- Tags Easy Fix added
Updated by jcline@redhat.com about 7 years ago
- Severity changed from 1. Low to 3. High
- Platform Release set to 2.8.1
I'm changing this to be a 2.8.1 bug with high severity because I dug into this a bit more and realized this has very serious consequences. When this KeyError occurs, the response code the streamer returns to the caching proxy will be 200 OK, even though things are definitely not okay.
This in turn causes the download tasks to believe everything went okay and because https://pulp.plan.io/issues/1737 is not fixed yet, the task cannot check the integrity of the file (which is a 0-byte file) so it gets written to permanent storage.
Updated by jcline@redhat.com about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jcline@redhat.com
Updated by jcline@redhat.com about 7 years ago
- Status changed from ASSIGNED to POST
Added by Jeremy Cline about 7 years ago
Added by Jeremy Cline about 7 years ago
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
Updated by Anonymous about 7 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|74bd56aa725159716f336279227135bab1720226.
Updated by semyers almost 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
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