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
- Firebase app import
I'm **very** new to appwrite and I just set up appwrite with docker and I'm trying to import a Firebase app I have set up but it's erroring and I don't really k...
- Console infinite loading behind NginxPro...
Hi All, I am trying to get AppWrite to work behind NPM. I've followed the Medium guide to set proper headers, I've added my proxy configuration to NPM, and I ...
- Hi, I'm getting this error while deployi...
✗ Error • search (6937cb70002c2e9c1a97) • Fai ✗ Error: Deployment of search has failed. Check at https://cloud.appwrite.io/console/project-693...