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
- Realtime api and labels as permission
in my tables i set labels as permission and real-time capabilities stopped working. Before when i was having "any" role everything was working. Note: user have...
- Sveltekit + Bun sites runtime not deploy...
anyone tried deploying sveltekit + bun sites? its building but not running, and the only thing from build console to value is ``` > Using svelte-adapter-bun .s...
- Domain is owned by a different organizat...
I was trying to add a domain to one of my projects however, it keeps giving me the error of Domain is owned by a different organization. I did have a self hoste...