Project

Profile

Help

Issue #7125

An internal server error is raised when trying to retrieve a manifest with a wrong accept header

Added by lmjachky over 1 year ago. Updated about 1 year ago.

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

Description

Steps to reproduce the error:

  1. Sync from the repository library/busybox using the attached script.
  2. Publish the repository.
  3. Run the following commands and read the response messages:
$ http :24817/v2/foo/manifests/1.32
HTTP/1.1 401 Unauthorized
Allow: GET, PUT, HEAD, OPTIONS
Connection: close
Content-Length: 6
Content-Type: */*; charset=utf-8
Date: Mon, 13 Jul 2020 11:00:54 GMT
Docker-Distribution-Api-Version: registry/2.0
Server: gunicorn/20.0.4
WWW-Authenticate: Bearer realm="http://localhost:24817/token/",service="pulp3-source-fedora31.localhost.example.com",scope="repository:foo:pull"
X-Frame-Options: SAMEORIGIN

detail
$ http :24817/token/?service=pulp3-source-fedora31.localhost.example.com'&'scope="repository:foo:pull"
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: close
Content-Length: 634
Content-Type: application/json
Date: Mon, 13 Jul 2020 11:01:03 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "expires_in": 300,
    "issued_at": "2020-07-13T11:01:03.853244Z",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IkdNMkQ6SU9CVDpHQVpEOk1aUlE6RzQyVzpDWkJaOkdWUlQ6R00zRzpNRTJUOlFNSlk6R1JURDpNTUpRIn0.eyJhY2Nlc3MiOlt7InR5cGUiOiJyZXBvc2l0b3J5IiwibmFtZSI6ImZvbyIsImFjdGlvbnMiOlsicHVsbCJdfV0sImF1ZCI6InB1bHAzLXNvdXJjZS1mZWRvcmEzMS5sb2NhbGhvc3QuZXhhbXBsZS5jb20iLCJleHAiOjE1OTQ2MzgzNjMsImlhdCI6MTU5NDYzODA2MywiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDoyNDgxNy90b2tlbi8iLCJqdGkiOiI1NWNhZTljMC01Nzk3LTQ5ODAtYmVlMi02MDE4MTQ4NWQzZmQiLCJuYmYiOjE1OTQ2MzgwNjMsInN1YiI6IiJ9.zK6EvZ6Y8VAkE4iNNcYvlejyfdVnekIrP1JY7-fCZis1Lrgxfc_NzrhsvSdQXsB5grY8bJUMF47Z2tq96pbkpg"
}
$ http --auth-type=jwt --auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IkdNMkQ6SU9CVDpHQVpEOk1aUlE6RzQyVzpDWkJaOkdWUlQ6R00zRzpNRTJUOlFNSlk6R1JURDpNTUpRIn0.eyJhY2Nlc3MiOlt7InR5cGUiOiJyZXBvc2l0b3J5IiwibmFtZSI6ImZvbyIsImFjdGlvbnMiOlsicHVsbCJdfV0sImF1ZCI6InB1bHAzLXNvdXJjZS1mZWRvcmEzMS5sb2NhbGhvc3QuZXhhbXBsZS5jb20iLCJleHAiOjE1OTQ2MzgzNjMsImlhdCI6MTU5NDYzODA2MywiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDoyNDgxNy90b2tlbi8iLCJqdGkiOiI1NWNhZTljMC01Nzk3LTQ5ODAtYmVlMi02MDE4MTQ4NWQzZmQiLCJuYmYiOjE1OTQ2MzgwNjMsInN1YiI6IiJ9.zK6EvZ6Y8VAkE4iNNcYvlejyfdVnekIrP1JY7-fCZis1Lrgxfc_NzrhsvSdQXsB5grY8bJUMF47Z2tq96pbkpg :24817/v2/foo/manifests/1.32
HTTP/1.1 302 Found
Allow: GET, PUT, HEAD, OPTIONS
Connection: close
Content-Length: 0
Content-Type: text/html; charset=utf-8
Date: Mon, 13 Jul 2020 11:01:27 GMT
Docker-Distribution-Api-Version: registry/2.0
Location: http://pulp3-source-fedora31.localhost.example.com/pulp/container/foo/manifests/1.32?validate_token=2d2be5ba4550abbb7b9e2296468f94142991fb1168e7686e822f4dcf4aaa0340:4f3d94319a325e1ef11bc32357f39bdb8e4ebd56f22199e0ef0e2803c88f44fb
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN
$ http http://pulp3-source-fedora31.localhost.example.com/pulp/container/foo/manifests/1.32?validate_token=2d2be5ba4550abbb7b9e2296468f94142991fb1168e7686e822f4dcf4aaa0340:4f3d94319a325e1ef11bc32357f39bdb8e4ebd56f22199e0ef0e2803c88f44fb
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2868
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws; charset=utf-8
Date: Mon, 13 Jul 2020 11:01:35 GMT
Docker-Content-Digest: sha256:2131f09e4044327fd101ca1fd4043e6f3ad921ae7ee901e9142e6e36b354a907
Docker-Distribution-API-Version: registry/2.0
Server: nginx/1.18.0

{
   "architecture": "amd64",
   "fsLayers": [
      {
         "blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
      },
      {
         "blobSum": "sha256:91f30d776fb27944b3febb64600db83a880fb4af3f55442f3ad5ee1a786295bf"
      }
   ],
   "history": [
      {
         "v1Compatibility": "{\"architecture\":\"amd64\",\"config\":{\"ArgsEscaped\":true,\"AttachStderr\":false,\"AttachStdin\":false,\"AttachStdout\":false,\"Cmd\":[\"sh\"],\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Hostname\":\"\",\"Image\":\"sha256:26afbc3fc0fa52aaee59e63f3b74cb539a0198c51be5a748a1adb900a54af56a\",\"Labels\":null,\"OnBuild\":null,\"OpenStdin\":false,\"StdinOnce\":false,\"Tty\":false,\"User\":\"\",\"Volumes\":null,\"WorkingDir\":\"\"},\"container\":\"ea5a1615abcb7710a714447ca281b21f302031efd601dd3ce52a6a1878e704d8\",\"container_config\":{\"ArgsEscaped\":true,\"AttachStderr\":false,\"AttachStdin\":false,\"AttachStdout\":false,\"Cmd\":[\"/bin/sh\",\"-c\",\"#(nop) \",\"CMD [\\\"sh\\\"]\"],\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Hostname\":\"ea5a1615abcb\",\"Image\":\"sha256:26afbc3fc0fa52aaee59e63f3b74cb539a0198c51be5a748a1adb900a54af56a\",\"Labels\":{},\"OnBuild\":null,\"OpenStdin\":false,\"StdinOnce\":false,\"Tty\":false,\"User\":\"\",\"Volumes\":null,\"WorkingDir\":\"\"},\"created\":\"2020-06-29T20:21:41.42102751Z\",\"docker_version\":\"18.09.7\",\"id\":\"9e9220abceaf86f2ad7820ae8124d01223d8ec022b9a6cb8c99a8ae1747137ea\",\"os\":\"linux\",\"parent\":\"f2ddd8aad2932bcdfd8775c09d18e9e9efee1c900c3ce4d7147c2a3b2ecb4e92\",\"throwaway\":true}"
      },
      {
         "v1Compatibility": "{\"container_config\":{\"Cmd\":\"/bin/sh -c #(nop) ADD file:a70cb3368aa3e4014e72bf21aff955cffd081804287c06b68a7e0201951df3b1 in / \"},\"created\":\"2020-06-29T20:21:41.274614285Z\",\"id\":\"f2ddd8aad2932bcdfd8775c09d18e9e9efee1c900c3ce4d7147c2a3b2ecb4e92\"}"
      }
   ],
   "name": "foo",
   "schemaVersion": 1,
   "tag": "1.32",
   "signatures": [
      {
         "header": {
            "alg": "ES256",
            "jwk": {
               "crv": "P-256",
               "kid": "YJ5B:ETEV:5BK7:244T:KI37:27UQ:SZY3:PZPF:7U2M:HWLR:62ZQ:6UCY",
               "kty": "EC",
               "x": "CBb0Koat-I8x-PpdZkTpTCTgE3MrJR0QlKLJUY5IguE",
               "y": "ht0RK2_3Vl39FRud3a7xsYu3EuDd3VE-5m5JeSH6mkY"
            }
         },
         "protected": "eyJmb3JtYXRMZW5ndGgiOjIxMTIsImZvcm1hdFRhaWwiOiJDbjAiLCJ0aW1lIjoiMjAyMC0wNy0xM1QxMTowMTozNVoiLCJhbGciOiJFUzI1NiIsImtpZCI6IllKNUI6RVRFVjo1Qks3OjI0NFQ6S0kzNzoyN1VROlNaWTM6UFpQRjo3VTJNOkhXTFI6NjJaUTo2VUNZIn0",
         "signature": "mZ82-rjugWzYQ7laAv3sfG0lyPTJI2TYHFUQHkb2MOvg2c5__x9nrDz3N0OYUdIg0rTGjXsAPYOQnaoMjzpf5w"
      }
   ]
}
$ http http://pulp3-source-fedora31.localhost.example.com/pulp/container/foo/manifests/1.32?validate_token=2d2be5ba4550abbb7b9e2296468f94142991fb1168e7686e822f4dcf4aaa0340:4f3d94319a325e1ef11bc32357f39bdb8e4ebd56f22199e0ef0e2803c88f44fb Accept:application/vnd.docker.distribution.manifest.v2+json
HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Content-Length: 55
Content-Type: text/plain; charset=utf-8
Date: Mon, 13 Jul 2020 11:01:44 GMT
Server: nginx/1.18.0

500 Internal Server Error

Server got itself in trouble

journalctl -u pulpcore-content.service
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]: Traceback (most recent call last):
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:     resp = await task
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:     resp = await handler(request)
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:   File "/home/vagrant/devel/pulp_container/pulp_container/app/registry.py", line 175, in get_tag
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:     return await Registry.dispatch_converted_schema(tag, accepted_media_types, path)
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:   File "/home/vagrant/devel/pulp_container/pulp_container/app/registry.py", line 231, in dispatch_converted_schema
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:     return await Registry.dispatch_tag(schema, response_headers)
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:   File "/home/vagrant/devel/pulp_container/pulp_container/app/registry.py", line 193, in dispatch_tag
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]:     artifact = tag.tagged_manifest._artifacts.get()
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]: AttributeError: 'Manifest' object has no attribute 'tagged_manifest'
Jul 13 11:01:44 pulp3-source-fedora31.localhost.example.com gunicorn[18484]: 127.0.0.1 [13/Jul/2020:11:01:44 +0000] "GET /pulp/container/foo/manifests/1.32?validate_token=2d2be5ba4550abbb7b9e2296468f94142991fb1168e7686e822f4dcf4aaa0340:4f3d94319a325e1ef11bc32357f39bdb8e4ebd56f22199e0ef0e2803c88f44fb HTTP/1.0" 500 225 "-" "HTTPie/2.2.0"
dockersync-busybox.bash (878 Bytes) dockersync-busybox.bash lmjachky, 07/13/2020 01:03 PM

Associated revisions

Revision 3cbeb069 View on GitHub
Added by Lubos Mjachky over 1 year ago

Return an HTTP 404 response when a manifest was not converted

closes #7125

Revision 3cbeb069 View on GitHub
Added by Lubos Mjachky over 1 year ago

Return an HTTP 404 response when a manifest was not converted

closes #7125

History

#1 Updated by lmjachky over 1 year ago

The tagged manifest is of the type application/vnd.docker.distribution.manifest.list.v2+json.

#2 Updated by lmjachky over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to lmjachky
  • Triaged changed from No to Yes
  • Sprint set to Sprint 77

We decided to return a HTTP 404 response when a conversion was not successful.

#3 Updated by pulpbot over 1 year ago

  • Status changed from ASSIGNED to POST

#4 Updated by Anonymous over 1 year ago

  • Status changed from POST to MODIFIED

#5 Updated by Anonymous over 1 year ago

#7 Updated by mdellweg about 1 year ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF