Queue authentication suddenly not working?
Hello, hoping someone can help me. I've been using the Queues integration on a project I am developing. My implementation has been working fine for the past couple of weeks, but today, out of nowhere, I am getting this error when trying to write a new item to the queue:
Queue Write Error: permission denied for sequence q_tasks_msg_id_seq
I haven't changed anything in my code, and confirm I am authenticated:
[09/01/2025 @ 17:26:33] · [Supabase] Queue Write Request
[09/01/2025 @ 17:26:33] · [Supabase] Ensure Authenticated...
[09/01/2025 @ 17:26:33] · [Supabase] Auth Error: Auth session missing!
[09/01/2025 @ 17:26:33] · [Supabase] Admin Auth Request
[09/01/2025 @ 17:26:33] · [Supabase] Admin Authenticated
[09/01/2025 @ 17:26:33] · [Supabase] Queue Write: tasks
[09/01/2025 @ 17:26:33] · [Supabase] Queue Write Error: permission denied for sequence q_tasks_msg_id_seq
I also confirm I've made no changes to my account, to RLS, or to the queue settings... it's just stopped working.
Any idea how I can debug this and get back on track? Or perhaps there's a known outage/issue?
30 Replies
permission denied is usually a grant error not RLS, but not wure where your log you show is coming from. Anything in the Postgres logs?
There would not be an outage and I would not think the grants could change unless you upgraded your postgres version. Or some code on your side modified the grants. (Prisma is known for that, but I don't know where that sequence is kept).
Thank you for the quick response! The log is just my node app's log - I was sharing it just to make the point that I do have an authenticated session prior to making the write request.
I'll dig into the actual postgres logs to see if I can reveal something - it's just odd it suddenly stopped working. I haven't, to my knowledge, done anything to change grants/change prisma etc...
The postgres log shows the error, but it's not particularly illuminating - just essentially restates the error.
Hm. Not sure how to proceed.
Can you show it? Just want to make sure it does not say RLS and it might say what schema that sequence is in.
Also do you use Prisma?
I can it just appears too big to paste into discord:
Here's it in a pastebin:
https://pastebin.com/CeSmCWcx
I am using prisma, yes
Pastebin
{ "event_message": "permission denied for sequence q_tasks_msgid...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
But the actual call to write to the queue is not using prisma, just the Supabase client:
const result = await this.client.schema('pgmq_public').rpc('send', { queue_name: queueName, message: msgObject, sleep_seconds: 0 });
Yes but the error is that the user making the call does not have a grant for that sequence.
I see that. But I don't understand why. I'm authing via the client...
What am I missing?
Sorry if I'm being stupid here.
I think your Postgres grants got messed up somehow.
If this was working.
I've not used it the pgmq stuff yet, but know that you are supposed to be able to call from the REST side some functions.
Prisma is known for messing up grants on migrations.
It was working fine, and I haven't made any changes to my supabase setup (that I'm aware of!) today. Hence the confusion.
Mm, it's just I'm not using prisma for the queue stuff. I use it more broadly with my supabase tables, but for the queues I use the client as per the documentation
Did you do a migration right before this broke?
Nope. As I say, I haven't touched my supabase configuration at all. It was working fine this morning, and just suddenly stopped working
You might recheck this: https://supabase.com/blog/supabase-queues#security-and-permissions
There might be better docs somewhere.
I'm also getting funky warnings on the supabase website...

You have lost your grants.
There is a guide to fix them for the public schema and Prisma, but I doubt there is anything on this (if it is even Prisma related).
You probably need to contact support.
Ok. Thank you.
I can see a test queue in the schema with the UI so it is not universal.
I just created a new queue, enabled the same permissions and rls as my old queue. Updated my code to point at the new queue. Works fine.
No idea what's happened to the old one...
Thank you for your help though!
Just keep watch if you do any SQL or Prisma things so if it breaks again you have an idea what is doing it. Hate random glitches.
Yeah agreed. Thankfully I'm just in dev so it's fine randomly breaking, but I'm planning to ship soon. This doesn't fill me with confidence, ha
Postgres does not glitch and drop grants, so something on your side, Prisma, or Supabase utilities did it.
Understood, I meant I am not confident about my own code and abilty 😄
I am getting this error message as well. with this mesage

From that messages seems to have an issue right now.
Also could be the reason for the OP's issue if Supabase is actively changing that functionality with "patches"
My new queue that I created yesterday suddenly broke again today. Again, I've not made any config changes, it just went from working to broken. I really think this is a Supabase issue.
Just adding that my queue has broken too (I can't use the Supabase client to send or pop messages anymore). Once I disabled the PostgREST integration I can't reenable it and looks like there is a bugfix in the works. Luckily I haven't launched my application yet but this would have completely broken it - are Supabase queues really ready for production yet?

Yes it looks like there is some sort of issues has they have disabled the use of queues from REST clients. Might be this grant issue.
is there any workaround to solve this issue, I am not able to work with queues
Same here - the queue system has been breaking in production for us several times now, due to this permission issue. First occurred 3 weeks ago. Since 3 days ago it is occuring every day again. We keep creating new queues which break the next day.
A solution would be highly appreciated.
That is why they have shut it off I'm sure. I assume when they have a fix it that would be enabled.
You can generate an issue in supabase/supabase or contact support.