Project

Profile

Help

Issue #8208

docker 20.10 client pull operation fails with Error response from daemon: missing or empty Content-Type header

Added by dkliban@redhat.com 9 months ago. Updated 9 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 90
Quarter:

Description

Starting with docker client 20.10, a pull operation fails with the following message:

sudo docker pull pulp.example.com/test:manifest_a
docker: Error response from daemon: missing or empty Content-Type header.

The logs for pulp show that a 200 response was sent:

127.0.0.1 - - [04/Feb/2021:15:48:33 +0000] "HEAD /v2/test/manifests/manifest_a HTTP/1.0" 200 4 "-" 

Related issues

Copied to Container Support - Backport #8366: Backpot to 2.1: docker 20.10 client pull operation fails with Error response from daemon: missing or empty Content-Type headerCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 63f5b87c View on GitHub
Added by dkliban@redhat.com 9 months ago

Handle HEAD requests as if they are GET requests

The Content-Type header is stripped by DRF when there is no body in the response.

Django and aiohttp both strip the body of HEAD requests. It is safe to handle HEAD requests the same as GET requests and rely on the web server to strip the body of the response.

This patch also adds the Content-Type header to the ManifestResponse objects which are used when responding to requests of Manifest creation.

fixes: #8208 https://pulp.plan.io/issues/8208

Revision f3209cba View on GitHub
Added by dkliban@redhat.com 9 months ago

Handle HEAD requests as if they are GET requests

The Content-Type header is stripped by DRF when there is no body in the response.

Django and aiohttp both strip the body of HEAD requests. It is safe to handle HEAD requests the same as GET requests and rely on the web server to strip the body of the response.

This patch also adds the Content-Type header to the ManifestResponse objects which are used when responding to requests of Manifest creation.

fixes: #8208 https://pulp.plan.io/issues/8208

Revision ceb266c7 View on GitHub
Added by dkliban@redhat.com 9 months ago

Handle HEAD requests as if they are GET requests

The Content-Type header is stripped by DRF when there is no body in the response.

Django and aiohttp both strip the body of HEAD requests. It is safe to handle HEAD requests the same as GET requests and rely on the web server to strip the body of the response.

This patch also adds the Content-Type header to the ManifestResponse objects which are used when responding to requests of Manifest creation.

fixes: #8208 https://pulp.plan.io/issues/8208

Revision ceb266c7 View on GitHub
Added by dkliban@redhat.com 9 months ago

Handle HEAD requests as if they are GET requests

The Content-Type header is stripped by DRF when there is no body in the response.

Django and aiohttp both strip the body of HEAD requests. It is safe to handle HEAD requests the same as GET requests and rely on the web server to strip the body of the response.

This patch also adds the Content-Type header to the ManifestResponse objects which are used when responding to requests of Manifest creation.

fixes: #8208 https://pulp.plan.io/issues/8208

History

#1 Updated by pulpbot 9 months ago

  • Status changed from NEW to POST

#2 Updated by ipanova@redhat.com 9 months ago

  • Assignee set to dkliban@redhat.com
  • Sprint/Milestone set to 2.3.0
  • Sprint set to Sprint 89

#3 Updated by rchan 9 months ago

  • Sprint changed from Sprint 89 to Sprint 90

#4 Updated by dkliban@redhat.com 9 months ago

It looks like even if we set the Content-Type header for HEAD requests, DRF strips it out[0].

My reading on the internet has led me to believe that we should not implement a separate method for handling HEAD requests and simply respond with the same response as we would for GET. The body will get stripped away by other parts of the web server. I've tested this out and it works.

[0] https://github.com/encode/django-rest-framework/blob/3.9.x/rest_framework/response.py#L72-L81

#5 Updated by dkliban@redhat.com 9 months ago

  • Status changed from POST to MODIFIED

#6 Updated by pulpbot 9 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#7 Updated by ipanova@redhat.com 8 months ago

  • Copied to Backport #8366: Backpot to 2.1: docker 20.10 client pull operation fails with Error response from daemon: missing or empty Content-Type header added

Please register to edit this issue

Also available in: Atom PDF