Skip to content
Back

[Closed] Python Function not working

  • 0
  • Resolved
  • 3
  • Self Hosted
  • Functions
whiskeycron
6 Feb, 2026, 13:25

I am getting this issue as well. Doesnt look like there was a solution as you guys were not able to replicate. Below is my code as well as the error.

I started trying to get it to work on Self-Hosted version 1.8.0 and I just upgraded to 1.8.1 and am having the same issue Python 3.12 (yes its include in my server env variables) I just have "appwrite" in my requirements.txt

My env variables are in the function and are all set properly. When I ran this with a test file and using a venv, I was able to update the row successfully. Just doesn't work in functions

TL;DR
The issue with the Python function not working was due to missing row data and permissions when trying to update a row. The problem was resolved by ensuring the correct endpoint address was used. The thread has been marked as closed.
whiskeycron
6 Feb, 2026, 13:28

I have the following code in here as I was seeing if key in the headers or an API key from the dashboard would make a difference

key = context.req.headers["x-appwrite-key"] context.log(f"|DEBUG| Key: {key}")

whiskeycron
6 Feb, 2026, 13:29

Error Traceback (most recent call last): File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/client.py", line 117, in call response.raise_for_status() File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/requests/models.py", line 1026, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: <Hidden by OP>

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/server/src/server.py", line 107, in action output = await asyncio.wait_for(execute(context), timeout=safeTimeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/usr/local/server/src/server.py", line 100, in execute output = userModule.main(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/server/src/function/src/main.py", line 92, in main tablesDB.update_row( File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/services/tables_db.py", line 2934, in update_row return self.client.call('patch', api_path, { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/client.py", line 137, in call raise AppwriteException(response.json()['message'], response.status_code, response.json().get('type'), response.text) appwrite.exception.AppwriteException: The row data and permissions are missing. You must provide either row data or permissions to be updated.

whiskeycron
6 Feb, 2026, 13:30

Log

whiskeycron
6 Feb, 2026, 13:34

Python Function not working

6 Feb, 2026, 14:42

even tried adding 'permissions = [Permission.read(Role.any())]' to the update_row function. More verbose log available if needed

7 Feb, 2026, 15:57

Can I get to see the logs

7 Feb, 2026, 15:58

I am working if I can replicate the issue that you are getting on updation query

7 Feb, 2026, 15:58

<@258368010933239822>

8 Feb, 2026, 03:48

Can you try querying with your function API key instead of x-appwrite-keywhile initializing the client?

8 Feb, 2026, 04:36

Is there a specific log output you are looking for? I have given what I know to give.

8 Feb, 2026, 04:37

I have tried this with both the x-appwrite-key and by putting an API key in the env variables of the function and pulling that

9 Feb, 2026, 03:37

As per your logs ('boardId': {'boardName': 'Inversion Tester', 'boardAngle': 30, 'boardType': 'home', 'boardRules': None, 'communityGrading': True, '$id': '697282f0b45cd8950f20', '$sequence': 16, '$createdAt': '2026-01-22T20:06:38.388+00:00', '$updatedAt': '2026-01-23T21:03:38.443+00:00', '$permissions': ['read("user:697009b609618d06d61f")', 'update("user:697009b609618d06d61f")', 'delete("user:697009b609618d06d61f")'], '$databaseId': '690acc180012566b56c2', '$tableId': 'boards'}), the boardId seems to be a dictionary and you're passing it to the row_id as value here:

TypeScript
board = tablesDB.get_row(
    database_id=databaseId,
    table_id=boardsTable,
    row_id=boardId
)
9 Feb, 2026, 03:38

It is supposed to be a string, right? So why don't you try doing something like this: boardId = climb['boardId']['$id']

9 Feb, 2026, 03:38

And then pass it to the row_id as value

11 Feb, 2026, 19:06

I realized my files are older versions and will provide updated ones.

My issue is not associated with the get_row function youve listed. Its with the update_row function at the end.

11 Feb, 2026, 19:12
11 Feb, 2026, 19:14
11 Feb, 2026, 19:14

Here is my most recent main.py and log file. Apologies for the confusion

11 Feb, 2026, 19:19

And the most recent error

Traceback (most recent call last): File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/client.py", line 117, in call response.raise_for_status() File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/requests/models.py", line 1026, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://appwrite.inversionclimbing.com/v1/tablesdb/690acc180012566b56c2/tables/climbs/rows/697284d1dcfc18d96aae

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/server/src/server.py", line 148, in action output = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/usr/local/server/src/server.py", line 143, in execute return userModule.main(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/server/src/function/src/main.py", line 94, in main results = tablesDB.update_row( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/services/tables_db.py", line 3406, in update_row return self.client.call('patch', api_path, { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/client.py", line 137, in call raise AppwriteException(response.json()['message'], response.status_code, response.json().get('type'), response.text) appwrite.exception.AppwriteException: The row data and permissions are missing. You must provide either row data or permissions to be updated.

11 Feb, 2026, 19:23

The permission in the most recent update_row function may be wrong, but ive been trying everything with those two parameters to see if anything changes in my error

1
27 Feb, 2026, 14:13

im not sure why, but when I put my endpoint address in the main.py instead of pulling from the env variables in the function, this function started working. I found in another function I was making with dart, that the endpoint address was coming in as http://... instead of https://... even though my env variable was set as https://....

This can be closed

28 Feb, 2026, 03:09

Ok then mark it as closed by adding [Closed] before your post title

28 Feb, 2026, 03:18

[Closed] Python Function not working

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