Unauthorized error with balena tag command


I’ve been trying to set a tag for my device so I can try how staging-release works, however I’ve run into an BalenaRequestError: Request error: Unauthorized .
I’m successfully logged in with email and password credentials. Tried logging in with a token, to see if there would be any different behaviour, but there’s no change.

Running DEBUG=1 balena tag set TEST --application testApp2 results in:

BalenaRequestError: Request error: Unauthorized
    at C:\snapshot\resin-cli\node_modules\balena-request\build\request.js:197:17
    at tryCatcher (C:\snapshot\resin-cli\node_modules\bluebird\js\release\util.js:16:23)
    at Promise.module.exports.Promise._settlePromiseFromHandler (C:\snapshot\resin-cli\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise.module.exports.Promise._settlePromise (C:\snapshot\resin-cli\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise.module.exports.Promise._settlePromise0 (C:\snapshot\resin-cli\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise.module.exports.Promise._settlePromises (C:\snapshot\resin-cli\node_modules\bluebird\js\release\promise.js:694:18)
    at _drainQueueStep (C:\snapshot\resin-cli\node_modules\bluebird\js\release\async.js:138:12)
    at _drainQueue (C:\snapshot\resin-cli\node_modules\bluebird\js\release\async.js:131:9)
    at Async._drainQueues (C:\snapshot\resin-cli\node_modules\bluebird\js\release\async.js:147:5)
    at Immediate.e.Async.drainQueues (C:\snapshot\resin-cli\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

Any thoughts? It seems strange that I can log in just fine, but receive Unauthorized errors. Unless I’m missing some configuration.



@fruloops I tried your instructions in my own openBalena install and it worked fine; so I don’t think this is an issue in the process, but possibly that your open-balena-api service is old. Could you confirm when you installed this instance of openBalena? I don’t recall the exact timeframe, but there was a time when tags were not supported in openBalena, so I think we should rule this out first.

If you pull in the latest version (v1.0.0) of openBalena and then do a ./scripts/compose pull && ./scripts/compose up -d – this should make sure that your service versions are all matched to our current recommended ones and then you might find that the issue is resolved. If it is not resolved, then we could try and diagnose further.

Let me know how you get on :+1:



Oh my, I feel like an idiot for not thinking of this. Pulled and ran openBalena instance and tags work without an issue now, @richbayliss thanks for the suggestion. I’ll definitely keep better track of new releases from now on.



@fruloops no need to feel bad; last week we made the decision to have the service tags well-defined in the openBalena stack, as a means to to make this kind of issue easier to diagnose/resolve. It seems we were correct in our assessment :grin:

I cannot say today what will warrant of a version uplift in the services, but I am hopeful that we can find a convenient way to let users know that there are some service version changes. In the meantime enjoy using openBalena, and I am glad that you managed to get it working without too much fuss :+1:

1 Like