I have a very weird error;
In a function I'm using dynamic keys to perform read write operation in rows. I have the scopes for read and write rows.
The function perform successfully listRows at the beginning of the function, but later in the code I have a table holidays with a date and description fields
The previous read are nothing special and it doesn't too much time to read information
Without any permission in the table I get this error
appwrite | [Error]Line: 6732
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/tablesdb/:databaseId/tables/:tableId/rows
appwrite | [Error] Type: Utopia\Database\Exception\Authorization
appwrite | [Error] Message: No permissions provided for action 'read'
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
If in the table I add users:read I got this error:
appwrite | [Error] Line: 6732
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/tablesdb/:databaseId/tables/:tableId/rows
appwrite | [Error] Type: Utopia\Database\Exception\Authorization
appwrite | [Error] Message: Missing "read" permission for role "users". Only "["any","guests"]" scopes are allowed and "["users"]" was given.
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
If I add any:read
appwrite | [Error] Line: 184
appwrite | [Error] Method: POST
appwrite | [Error] URL: /v1/tablesdb/:databaseId/tables/:tableId/rows
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: The current user or API key does not have the required scopes to access the requested resource.
appwrite | [Error] File: /usr/src/code/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php
I'm out of ideas to debug this error
I'm using:
Appwrite: 1.8.0 node-appwrite: 20.3.0
What if you use the older collection API/methods
I just checked and it seems to be the problem, doing the request with the new API method, I got the error but with the older one, It runs without problem
We had a bug where the Console wasn't registering the new scopes so maybe that's the issue.
I just released 1.8.1. maybe you can try that. It requires a migration though
I've upgraded (everything ok with upgrade+migrations)
But I keep with the problem, the bug was to solve the scopes in the function?
If the old API work shouldn't be the console problem right?
Maybe update the scopes in the settings
it seems to be like a problem with dynamic keys, as the few minutes (maybe 1 or 2) after deployment the function runs without problem
I did it, I have added all database scopes
The docker logs keep showing:
appwrite | Line: 34
appwrite | [Error] Timestamp: 2025-12-24T00:05:00+00:00
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/tablesdb/:databaseId/tables/:tableId/rows
appwrite | [Error] Type: Utopia\Database\Exception\Authorization
appwrite | [Error] Message: No permissions provided for action 'read'
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
You removed, saved, added, and saved again?
Yes, more than once.
Clear cache, removed all scopes, saved, Added all, saved
But if it's realated to the console bug, it should always fail right?
but if you use the collection API it always works?
Yes, now I have two request in the function, one with the classic and one with the new one. At the beginning, both works and a few minutes later, the classic keep working and the new one gives me the error AppwriteException: The current user is not authorized to perform the requested action.
To resume better the issue:
I have added the classic call and the new API call
databases.listDocumentsdatabases.listRows- I'm using dynamic keys
- A few minutes after deploy, the function works without problem
- After 3 or 4 minutes it starts to show the error
AppwriteException: The current user is not authorized to perform the requested action( in the function)No permissions provided for action 'read'(in the backend)
But databases.listDocuments never throws an error, I always see
{"total":0,"documents":[]}}
I have log the key and it always gets a new one, so the problem must be listRows
I've tried to replicate this bug on cloud, but it seems to work without problem, the only difference is, I'm using bun on self-host and node in cloud, I don't think that matter though
Heyy <@365301924607557634> π Let's get to the bottom of this.
First let me ping <@452316113016193024>. TLDR; Seems we got some issue with authorization, but weirdly it works with listDocuments no issue, but doesnt work well with listRows (in edge cases). Any idea what might be the bug, based on that difference?
<@365301924607557634> In the meantime, I will debug from my end regarding dynamic keys and Function executions, but first, I will need to reproduce it. Is it something that happens consistently for you in a specific setup? If we reproduce the issue locally, that would instantly mean a fix for us.
Thanks for you answer <@287294735054274560>
I was trying to isolate the issue and reproduce it, and I have discovered what was the problem, and it's not appwrite fault.
I've my own version of this: https://www.youtube.com/watch?v=1ip2aljprvg&t=6s
I have created a package that allows me use the syntax proposed in that video. The package handles de initialization, for CSR and SSR, and here was the problem. In SSR, it uses a global instance of the client and that instance wasn't updating the dynamic key. I have push a fix to update the api key each time the function is called and it have solved the issue.
I'm sorry for took your time π
Thanks again <@287294735054274560> and <@462046107556511744>
[SOLVED] No permissions provided for action 'read'
Recommended threads
- Function global variables
when i create a top-level global variable in go or bun how will it behave? is the heap getting renewed on every execution or could i do some kind of temp. cachi...
- sh: vite: Permission denied
When installing the vue starter template as site and then adding DaisyUI, i get the error `sh: vite: Permission denied`. I also got this issue (with a fresh tem...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.