Skip to content
Back

Python function - error while creating / updating row

  • 0
  • Databases
  • Functions
  • Self Hosted
MrT
13 Feb, 2026, 12:27

I have been trying to figure it out myself for the last 2 days. I have self-hosted appwrite instance, and I am running python 3.12 function. It works great up to the point where I am trying to update or create rows in my database. This is my code:

TypeScript
try:
# first we need to grab environment variables and initialize our appwrite client
initialize_variables(context)
# ... boring logic here ... #
# and here is my main problem
out = "NULL"
try:
  out = tablesDb.create_row(
    database_id=dbId,
    table_id="transform_data",
    row_id=ID.unique(),
    data={
        "data": fft_results,
        "file": fileId
    }
  )
  context.log(f"Created transform data row")
except AppwriteException as ae:
  context.error(f"Error creating transform data row: {str(ae)}")
  return context.res.json(f"{out}", 500)

try:
  res = tablesDb.update_row(
    database_id=dbId,
    table_id="files",
    row_id=fileId,
    data={
        "is_transformed": True
    }
  )
  context.log(f"Updated file row: {json_lib.dumps(res)}")
except AppwriteException as ae:
  context.error(f"Error updating file row: {str(ae)}")
  return context.res.json(out, 500)
except Exception as e:
  context.error(f"Error {str(e)}")
  return context.res.json({"error": str(e)})
return context.res.json(out, 201)

One issue is that update_row() part of my code returns The row data and permissions are missing. You must provide either row data or permissions to be updated. NO MATTER WHAT I DO. I have tried to provide permissions as well (I have row security turned on in each table in my DB) Also I spotted that when I log the 'out' variable I am getting 2 rows that already exists in my "transform_data" table, but it miss the newly created row.
At this point I almost gave up - i have tried to delegate update / create functionality to e.g. separate node function acting like some kind of proxy, but I had other issues with that. I am using appwrite 1.8.1 self-hosted with proxmox and docker.

TL;DR
Developers encountering issues with updating and creating rows in a Python function on a self-hosted Appwrite instance. The `update_row()` function is returning an error message about missing row data and permissions. The issue persists even when providing permissions and logging the `out` variable only shows existing rows, not the newly created one. The developer is feeling stuck after attempting various solutions.
MrT
13 Feb, 2026, 12:30

quick disclaimer: fft_results is an array of float numbers like: [1.1, 0.8]

and I also attach my schema

MrT
13 Feb, 2026, 14:01

If anyone is able to reproduce that or share any tips - I would really appreciate that

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