This is a separate database permissions issue in the createsuperuser Job.
Problem
The PostgreSQL user your Django app uses does not have sufficient privileges on the impress_user table (and probably other tables).
The custom createsuperuser command is trying to query UserModel.objects.get(...) but gets blocked by PostgreSQL permissions.
Quick Fix
Run these commands (replace your-db-user with the actual username your app uses, e.g. docs or impress):
-- Connect as a superuser (postgres) to the database
psql -U postgres -d <your-database-name>
-- Grant proper permissions
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO your-db-user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO your-db-user;
GRANT ALL PRIVILEGES ON SCHEMA public TO your-db-user;
-- For future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO your-db-user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO your-db-user;
Better Long-term Solution (Recommended)
The proper way in Kubernetes / production setups is to ensure the database user has the right role at creation time, or run migrations as a more privileged user.
Delete the failed Job (it will be recreated on next deployment usually):
kubectl delete job docs-backend-createsuperuser-1777904379-5xnpbFix the database permissions as above.
Re-deploy or manually run the Job again.
Alternative (if you can exec into a running pod)
kubectl exec -it <docs-backend-pod-name> -- python manage.py createsuperuser
Or create the superuser manually via Django shell.
Would you like me to also give you the recommended PostgreSQL init script / Helm values for this kind of setup (common with Impress / LASuite deployments) so this doesn’t happen again?
Also, did the previous OIDC fix (using the internal keycloak-keycloak.default.svc.cluster.local) work?