Wolfbergen
Wolfbergen3d ago

permission denied for function seq_nextval (SQLSTATE 42501)" projection=projections.notifications

Hi, My instance can't send notifications on password reset or on email verification. I have this error :
level=error msg="statement execution failed" caller="/home/runner/work/zitadel/zitadel/internal/eventstore/handler/v2/handler.go:673" error="ERROR: permission denied for function seq_nextval (SQLSTATE 42501)" projection=projections.notifications
level=info msg="process events failed" caller="/home/runner/work/zitadel/zitadel/internal/eventstore/handler/v2/handler.go:436" error="statement failed: ERROR: permission denied for function seq_nextval (SQLSTATE 42501)" projection=projections.notifications
level=error msg="statement execution failed" caller="/home/runner/work/zitadel/zitadel/internal/eventstore/handler/v2/handler.go:673" error="ERROR: permission denied for function seq_nextval (SQLSTATE 42501)" projection=projections.notifications
level=info msg="process events failed" caller="/home/runner/work/zitadel/zitadel/internal/eventstore/handler/v2/handler.go:436" error="statement failed: ERROR: permission denied for function seq_nextval (SQLSTATE 42501)" projection=projections.notifications
I have grant all on sequences to my zitadel user (he's also the owner of the sequences). After some research, I saw an error in postgresql logs before the permission denied :
ERROR: could not obtain lock on row in relation "current_states"
CONTEXT: unnamed portal with parameters: $1 = '217***', $2 = 'projections.notifications'
ERROR: could not obtain lock on row in relation "current_states"
CONTEXT: unnamed portal with parameters: $1 = '217***', $2 = 'projections.notifications'
My instance is self-hosted on the latest version 3.2.2. I'll appreciate if someone have an idea on how to fix this. Thanks !
1 Reply
Wolfbergen
WolfbergenOP2d ago
I granted superuser access to my zitadel user so that he could use the NEXTVAL function. I will continue to debug this, as I am not happy with the idea of an app user being a superuser on a database. I'm sorry bacause it's most likely a postgre question than a zitadel question, and I saw in projections.failed_events that the error occurs since our migration from cockroach.

Did you find this page helpful?