balena push doesn't work from CircleCI

We have a project that’s been using balena cloud for well over a year. In the past pushing from my Mac and from a CircleCI build both worked without issue. However, a few months ago balena push stopped working from CircleCI.

Specifically, the command balena push SHM-Development-Nano works fine when done from my Mac, but the same command from a CircleCI script fails with:

Pushing to: SHM-Development-Nano BalenaApplicationNotFound: Application not found: SHM-Development-Nano

This failure also happens when using the SLUG name instead of the Fleet name.

I suspect this may be access or configuration related, but after tinkering for a few months I am no closer to solving it than I was then. Any thoughts are welcome.

–Kirk Ocke

Hey @kirkocke welcome to the forums. Can I ask how you’re authenticating from CircleCI? If it works fine from your mac but cannot see the same fleet when pushing from Circle, it implies some kind of difference between permissions. If there’s any way to use the same method on your mac or vice versa, you might be able to narrow down where the problem lies.

Hi @chrisys and thanks for the welcome. I agree there seems to be a permissions difference. I am authenticating on both my Mac and CircleCI using the same method:

balena login --credentials --email $BALENA_EMAIL --password $BALENA_PASSWORD

Where the email and password are the same in both cases. I will double check this again to make sure - although it will the tenth time I’ve double checked :wink:

The login works in both cases but the balena push fails on CircleCI.

Is there an alternative way to login that I could try instead? I couldn’t find an alternate approach but very well could have missed it.

I discovered the problem. Our CircleCI environment was using a ‘context’ that contained an outdated user email and password combination. It appears that ‘context’ variable in CircleCI supersede Project level ‘environment variables’. Once I fixed this everything worked fine. Thanks for looking into this and sorry it was my own silly mistake.

–Kirk