Back

[SOLVED] Python function throwing an error

  • 0
  • Functions
ianmont
6 May, 2023, 18:49

I have a function in appwrite made in python and within my python function I want to call another function that I have in my appwrite made in nodejs, however it gives me a strange error that says "{"response":"Error: create( ) missing 1 required positional argument: 'runtime'"}"

maybe my structure of how I execute the function is wrong or what is happening? I attach a photo of my code and how I am trying to execute the function

TL;DR
The user is experiencing an error when trying to call a node.js function within a python function in Appwrite. They are getting a missing positional argument error. The suggested solution is to check the documentation for the correct method to call the function. The console is also returning a "Server Error" message, which may be unrelated to the initial error. The updated code and potential resolution are not provided in the thread. Accessing Docker logs for the Appwrite container on DigitalOcean is mentioned as a way to gather more information.
ianmont
6 May, 2023, 18:52
Drake
6 May, 2023, 19:13

I don't think you're calling the right method. See https://appwrite.io/docs/server/functions?sdk=python-default#functionsCreate

ianmont
6 May, 2023, 19:23

i have updated the structure of my function, however the console returns "Server Error"

ianmont
6 May, 2023, 19:24

For additional information this is my nodejs function info:

ianmont
6 May, 2023, 19:29

I think I'm giving it a solution, I'll let you know in a little if I succeed

Drake
6 May, 2023, 19:31

What is your updated code?

ianmont
6 May, 2023, 19:41

I am attaching a picture of my current code, apparently I was trying to create a new function when what I wanted to do was create an execution of a function that already exists, but even so the problem persists and the console keeps throwing me the "server error" error

ianmont
6 May, 2023, 19:41

The console error:

Drake
6 May, 2023, 19:42

Is a new execution created for the other function? What do the docker logs for the appwrite container say?

ianmont
6 May, 2023, 19:45

no, the function that I am calling is not executed

I have my appwrite hosted on digitalocean, can docker logs be accessed?

Drake
6 May, 2023, 19:46
ianmont
6 May, 2023, 19:50

using docker logs appwrite it shows this:

ianmont
6 May, 2023, 19:52

maybe i need to pass the async prop ?

ianmont
6 May, 2023, 19:58

I attached a picture of how I'm passing the async prop, but the console throws this new error

{"response":"Error: name 'true' is not defined"}

ianmont
6 May, 2023, 19:58
ianmont
6 May, 2023, 19:59

In the documentation I don't see that it asks me for a name value, do I have to pass it to it too or is it an error?

Drake
6 May, 2023, 20:00

Correct... In python, you use True or False

ianmont
6 May, 2023, 20:00

Oh I see, I'll try that

ianmont
6 May, 2023, 20:02

That works, thank you @Steven :appwritecheers:

Drake
6 May, 2023, 20:29

[SOLVED] Python function throwing an error

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