Skip to content
Back

tablesDB.updateRow() properly updates column but returns 401

  • 0
  • Self Hosted
  • Databases
  • Web
VinLudens
25 Feb, 2026, 15:24

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)

TypeScript
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.

TL;DR
The developer is encountering a 401 error when using `tablesDB.updateRow()`, despite having correct permissions. The error message suggests lack of authorization, but the update is successful. They shared a workaround involving error handling to verify successful updates. Investigation into the root cause is pending. The mentioned setup is on a self-hosted instance version 1.8.1.
Steven
25 Feb, 2026, 15:34

Do you have relationships in your table?

VinLudens
25 Feb, 2026, 15:35

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.

VinLudens
25 Feb, 2026, 15:36

But worth mentioning, the update I perform is not on a relationship column

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more