Hello,
first time ussing appwrite functions and i am doing it in python. For testing i just created a simple function that just returns the request json. I also set that it should trigger when documents are created in a certain collection. The trigger doesn't happen and when i run the function manually i get an internal server error (404 general_route_not_found). Can anyone help?
Hey, Have you set the Endpont, API key and Project id variables in the function setting page in the console?
i set the api key and endpoint, i didnt set the project id because i think i saw somewhere it is included in req? also why would the function crash if i dont have a variable i dont use anyway? Or does appwrite need them when it sets up the function
But you must have project ID for accessing Appwrite Can you share your code?
def main(req, res): return res.json(req.json())
just this right now because i wanted to test the triggers
I don't think that req has json() function.
Try to deploy this
def main(req, res):
return res.json({
'payload': req.payload,
});
okay will try
i get the same error
maybe i forgot to set something up? I am running appwrite in digitalocean droplet if that helps
What version of Appwrite you're using? Where do you get the error
1.3.5
Did the function built successfully?
yes it did
the previous ones also did
I highly suggest using the Appwrite CLI to initialize and deploy your function code so you have a working foundation to build on: https://appwrite.io/docs/functions#gettingStarted
Okay i will try that, but since it is on digitalocean, how can i edit the code?
You will deploy it each time from your local computer
Ah okay thank you
Also a quick question, is it possible to send multiple files to a storage bucket or does each have to be sent separatly
You mean batch upload? If so, you'll no upload one-by-one.
Ah okay thank you
Btw is this what you saw, if so it can be related to that https://github.com/appwrite/appwrite/issues/5623
Recommended threads
- Function executions fail with cURL error...
Appwrite version: 1.8.0 Executor version: 0.11.4 Function runtime: Python 3.12 SELF-HOSTED Function executions that occur at the same moment as the executor's ...
- Broken Appwrite can’t make functions nor...
Hii guys, I was having this issue with my locally hosted Appwrite, I can’t create functions ( both template and manual), I can’t make a custom domain ( like in ...
- Tips for Debugging Appwrite Functions Lo...
Hi everyone! 👋 I have an Appwrite Function running locally with Docker, but I’m struggling to debug it because execution doesn’t reach the breakpoints I set. ...