Project

Profile

Help

Issue #8208

closed

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

Added by dkliban@redhat.com almost 4 years ago. Updated almost 4 years 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 - CURRENTRELEASEmdellweg

Actions
Actions #1

Updated by pulpbot almost 4 years ago

  • Status changed from NEW to POST
Actions #2

Updated by ipanova@redhat.com almost 4 years ago

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

Updated by rchan almost 4 years ago

  • Sprint changed from Sprint 89 to Sprint 90
Actions #4

Updated by dkliban@redhat.com almost 4 years 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

Added by dkliban@redhat.com almost 4 years ago

Revision 63f5b87c | View on GitHub

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

Actions #5

Updated by dkliban@redhat.com almost 4 years ago

  • Status changed from POST to MODIFIED

Added by dkliban@redhat.com almost 4 years ago

Revision f3209cba | View on GitHub

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

Added by dkliban@redhat.com almost 4 years ago

Revision ceb266c7 | View on GitHub

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

Added by dkliban@redhat.com almost 4 years ago

Revision ceb266c7 | View on GitHub

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

Actions #6

Updated by pulpbot almost 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #7

Updated by ipanova@redhat.com almost 4 years 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

Also available in: Atom PDF