CLI Error: `Failed to authenticate to the registry`

I’m not able to deploy my job since it fails to authenticate to registry when I login for astronomer cloud. I have pasted the error message below.

" sudo astro auth login astronomer.cloud
[sudo] password for pavithra:
CLUSTER WORKSPACE
astronomer.cloud 7bee299b-9745-4714-a197-0a0fd56e72eb

Switched cluster
Username (leave blank for oAuth): pudayakumar@sphaeric.ai
Password:
unknown flag: --password-stdin
See ‘docker login --help’.
Failed to authenticate to the registry, this can occur when registry is offline. Until authenticated you will not be able to push new images to your Airflow clusters"

I have tried with and without sudo and the error is same. Any help is much appreciated.
Thanks!

1 Like

Do you have Docker running on your machine?

Docker is currently a requirement to running the Astro CLI. There’s good error handling for users who don’t have Docker running locally but not good error handling on $ astro auth login. This is something we’re committed to fixing in Astronomer v0.22.

If this issue persists once you’ve made sure Docker is running, read the posts below for other potential sources to this issue or reach out to us.

This is caused by docker credentials being mismatched somewhere along the deploy process.

Few things to try:

  • Verify that there is a .docker file in your home directory, and a config.json is generated
  • Try logging out of docker and trying it
  • Try to docker auth

You might want to consider reinstalling docker

1 Like

Quick update in here: It looks like updating Docker (even over re-installing it) does the trick for anyone having this issue. We recommend running Docker v18.0.0 or higher.

I have the same issue and reinstalling Docker didn’t do the trick.

I have Docker 19.03.8 installed on Win 10. Any other potential solution?
Also, when I run docker auth, it fails as it is not a docker command. docker login works without issues.

Edit: I might add that I have to use oauth since I login with my google account, does that make a difference?

Edit2: Also, commands astro workspace list, astro workspace switch ... and astro deployment list work fine. When I then astro deploy, it say

Error: command ‘docker push registry.gcp0001.us-east4.astronomer.io/empty-solstice-5483/airflow:deploy-1’ failed: unauthorized: No authorization credentials specified

Edit3: I tried the trial with a user+pass combination and it gives me the same error, so it’s probably not related to oauth

Edit 4: I might also add that I get this message after running astro login gcp0001.us-east4.astronomer.io:

Default “…” (…) workspace found, setting default workspace.
Failed to authenticate to the registry, this can occur when registry is offline. Until authenticated you will not be able to push new images to your Airflow clusters

Hi @bijansoltani! This actually might be a known bug in our most recent release of the Astronomer CLI (v0.13). Can you try downgrading to v0.12 of the CLI by running this command?

curl -ssl https://install.astronomer.io | sudo bash -s -- v0.12.0

Once you have that installed, try authenticating + deploying the same way you were trying to do so earlier - you should be able to without a problem.

Apologies for the inconvenience here! Let us know.

1 Like

Worked, thanks! (Except that I had to download the Win10 Client from Github instead of using the curl command)

1 Like

@paola this still appears to be an issue in v0.20.0. Is the bug being tracked somewhere we can see to know when it gets fixed?

Hi @sean-rose! Thanks for reaching out and sorry to hear that you’re running into this. Can you double check a few things for me?

  1. Do you have Docker running? This same error can render if your Docker Daemon is not running at the time that you attempt to log in via the CLI.
  2. Can you confirm you have v0.20 of the CLI installed? You should be able to run $ astro version to check.

We do have a ticket with our engineering team to improve error handling for users if Docker isn’t running on $ astro auth login, so that should help if that ends up being the issue here. Let me know!

I can confirm that this happened to me when I didn’t have Docker running the first time I authenticated. Starting up Docker and re-running astro auth login did the trick.

1 Like

Hey @paola, this issue is currently reproducing for me in Windows 10 and macOS 10.15.6 (zsh in both cases) with Docker running, and with CLI v0.20.0 installed. Here’s the error I’m seeing on astro auth login:

Failed to authenticate to the registry, this can occur when registry is offline. Until authenticated you will not be able to push new images to your Airflow clusters

I haven’t installed a new Docker build since my last successful deployment, and the same error reproduced both before and after installing the latest CLI version.

@cdove Can you reach out to our support team at support.astronomer.io? We’ll take a look and post back a resolution here for anyone following.

Note: We just had a short 30 mins incident about an hour ago with our registry on Astronomer Cloud. If that’s when you were authenticating and that’s the only time it happened, try again and reach out if the issue persists.

Once again, better error handling on this is coming :smile:

i am trying to setup by following this https://www.astronomer.io/docs/cloud/stable/get-started/quickstart/
while i am trying to run the command astro dev start facing issue: Env file “.env” found. Loading…
buildkit not supported by daemon
Error: command 'docker build -t airflow-astro_bcb837/airflow:latest failed: failed to execute cmd: exit status 1

Hi @nithishkumar! Sorry to hear you ran into that. Can you check out our forum post on that particular error and see if that does it? You can find it here: 'buildkit not supported by daemon Error: command 'docker build -t airflow-astro_bcb837/airflow:latest failed: failed to execute cmd: exit status 1

If you still see issues, add a comment to that post directly or reach out to support.astronomer.io.

I am having this same issue. Docker is running and am able to start the Astronomer container from astro. I have uninstalled and reinstalled Docker. I have downgraded to version 0.12 if the CLI (did not work). I have reinstalled the latest version of the CLI. I have tried authenticating with my user/pass and with OAuth.
Configuration:
Windows 10, build: 19042.746
WSL: Ubuntu 18.04
Docker: 20.10.2
Astro CLI: 0.23.2

@dmouriz I’m sorry to hear you ran into this! If you’re an Astronomer customer, can you reach out to Astronomer Support?

I’ve been seeing a few issues related to Windows 10, so I’m going to go back to my team and investigate what the problem might be. Here’s another Windows-related forum post re: our CLI, in case it helps: https://forum.astronomer.io/t/unable-to-successfully-run-astro-in-windows-10-cli/

Either way, I’ll post back here with an update as soon as I have one.

I was able to work around the issue by installing the Windows version of the CLI. I used it to establish my credentials. Now the WSL version of the CLI is working.

Incase it helps anyone I ran into this today. Seemed like using GitHub - abiosoft/colima: Container runtimes on macOS (and Linux) with minimal setup was the issue. I switched back to Docker for Mac and auth works as expected.

I didn’t see any way to get debug logs, but if you want me to gather those I can.