Still, the first log should be recorded, right? "Log started"
Yeap it should but it's probably getting missed out due to some error
Added the catch. still doesn't work. No logs recorded, and no error recorded either.
You should also parse the payload before accessing
Before I do all that, I need to know why the logs doesn't work.
No need to parse payload, or other things. If the logs doesn't work, how do I debug then?
If an exception is thrown, logs may not be captured properly
Logs are a bit patchy at the moment and these are being resolved with the next update to functions. Until then we gotta do some hacking to figure out the issue
I edited the function to only do console.log(), without any import, etc.
The error tabs shows this:
An internal curl error has occurred within the executor! Error Msg: Operation timed out
Do note, that the error above was not thrown in the previous executions.
Are you in Appwrite cloud or running locally?
Locally
Okay can you run docker compose logs openruntimes-executor?
Did you call res.send() or res.json() exactly once before returning?
What exactly was your code?
appwrite-executor | Executing Runtime: 642290b69993a0d3e9bf-6423c9778fe107c36c6d
appwrite-executor | [Error] Type: Exception
appwrite-executor | [Error] Message: An internal curl error has occurred within the executor! Error Msg: Operation timed out
appwrite-executor | [Error] File: /usr/src/code/app/executor.php
appwrite-executor | [Error] Line: 544
how was your function after adding the catch?
What did your function look like when you got this error?
req.payload is a string, I think it should be converted before calling
I had this same problem in the morning
payload A JSON string containing the data when you created the execution.
So, I figure the problem, I have to return the whole promise. Or else, the function just doesn't work.
Modified code:
return database.listDocuments(
'DB_ID',
'COLLECTION_ID'
).then((list) => {
console.log(list.total)
if (list.total > 0) {
const doc = list.documents[0]
res.json(doc)
}
res.send('Not found')
})
Aah gotcha
Recommended threads
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...
- Create admin user?
I'm not really sure how this is supposed to work, I installed Appwrite through docker-compose and set it up. When I launched the app and went into it, I created...