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 "<token>:latest" after 2.00s (1 of 3) due to: Error: unauthorized: authentication required
Retrying "<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?


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

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



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 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.


@JuanFRidano ,
Is possible to ping registry service as well ?
curl -k
I am able to ping api but not registry.

There is no /ping endpoint on the registry host, you can just try curl -k instead.

@ab77 , Thanks. For - curl -k I can see 200 response in registry logs. Though I don’t see ‘OK’ on client side.

Cool. That’s expected. I see the same result when I query balena-cloud registry.