I’m trying to configure an external Docker Feed from an IBM Cloud (Bluemix) private registry.
Following IBM’s guide for setting up a service account, I’ve created a “Bluemix Container Registry” token
I can log in with this successfully on the command line:
Octopus v2018.5.6
Unable to retrieve authentication token required to perform operation.
System.Exception
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.RetrieveAuthenticationToken
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.GetAuthRequestHeader
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.Get
I’m running Octopus version v2018.5.6 and I think IBM Cloud/Bluemix is running a v2 registry for Docker. I’ve checked the Octopus logs on the box, but can’t see any extra useful info being logged out, though it gives more of the stacktrace:
2018-07-02 11:44:58.2865 1816 265 ERROR Unhandled error on request: ${OCTOPUS_INSTANCE_BASE_URL}/api/feeds/${OCTOPUS_EXTERNAL_FEED_ID}/packages/search?term=test&take=10 ${SOME_GUID} by ${MY_OCTOPUS_USERNAME} : Unable to retrieve authentication token required to perform operation.
System.Exception: Unable to retrieve authentication token required to perform operation.
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.<RetrieveAuthenticationToken>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.<GetAuthRequestHeader>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.<Get>d__4.MoveNext()
Please let me know if I can give any other useful details.
Hi Dave,
It sounds like something in the API reponse coming back from BlueMix is not what Octopus is expecting. We have had issues in the past, for example Proget v4.6.7, where the provider said they had implemented standard V2 Docker Registry API however had built something in-house that wasn’t quite compliant.
We don’t currently have a BlueMix account set up to test the connections to their repository however have put through a request. Hopefully ol’ Big Blue comes back soon with credentials so i can test through Octopus. If you have some temporary read-only credentials I can use I’d be happy to give those a try however I understand if that’s not possible.
Within Octopus we try to interact with the details provided directly over HTTPS so in the meantime we should be able to replicate some of it manually, either through the browser or a HTTP tool like PostMan:
Based on the URL you provided above could you first try load https://registry.eu-gb.bluemix.net/v2. You should get a 401 (Unauthorized) with a Www-Authenticate header with a value like Bearer realm="https://registry.eu-gb.bluemix.net/oauth/token",service="registry"
Take the details from this field and try to make another request. In my case this looks something like https://registry.eu-gb.bluemix.net/oauth/token?service=registry.
You will be prompted with a login. In my case I can go no further, but if you add your credentials you should get a token in the response.
Assuming you get the token above then you should be able to perform the above request again but this time adding a an authorization header in the HTTP request with this token Authorization: Bearer <token>.
If all goes well you should get a 200 response.
My apologies that the above steps are a little convoluted but as soon as I get some credentials ill give it a try myself. In the meantime ill also look at adding a but more logging to see if there is any more details that can be obtained from the responses.
thanks for your reply and detailed explanation. I’m working with Dave and replying on his behave.
On step 3 submitting a user’s credentials, I get a bad request (400) with the following json response:
{
“errors”:[
{
“code”:“UNSUPPORTED”,
“message”:“The requested authentication method is not supported. Run the bx cr login command. To use registry tokens, use docker login -u token and your registry token as the password.”,
“detail”:“The requested authentication method is not supported. Run the bx cr login command. To use registry tokens, use docker login -u token and your registry token as the password.”
}
]
}