not logged in
A luna command stops with exit code 3 because this machine has no login and no token was given.
A luna command stops before it reaches Luna, because it has nothing to act as. This happens on a new machine and in CI.
Issue
The command prints this and exits with code 3.
error: not logged in
Run `luna login` (`luna signup` makes an account first), pass --token, or set LUNA_TOKEN.
Cause
Each command that talks to Luna needs a credential. It looks in this order:
- The
--tokenflag. - The
LUNA_TOKENenvironment variable. - The login saved on this machine by
luna loginorluna signup.
None of the three was there. A script or a CI job has no saved login, so it needs a token.
A login or token that Luna no longer accepts fails a little differently. Luna answers 401, and the command adds this line under Luna’s message. It also exits with code 3.
Log in again with `luna login`, or pass --token.
Solution
On your own machine, log in. luna login opens the approval page in your browser and waits for you there.
luna login
Run luna signup instead if you have no account yet. On a machine without a browser, add --no-browser and open the address it prints elsewhere.
In CI or a script, make an API token with the scopes the job needs, and set it as LUNA_TOKEN.
Automate with API tokens shows how to make one, and Deploy from CI shows a whole workflow.