IBM Bluemix container registry error - ibm-cloud

We are facing an issue while accessing container registry using bx CLI container registry plugin.
Command :
bx cr login
Error :
Logging in to 'registry.ng.bluemix.net'... FAILED Failed to 'docker
login' to 'registry.ng.bluemix.net' with error: Error response from
daemon: login attempt to https://registry.ng.bluemix.net/v2 failed
with status: 401 Unauthorized
It was working fine earlier. But now it is giving above error.

Please can you make sure you latest versions of:
bx
bx cr plugin
Docker
and try again.
It will also be worth checking that your Bluemix account is still active by running the following command: bx iam accounts
If the problem persists please can you raise a Bluemix support ticket and provide the output of bx cr info and some timestamps of when you ran the command so we can look further into your issue.

Related

Auth error when pushing to Google Artifact Repository

I'm trying to push to GAR from my local machine, but I always get this error:
failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden
First, I've confirmed that my account has the Artifact Registry Writer role through IAM.
I have done the following locally:
# Login with my Google account
gcloud auth login --update-adc --force
# Configure docker to use the gcloud CLI auth helper
gcloud auth configure-docker us-west1-docker.pkg.dev
# docker login for good measure
docker login
# Tag my image (already built)
docker tag myimage us-west1-docker.pkg.dev/myproject/myrepo/myimage
# Push it
docker push us-west1-docker.pkg.dev/myproject/myrepo/myimage
On this final command I get the error above.
I have read all the Google documentation I could find but they all suggest the above steps:
https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling
https://cloud.google.com/artifact-registry/docs/docker/troubleshoot
Note: I can't pull either, using the command provided directly from the GCP web UI.
I'm on M1 Mac.
So I was able to solve this problem by completely nuking Docker, specifically with these steps: https://stackoverflow.com/a/69437543/3846032. I couldn't uninstall it by normal means, it would just hang, implying that the problems I was getting were a result of my Docker installation being very broken. Indeed, I managed to follow the above steps on another machine and it worked, which led me to conclude the steps above and my credentials were totally fine.
The 403 was a red herring, it must have come from my local Docker being broken in such a way that it doesn't send properly authenticated requests.

How to use a Notary client to access IBM Cloud notary server

I got the following error when trying to use a Notary client to get the digest of a signed image in my IBM Container Registry. Can anyone advise how to solve it?
# notary -s https://us.icr.io:4443 lookup us.icr.io/securek8s/hello-world latest
* fatal: unauthorized: The login credentials are not valid, or your IBM Cloud account is not active.
BTW, I built the Notary client from https://github.com/theupdateframework/notary
Notary uses your credentials from your Docker login cache. The error message that you received suggests that your login to us.icr.io isn't valid. This usually means that your credentials have expired.
If you have the ibmcloud CLI and the container-registry plugin installed, you can refresh your login by making sure that you're targeting the US South registry (ibmcloud cr region-set us.icr.io) and then logging in with ibmcloud cr login.
If you don't have the CLI plugin installed, you can log in using Docker commands directly. For more information, see Automating access to IBM Cloud Container Registry
in the IBM Cloud docs.

Error response from daemon: unauthorized: authentication require

I'm getting this weird error in azure pipelines. We use a ACR to supply our base images and we connect to this using a service connection which works well most of the time. However occasionally we get an error:
/usr/bin/docker pull /base-images/python:3.7-buster-vanilla
Error response from daemon: Get https:///v2/base-images/python/manifests/3.7-buster-vanilla: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
There does not seem to be any clear explanation for this because when we perform a retry of the specific task this works fine.
We have no separate login to the acr and we only define the connection that needs to be used in the job itself:
container:
image: servers.azurecr.io/base-images/python:3.7-buster-vanilla
endpoint: server-Service-Connection
I have been looking at the build logs but was not able to get any usefull information from there. If any additional information is needed i would of course be happy to supply it.
I fixed this error using the Azure CLI az acr login --name *registry-name* Solution explained here at Azure Registry troubleshooting docs
I think you may be running into a Docker Hub issue. We're experiencing this intermittently in our CI (not Azure) during regular pulls for python images.
From https://status.docker.com/pages/history/533c6539221ae15e3f000031
February 3, 2021 5:21PM
UTC[Investigating] A number of users may experience problems logging into Docker Hub.

bx cf logs gives "Error dialing traffic controller server" when switching region

I need a script to collect logs which must switch between regions via a bx login -a. I'm using the bluemix cli so that I can login using an apikey.
But when I switch regions the bx cf logs app_name goes haywire.
[Ops]$ bx cf logs AppName
Invoking 'cf logs AppName'...
FAILED
Error dialing traffic controller server: websocket: bad handshake.
Please ask your Cloud Foundry Operator to check the platform configuration (traffic controller is wss://doppler.eu-gb.bluemix.net:443).
[Ops]$ bx api
API endpoint: https://api.ng.bluemix.net (API version: 2.54.0)
See how my api is ng but the doppler is the UK's eu-gb. If I run cf logs in UK region it does work fine.
Versions:
[Ops]$ bx --version
bx version 0.5.4+ae22935-2017-05-18T03:55:55+00:00
[Ops]$ bx update
Checking for updates...
No update required. Your CLI is already up-to-date.
[Ops]$ bx cf --version
Invoking 'cf --version'...
cf version 6.18.0+b22884b9c-2017-02-27
I found this and reckon at least related but note it's fixed in CF 6.26 and the embedded in bx version is 6.18.
Any workaround? Logout/Login with -a doesn't help me. I don't want to use cf directly due to my requirement to login via apikey.
Bluemix CLI embedded a CF CLI with version 6.18, 'bx app logs' actually invokes 'cf logs' as you can see from the messages. This embedded CF CLI needs to be upgraded.
A workaround is to just copy the cf cli binary to /usr/local/Bluemix/cfcli

gcloud beta ml init-project -- Error: Project does not exist, or you do not have permission

I'm trying to get started with Google Machine Learning using these instructions: Getting Setup
When I run gcloud beta ml init-project I get
ERROR: (gcloud.beta.ml.init-project) Project [mnist1-151907] does not exist,
or you do not have permission to access it.
I'm running this command on Google Cloud's Ubuntu 16.04 virtual machine created under my projectID mnist1-151907 and I've given this machine access to all of Google Cloud's APIs.
The log ~/.config/gcloud/logs/2016.12.23/13.14.03.742050.log says
... "error": { "code": 403,
"message": Google Cloud Resource Manager API has not been used in project mnist1-151907 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=mnist1-151907 ...
I followed the log's instructions and the API is enabled, but I'm still getting the same error. Has anyone experienced this error or can offer a suggestion? Thank you.
I was receiving the same error after enabling the API. I had to play a little re-authenticating with the project the gcloud tool. i.e. gcloud init, gcloud auth revoke and gcloud auth login