Permission denied to set role "windmill_admin" on Postgres without superuser
I'm running into issues on an self-hosted instance. I did read the self-host part of the docs regarding Postgres usage without superuser. I'm running Windmill (CE v1.441.2) on Kubernetes and Postgres 17.2 in a cluster provided by Crunchy Postgres Operator.
What I did:
- Created a database
windmill
and a user windmill
which owns the database and applied https://raw.githubusercontent.com/windmill-labs/windmill/main/init-db-as-superuser.sql as a superuser.
- Granted windmill_user
and windmill_admin
to windmill
role.
- Granted usage on public
to windmill_user
and windmill_admin
in the windmill
database.
I also tried to GRANT ALL PRIVILEGES ON DATABASE windmill TO windmill_user
using connections through pgBouncer and primary only (with restart of all components).
App logs when trying to activate "List all workspaces as superadmin":
Appreciate any help.10 Replies
The user you're using for windmill doesn't have right to set its role to windmill_admin
According the the
\drg
from above is seems it does:
You should try setting the role in a session to test
I did and it seems fine using psql:
Then the only possibility is thats not the user you've configured in the database url
Because set role is exactly what it does
Yes, that's the strange part of that, I can verify in every container that the URL is correct:
or without pgBouncer
Don't use pg bouncer
I did test both cases, I'm aware that it will block superuser
I would recommend using a simpler setup and then figuring out when the issue starts appearing but we never see such issue in prod for any of our customers and what windmill does is literally just set role with the v database url provided
On EE you can do a live call with one member of our team to help troubleshoot
Unfortunately it's a homelab cluster, so there's no EE budget 😉 But thank you for having a look. I'll see what I can do to find out what's going on.
Found the culprit. I guess it's a case of "it's been a long day for layer 8" 😁 if you look at the URL I posted above closely, you'll see a completely different username and database. I copy-pasted the reference for this secret from another service, so a wrong service URL has been pulled from the secret store.