First test-deployment using nomad: cannot login (using loginv2)
I made an initial deployment of Zitadel in a nomad cluster. After first start I saved the 2
.pat
file's contents to vault
, and render them back to ZITADEL_SERVICE_USER_TOKEN_FILE=/local/login-client.vault.pat
for both the login and main container. When I try to login, I get in the main container:
and in the login
container:
Any ideas what to check next?7 Replies
Hi @ppenguin, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
I wasn't able to find a direct answer to your specific Nomad deployment issue with PAT files and token validation errors, here are some relevant sources:
1. Configure personal access token authentication for service users : This covers how PATs work in ZITADEL and mentions that PATs are ready-to-use tokens that can be added as Authorization headers.
2. Authenticate service users and client applications : This explains the different authentication methods for service users, including PATs, and notes that PATs have limitations around centralized validation and potential leakage risks.
The token parsing errors you're seeing ("token contains an invalid number of segments") suggest the PAT content may have been corrupted during the vault storage/retrieval process. You might want to verify the PAT content integrity and check if there are any encoding issues when transferring between vault and the containers.
Would you like me to provide general guidance on troubleshooting token authentication issues, or would you prefer to click the "Ask for help" button to have a team member review your specific Nomad configuration?
Feel free to tag @Ask Inkeep with additional questions.
Got it. Tagging @Rajat for additional help.
I verified that the
.pat
contents was the same as the one generated with first instance. So it's no "corruption" issue.
If I do a clean-slate deploy and with the LOGINV2
URLs all with IP:port of the login service (which is the exposed address, i.e. the LAN address of the host running the containers), I get a login prompt but when I enter the admin user (from ZITADEL_FIRSTINSTANCE_ORG_HUMAN_USERNAME
) and verified I by checking the database, I get Could not get the context of the user.
and the corresponding password is not accepted.
Edit: the IP was a red herring, I got to the same point now with the local (lan) host name (fyi !=localhost
). But still not able to login with the first ORG_HUMAN
user.hey @ppenguin welcome to the server and thanks for your question, looking into it
Just for clarity: the last status (with login impossible) does not have the Token.Invalid issue anymore; the only thing I see in
zitadel-login
logs is
@Rajat interesting: running zitadel:v3.4.0
container with zitadel-login:v4.0.3
with the same config settings works! (Or at least I can login, haven't tested advanced management yet).
Curios what (regression?) might be the reason?I can check with my team, but keep using v4 as we'd soon update our cloud offering to v4 too, I will check with my team as to what could be the reason(maybe a bug that got fixed in later releases)
Thanks! Just to make clear: the working version is v3.4.0, the non-working is
4.x
. So my goal is to make 4.x
work. (I'm only using zitadel-login
v4 for both cases, since there is no loginv2 for 3.x)
Additional (related) issue: Even though I set the env vars to use loginv2
it was porbably just disregarded in the main v3.4.0
container? So after I got reverse proxy working and started using it, I noticed that I had no MFA login options per default. It worked by sending an invite to register MFA to a user, but now trying to get the same user to login from another device resulted in "no passkey available".
Then I tried ticking the box at "Use new login interface" as admin user, but that seems to now have locked me out completely. (Could've thought of that before🤦‍♂️ ). I think I'll have to untick that box directly in the database? Which table?
EDIT: I found how to revert (but still want loginv2 on the long term): UPDATE projections.apps7_oidc_configs SET login_version=1 WHERE login_version=2;
hey @ppenguin I read the thread, what I understood from this is that right now, still, the
v4.x
still doesnt work for you BUT v3.4.0
works AND earlier token/PAT errors are gone, yes?