Skip to content
Back

Python Function not working

  • 0
  • 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
Developers encountered a Python function error with a 400 client error message. The issue arose due to missing row data or permissions for an update request in the code. The provided snippet tries to fetch a key from the headers but does not resolve the problem. The issue persists across server versions 1.8.0 and 1.8.1, and the function works in a test file but fails within functions.
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

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