[RTFACT-18234] Headers are not identified for remote repositories Created: 09/Jan/19  Updated: 12/Aug/19  Resolved: 24/Jun/19

Status: Resolved
Project: Artifactory Binary Repository
Component/s: Docker
Affects Version/s: 6.5.9
Fix Version/s: 6.12.0

Type: Bug Priority: Normal
Reporter: Sanjeev Karani Assignee: Bar Haim
Resolution: Fixed Votes: 0
Labels: QF, QF-P2

Tested on local pro-installation

Attachments: File docker-test.groovy    
Sprint: Leap 37


UPDATE: This is happening with all tech using '/api/' in the URL, not only Docker.

Attached plugin script is being used to detect request headers.

The ubuntu:latest image is being copied to 'docker-local' to compare the results.

For 'docker-local', the plugin detects request headers.

$ curl -vvv -H "X-JFrog-Art-Api:AKCp5bu9HHBiktERAiG8dNfBPXJVhBr5Yoj6jA3EAabmrqBEiw7nZ66MTfG7hFfxV45Tvyto9" http://localhost:8081/artifactory/api/docker/docker-local/v2/ubuntu/blobs/sha256:84ed7d2f608f8a65d944b40132a0333069302d24e9e51a6d6b338888e8fd0a6b -O

2019-01-08 16:25:39,626 [http-nio-8081-exec-15] [INFO ] (o.j.r.d.v.r.h.DockerV2LocalRepoHandler:117) - Fetching docker blob 'sha256:84ed7d2f608f8a65d944b40132a0333069302d24e9e51a6d6b338888e8fd0a6b' from repo 'docker-local'
2019-01-08 16:25:39,641 [http-nio-8081-exec-15] [WARN ] (docker-test :21) - BeforeDownload: Headers exist
2019-01-08 16:25:39,648 [http-nio-8081-exec-15] [WARN ] (docker-test :10) - AltResponse: Headers exist


For 'docker-remote', the plugin doesn't detect request headers and always returns 404 code.

$ curl -vvv -H "X-JFrog-Art-Api:AKCp5bu9HHBiktERAiG8dNfBPXJVhBr5Yoj6jA3EAabmrqBEiw7nZ66MTfG7hFfxV45Tvyto9" http://localhost:8081/artifactory/api/docker/docker-remote/v2/ubuntu/blobs/sha256:84ed7d2f608f8a65d944b40132a0333069302d24e9e51a6d6b338888e8fd0a6b -O

2019-01-08 16:25:19,012 [http-nio-8081-exec-8] [INFO ] (o.a.a.d.r.v.DockerV2RemoteRepoHandler:172) - Fetching docker blob 'sha256:84ed7d2f608f8a65d944b40132a0333069302d24e9e51a6d6b338888e8fd0a6b'
2019-01-08 16:25:19,601 [http-nio-8081-exec-8] [WARN ] (docker-test :23) - BeforeDownload: Request has no headers
2019-01-08 16:25:19,688 [http-nio-8081-exec-8] [WARN ] (docker-test :12) - AltResponse: Request has no headers

Comment by Gal Ben Ami [ 16/Jan/19 ]

Please add more details.
What is the topology?
Is it docker-client -> artifactory1 -> artifactory2 ?
Are the headers being dropped from the remote repo?

Comment by Atlassian Build Team [ 07/Apr/19 ]

Note artifactory also returns 500 if we change status code to HttpStatus.NOT_MODIFIED

Generated at Tue Apr 07 08:00:05 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.