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
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}")
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.
Log
Python Function not working
even tried adding 'permissions = [Permission.read(Role.any())]' to the update_row function. More verbose log available if needed
Can I get to see the logs
I am working if I can replicate the issue that you are getting on updation query
<@258368010933239822>
Can you try querying with your function API key instead of x-appwrite-keywhile initializing the client?
Is there a specific log output you are looking for? I have given what I know to give.
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
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:
board = tablesDB.get_row(
database_id=databaseId,
table_id=boardsTable,
row_id=boardId
)
It is supposed to be a string, right? So why don't you try doing something like this: boardId = climb['boardId']['$id']
And then pass it to the row_id as value
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.
Here is my most recent main.py and log file. Apologies for the confusion
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.
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
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
Ok then mark it as closed by adding [Closed] before your post title
[Closed] Python Function not working
Recommended threads
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- local build `composer installer:dev` iss...
setup - dev container (default linux universal) WSL (test with gh codespace too) - php 8.5.7 - all extensions installed - `composer install` fine - `composer...
- Function global variables
when i create a top-level global variable in go or bun how will it behave? is the heap getting renewed on every execution or could i do some kind of temp. cachi...