jfrog / artifactory-docker-examples

Examples for using Artifactory Docker distribution in various environments
https://www.jfrog.com/artifactory/
Apache License 2.0
330 stars 299 forks source link

404s when docker login against artifactory/docker-virtual #135

Closed arendej closed 5 years ago

arendej commented 5 years ago

Getting 404 error when attempting to hit either addresses provided by Artifactory within an OpenShift cluster..

Tried a login...

[me@client ~]$ sudo docker login artifactory-artifactory.apps.example.com 
Username: admin
Password: <redacted>
Error response from daemon: Login: <!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> &#47;v1&#47;users&#47;</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.32</h3></body></html> (Code: 404; Headers: map[Content-Language:[en] Content-Length:[1091] Date:[Tue, 04 Dec 2018 20:54:54 GMT] Set-Cookie:[ceea87dd3fd0a0b07bf7f798c6ad7c76=43b960a2c5c6cae34183f77a784b0adf; path=/; HttpOnly; Secure] Content-Type:[text/html;charset=utf-8]])
[me@client ~]$ sudo docker login docker-virtual-artifactory.apps.example.com
Username: admin
Password: <redacted>
Error response from daemon: Login: <!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> &#47;v1&#47;users&#47;</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.32</h3></body></html> (Code: 404; Headers: map[Set-Cookie:[4bb333339fa9774bb09b7888640e8768=716476e73d340f3b4cc35a3c69c8f933; path=/; HttpOnly; Secure] Content-Type:[text/html;charset=utf-8] Content-Language:[en] Content-Length:[1091] Date:[Tue, 04 Dec 2018 21:18:04 GMT]])

What's needed after a vanilla on-prem install of Artifactory HA, in order to serve the docker registry from it.?

daniyalj commented 5 years ago

Running into the same problem. Seeing this in the logs for one of the pods:

2018-12-10 17:17:57,397 [http-nio-8081-exec-5] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
--
  | 2018-12-10 17:18:32,154 [http-nio-8081-exec-10] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:18:32,162 [http-nio-8081-exec-4] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:19:37,958 [http-nio-8081-exec-10] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:19:59,891 [http-nio-8081-exec-9] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:20:02,617 [http-nio-8081-exec-1] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:20:03,483 [http-nio-8081-exec-10] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:20:41,580 [http-nio-8081-exec-7] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:20:43,184 [http-nio-8081-exec-8] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'
  | 2018-12-10 17:20:44,383 [http-nio-8081-exec-5] [ERROR] (o.a.a.d.r.DockerV2AuthenticationFilter:168) - Unsupported docker v2 repository request for 'docker-virtual-artifactory'

This is after many attempts of doing docker login on the docker-virtual-artifactory route. I am also adding this to the insecure registry because I dont have certs in my cluster.

daniyalj commented 5 years ago

The docker-virtual route is just a reference. It needs the specific repository to be present to work. I created a virtual repository called docker-artifactory and then logged in:

$ docker login -u admin -p password docker-artifactory.apps.example.com
Login Succeeded
arendej commented 5 years ago

works for me!