dex deploy - array items must be unique?
Hi there @Darth-Penguini and friends!
I'm encountering a strange error when attempting to deploy dex, after following instructions here:
https://geek-cookbook.funkypenguin.co.nz/docker-swarm/traefik-forward-auth/dex-static/
Running the following:
docker stack deploy dex -c /var/data/dex/dex.yml
Gives me the following error:
services.whoami.deploy.labels array items[3,9] must be unique
My labels, from /var/data/dex/dex.yml, are as follows (domain.tld being replaced by my actual domain):
I've double checked spelling and searched for hours but I'm stuck and unable to progress past this point. Any help on figuring this out would be greatly appreciated.SSO with traefik forward auth and Dex - Funky Penguin's Geek Cookbook
Traefik forward auth needs an authentication backend, but if you don't want to use a cloud provider, you can setup your own simple OIDC backend, using Dex.
44 Replies
👋 @ryanjolliffe
weird, I sure don't see any duplicate labels there
are you using traefik v2?
I am, yes
It's very strange
so what if you comment out the v1 labels in case?
Then I get:
poorly formatted environment: variable 'DEFAULT_PROVIDER: oidc' contains whitespaces
gah
what does your .env look like?
/var/data/config/traefik-forward-auth/traefik-forward-auth.env is as follows:
Apologies, the formatting is slightly incorrect compared to what I see
The comments (#) are all aligned when viewing in nano
I think your env syntax is wrong
try something like this:
DEFAULT_PROVIDER=oidc
should I do that for all values?
yep
and then you should rightly complain that the docs show it differently
lol I didn't want to say it
Okay, so with v1 still commented out it appears to run:
cool
I shall fix my shoddy docs
Do I need to uncomment the v1 and retry?
no, we don't really need v1 at all anymore
nobody should be using it
Ah okay, I see!
Thank you so much for that, I really appreciate the assistance 🙂
np, thanks for the quality-control check 🙂
fix pushed, new version building now...
Wow, that's awesome
Thank you for the whole guide btw, it's such a good resource
🫶
I'm still very new to docker and swarms in general, but your guide is the best I've found
I'm going to get back to configuring this machine, and hopefully the next time I swing by will be to say it was all a huge success!
Damn, I was really hoping to get further lol
middleware "forward-auth@docker" does not exist
It appears to deploy, but shows an error in the traefik dash and ps shows "invalid mount config for type…" error
I created /var/data/config/traefik-forward-auth/config.ini and chmod'd to 600, which seems to fix the mounting error, but now I get a non-zero
Sorry, distracted with kids and dinner, will circle back in 4h or so 🙂
Hey, any response is above and beyond what I'd hope for - apologies for bothering you!
This is a personal project with no real stakes; I wouldn't want to distract you from your family 🙂
I appreciate all the help already 🙏
mmm, TFA can be a PITA to debug, IIRC it just exists without logging if it's unhappy with your OIDC config
I think there's a way to add debugging, checking...
aah, here it is. Try adding an env var
LOG_LEVEL
to TFA, set to debug
Thank you!
I stopped the stack/services and added that to "/var/data/traefik-forward-auth/traefik-forward-auth.yml", then deployed again
whoops, wrong paste
now you can run
docker service logs traefik-forward-auth
and hopefully see why it's unhappy..."/var/data/config/traefik-forward-auth/traefik-forward-auth.env"
My .env is as follows:
ah, sorry, bad syntax
try
docker service logs traefik-forward-auth_traefik-forward-auth
aha
try moving the comments to the line above/below the env vars, and then making sure each ENV var has no whitespace after it
my CI instance looks like this:
Unfortunately I'm still getting the following:
Though the whoami@docker entry has appeared in HTTP Services (traefik dashboard), but I'm still getting a error in HTTP Routers
it may be that unless it's actually working, traefik won't consider it to be valid
Damn
Is there any way to get more debugging info about what specifically is failing?
what does your env look like now?
and what's the output of
docker service logs traefik-forward-auth_traefik-forward-auth
?.env:
Running the command gives:
interesting
what do you get at
https://dex.domain.tld
?I get a
right
so fix that next 🙂
what does the traefik dashboard say about it?
https://traefik.domain.tld works fine
yeah, but what does it say about dex?
There's no mention of dex at all
mmm
do you have
dex.yml
?Apologies, when the kids call you must obey 😅
/var/data/dex/dex.yml
is as follows:
Hey there!
So I thought I'd managed to avoid this issue by using authelia, and all is working well with that so far.
In trying to deploy Jellyfin, however, I've come across the same error and I can't avoid it this time:
Using the following docker-compose.yml:
With the above, the /config is defined twice causing an error, so removing that fixes
The above gives the following error:
services.jellyfin.deploy.labels array items[0,6] must be unique
This seems to be caused by having twice within the labels section?
However, commenting out one or the other allows the stack to deploy but is unusable and no rules are applied in traefik
I'm stuck at this point, and nothing I can find online explains why I'm encountering this error
Trying to run this via Portainer gives the same error
Does anyone have any idea as to why this is happening, and how to fix it?
Updating the jellyfin docker-compose to the following allows things to run locally, but has no traefik rules?
I can't understand why they wouldn't be applying
If you're deploying into docker-swarm, you need your
lables
to be under the deploy
keyAmazing! That fixed it, thank you for taking a look over this - I really appreciate it.