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
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...