Balena deploy fails with error `unauthorized: authentication required` from the registry service

I followed this official tutorial to set up openBalena.
The only thing I did differently was to include the -c flag to the ./scripts/quickstart command as it was suggested in the official screencast. Everything worked fine and I am able to add apps and devices to the system (this means that balena apps and balena devices commands work flawlessl.

However, when I try to push a new image to the app and execute balena deploy <appName>, I get the following error:

Retrying "registry.balena.mydomain.ee/v2/<token>:latest" after 2.00s (1 of 3) due to: Error: unauthorized: authentication required
Retrying "registry.balena.mydomain.ee/v2/<token>:latest" after 2.80s (2 of 3) due to: Error: unauthorized: authentication required
[Info]    Saving release...
[Error]   Deploy failed
unauthorized: authentication required

How can I fix this issue?
Are there any workarounds?

Hello @eeriksp,

Welcome to the forums! :slight_smile:

Can you please provide more details regarding the following:

  • Which openBalena and balenaCLI versions are you using?
  • Did you login using balena login after running the quickstart script?

Thanks

Hello, @rahul-thakoor,

Thank you for your quick response! :slight_smile:
I am using Balena CLI version 12.26.2 and openBalena version 3.1.0.
I logged in with balena login using the Credentials options.

Is there any other information I could provide?

Hello @eeriksp ,

Something probably went wrong in one of these three steps:

Did you experience any troubles here or saw something out of the ordinary? Have you tried running them again to see if something improves?

Also, are you able to ping your server from your local machine? curl -k https://api.mydomain.com/ping

let us know if it helps, or if you need more info here

regards,

Juan

Juhhu! I finally got it working. :partying_face:
I started from the very beginning with a fresh machine and strictly followed the tutorial. In particular compared to the previous attempt:

  • I did not use the -c flag for ./scripts/quickstart
  • I installed docker.io a shown in the tutorial (previously I used a version of Docker CE which was automatically installed by DigitalOcean)

Thank you for your quick responses! I must say I really love the developer experience of working with Balena (both cloud and open versions). Also, your open-source friendly business model is very inspiring for us and we want to have a similar policy with our own solutions as well.

Hey Eerik

Glad you got it working and thanks for the kind words.

Cheers