I did not thoroughly investigate, but the issue does not seem to stem from actual permission errors (despite the error message). My tables have table-level permissions set to create("users/verified"), with row-level security enabled. The rows in question also have read, write, update permissions for my user. There is a 2-way-relationship column, but the row on both ends of the relationship indeed have permissions for my user.
The 401 response message I see upon tablesDB.updateRow(...) is the following: The current user is not authorized to perform the requested action. But I can clearly see that the update is reflected in the row, despite the error indicating otherwise. Maybe it is not the actual update the fails, but another tangent operation that is triggered by the update, the error message from appwrite is not conclusive here.
I have implemented the following workaround to check for this (what seems to be a) false-positive, but it is definitely a band aid: (pseudo code)
try {
await tablesDB.updateRow({..., data: {my_column: content}})
} catch (error) {
if (error instanceof AppwriteException && error.code === 401) {
const verify = await tablesDB.getRow({..., queries: [Query.select(["my_column"])])
if (verify["my_column"] === content) {
// The intended update worked, despite 401 error response
} else {
throw error // A genuine error
}
} else {
throw error // A genuine error
}
}
As I said, I did not have time to thoroughly investigate this issue to find a minimum example to reproduce this, but I still thought I would share it here, in case you would know what to investigate! We are on a self-hosted instance version 1.8.1.
Do you have relationships in your table?
Yes, there is at least 1 relationship in the table
There is a 2-way-relationship column, but the row on both ends of the relationship indeed have permissions for my user.
But worth mentioning, the update I perform is not on a relationship column
Recommended threads
- Selfhost - Starting Docker containers fa...
I am stuck at installing appwrite. Specifically, the containers dont want to start up. The images are downloaded and ready. Dockhand is reporting containers st...
- It says domain already used but I have d...
I accidentally deleted the project in which I used my domain originally (orexia.app) from name.com. Now I am trying to add it to a different project and it says...
- Is this normal in the self host custom d...
when i try to add custom domain to the project did not see this in 1.8.0 ok when pressed the retry it says "DNS verification failed with resolver 8.8.8.8. Domai...