The function execution failes even though it can be runned properly
- 0
- Databases
- Functions
- Users
- Cloud

I created a function in Python language to create a new user in Appwrite. After i run it in vs code, the new user is created in appwrite.
The problem is when I execute this function, it failes. <:appwritepeepo:902865250427215882>
Does anybody know the solution?
P.S I am using Appwrite Cloud

This is a deployed function? Or you're running it in your local machine?

Yes, this is the deployed function.

👍

For deployed functions you'll need to use Appwrite starter structure. For example: https://github.com/appwrite/functions-starter/blob/main/python-3.8/src/index.py
The reason is that your function should declare a main
function with the same signature in the above example.

If you want the best way to create functions in Appwrite is to user Appwrite cli Like you can see here. https://appwrite.io/docs/functions#gettingStarted

Thank you for your help. I will correct my code

I tried another function to create a document. The new document was created but yet the function execution failed.

What error you getting?

In vs terminal or in appwrite server?

InsecureRequestWarning: Unverified HTTPS request is being made to host 'cloud.appwrite.io'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings

In appwrite there are no errors

In Appwrite server

So this is only in your local machine?

yes

My coworkers are facing the same issue

What happened when you change it to False
?
.set_self_signed(False)

The error about https request won't show anymore

But it keeps failing

Keep failing how? You get any logs?
Can you wrap your code in a try/except
and share the Exception.

Response: Invalid request payload

logs: Failed to parse request payload: Expecting property name enclosed in double quotes: line 2 column 5 (char 6)

Print the payload
, and check that it's a correct JSON
Recommended threads
- archive
Can you active my project please 6644d42c000587fa6a9a
- Requests for listing documents are rando...
Using an iOS app generated with Capacitor, the requests for listing documents are slow in some ocassions. SOmetimes they are very fast, sometimes they are very ...
- Appwrite CLI can't create TABLE"
hello everyone, i'm trying to create tables via the cli but its not working, it keep saying `NO TABLEs FOUND`, here are my json structure **profile.json** ```{...
