Project

Profile

Help

Issue #5211

A list is not accepted for Accept header in docker registry api

Added by jomitsch@redhat.com about 1 year ago. Updated 6 months ago.

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

Description

When calling a registry API endpoint like /v2/myimage/manifests/latest, if you send an Accept header with a list, this error occurs:

Aug 01 20:24:56 pulp3-again.jomitsch.example.com gunicorn[1070]: pulp: pulp_docker.app.registry:WARNING: The requested tag `latest` is of type application/vnd.docker.distribution.manifest.v2+json, but the client only accepts ['application/json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v1+prettyjws'].

The Accept header is something like `Accept: application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v1+prettyjws, application/json`

If my python isn't too rusty, it looks like "value" needs to be split on the comma here (assuming the header is correct) https://github.com/pulp/pulp_docker/blob/master/pulp_docker/app/registry.py#L47

I haven't been able to reproduce with curl yet, but here are our headers printed out in ruby

{"VERSION"=>"HTTP/1.1", "HOST"=>"pulp3-again.jomitsch.example.com", "USER-AGENT"=>"docker/1.13.1 go/go1.10.3 kernel/3.10.0-862.2.3.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.13.1 \\(linux\\))", "ACCEPT"=>"application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v1+prettyjws, application/json", "AUTHORIZATION"=>"Bearer $2a$09$1b6453892473a467d0737ufZsuql4iq8AdEzTB.1OBc.uiUPfa71m", "ACCEPT-ENCODING"=>"gzip", "X-FORWARDED-PROTO"=>"https", "VIA"=>"1.1 pulp3-again.jomitsch.example.com", "X-FORWARDED-FOR"=>"192.168.121.121", "X-FORWARDED-HOST"=>"pulp3-again.jomitsch.example.com", "X-FORWARDED-SERVER"=>"pulp3-again.jomitsch.example.com", "CONNECTION"=>"Keep-Alive"}

Versions:
using the latest pulp3 code from git in the Katello pulp3 dev env

Associated revisions

Revision f553dd7c View on GitHub
Added by jomitsch@redhat.com about 1 year ago

Allow Accept header to send multiple values

closes #5211 https://pulp.plan.io/issues/5211

This will allow the Accept header to use multiple values.

I tested this out with pulling directly with docker, which seems to send one value, and Katello, where we send multiple values. Both scenarios were able to pull successfully.

This will make it easy for Katello to substitute pulp3 registry url instead of crane where it is supported.

Revision f553dd7c View on GitHub
Added by jomitsch@redhat.com about 1 year ago

Allow Accept header to send multiple values

closes #5211 https://pulp.plan.io/issues/5211

This will allow the Accept header to use multiple values.

I tested this out with pulling directly with docker, which seems to send one value, and Katello, where we send multiple values. Both scenarios were able to pull successfully.

This will make it easy for Katello to substitute pulp3 registry url instead of crane where it is supported.

Revision f553dd7c View on GitHub
Added by jomitsch@redhat.com about 1 year ago

Allow Accept header to send multiple values

closes #5211 https://pulp.plan.io/issues/5211

This will allow the Accept header to use multiple values.

I tested this out with pulling directly with docker, which seems to send one value, and Katello, where we send multiple values. Both scenarios were able to pull successfully.

This will make it easy for Katello to substitute pulp3 registry url instead of crane where it is supported.

Revision f553dd7c View on GitHub
Added by jomitsch@redhat.com about 1 year ago

Allow Accept header to send multiple values

closes #5211 https://pulp.plan.io/issues/5211

This will allow the Accept header to use multiple values.

I tested this out with pulling directly with docker, which seems to send one value, and Katello, where we send multiple values. Both scenarios were able to pull successfully.

This will make it easy for Katello to substitute pulp3 registry url instead of crane where it is supported.

History

#1 Updated by jomitsch@redhat.com about 1 year ago

  • Subject changed from A list is not accepted for Accept header in registry api to A list is not accepted for Accept header in docker registry api

#2 Updated by jsherril@redhat.com about 1 year ago

  • Tags Katello-P2 added

#3 Updated by jsherril@redhat.com about 1 year ago

  • Tags Katello-P1 added
  • Tags deleted (Katello-P2)

#4 Updated by daviddavis about 1 year ago

  • Project changed from Pulp to Docker Support

#5 Updated by jomitsch@redhat.com about 1 year ago

  • Description updated (diff)

#6 Updated by ipanova@redhat.com about 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jomitsch@redhat.com
  • Triaged changed from No to Yes
  • Sprint set to Sprint 57

#7 Updated by ipanova@redhat.com about 1 year ago

  • Status changed from ASSIGNED to POST

#8 Updated by jomitsch@redhat.com about 1 year ago

  • Status changed from POST to MODIFIED

Applied in changeset commit:pulp_docker|f553dd7cde196da4b47442c35f2aff07a78acafc.

#10 Updated by ipanova@redhat.com 11 months ago

  • Project changed from Docker Support to Container Support

#11 Updated by ipanova@redhat.com 11 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

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

  • Sprint/Milestone set to 1.0.0

#13 Updated by ggainey 6 months ago

  • Tags Katello added
  • Tags deleted (Katello-P1)

Please register to edit this issue

Also available in: Atom PDF