Web Developer
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:
try:# first we need to grab environment variables and initialize our appwrite clientinitialize_variables(context)# ... boring logic here ... ## and here is my main problemout = "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.