I add context.log(context.req.url) , and I get this url: http://65347da628372:3000/ I don't think this is a valid url It was working fine until 1.4.5 without any code changes, but after 1.4.6 this problem appeared
Hi,
I am also facing the same issue. If we set async false then its working perfectly, but setting the async to true makes the body empty.
Please lemme know if you find any solution 🙂
Same problem here. This issue, coupled with @Meldiron's update to disallow synchronous functions from running any longer than 30 seconds (as of 1.4.6), creates a pretty problematic double-whammy when you're making lengthy LLM calls 😬
thanks everyone for chiming in! 🙏🏼
What runtimes are y'all using?
node 18.0 for me
anyone able to create an issue for this?
Hey there 👋 How are you executing your function? Are you self-hosting, or using Appwrite Cloud?
Hello 👋 The hard-stop was added to executions over proxy (over function domain) in order to prevent API contaienrs rom getting frozen, considering they are thread-worker-style, not coroutine-style.
What is your use-case for long-running functions executed over custom domain? Would it be viable to create them as async executions instead?
I am using Appwrite Cloud. I am calling execution of another function in an scheduled execution function with the following code:
function.create_execution(
rss_action_function,
path="/auto_update",
method="POST",
body=json.dumps({"o_docs": o_docs["documents"], "force":force}),
xasync=True
)
Also, I'm calling function on the front-end:
async function start_translate(payload,translation_process,translation_update) {
functions.createExecution(Appwrite_Function, JSON.stringify(payload),true)
.then(res => {
//console.log(res);
if (res.status != 'failed') {
translation_update.innerHTML += ' ✔';
}else{
translation_update.innerHTML += ' ✘';
console.error(res);
}
translation_process.style.display = 'none';
});
}
Seems like 65347da628372 could be hostname of container created for your function, and port 3000 being internal port for it's HTTP server.
Considering you dont provide custom host header, it's likely auto-filling it with closest it can guess from network request.
What behaviour would you expect for context.req.host?
Same problrm with me too
context.req.body context.req.body_raw are empty if I set async true
I just want get the body when async is true. So I need manual set the host in the header, right?
Does not work already checked that
My solution now is: don't use async, then narrow down the data that needs to be processed and make sure it's done in 30 seconds or less!
However, this can lead to a large increase in the number of request function executions
Oooh I missed the title. Yes, there seems to be something wrong with body for async executions. We are working on a fix.
cc @Shimon
@here, we've pushed a fix to cloud so this should be fixed now
It's working now. Thanks
[SOLVED] context.req.body is empty if set xasync=True
Recommended threads
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Create a new paid tier
Current pricing seems reasonable enough about what is someone getting for 25$. But for some people most of these resouces are getting wasted. Like the bandwidt...
- [Bug] Appwrite Auth User Prefs
User prefs are decoded as blank although there are plenty of data and add preference button not working in this case