
Oh man I have been trying this trick for whole week and it didn't work LOL

LMAO sadddd i'm still trying to think if I missed a step lol

also just to be sure, you are using the appwrite cli right?

yes

As I said, I do all the same steps in cloud.appwrite.com and It works as it should. Only when I try in this self-hosted doesn't work

since you are on self hosted version. What does docker compose logs
say ? after executing the function

I just asked the guy who has access to the server to check and will get back to you as soon he msg back

Can you also check if there's a firewall enabled on the server? If so, try testing with the firewall disabled

Executing Runtime: luna-648d7a3b4bf0c404552c [Error] Type: Exception [Error] Message: An internal curl error has occurred within the executor! Error Msg: Operation timed out [Error] File: /usr/src/code/app/executor.php [Error] Line: 544

They told me that there is no firewall active, and they didn’t change a lot from the standard config.
Also there is a reveres proxy in front of the server for ssl cert.

Other API calls from your client app work right?

If I understood your question correctly, yes for example flutter developers they can access the api calls also if I use postman and make a call directly with endpoints it works but when i deploy the function and execute with php sdk or node sdk i dosent work

Oh right you said postman works

Can you try to wrap your code in a try catch and don't forget to call res->json() in your catch before returning.
Then, increase your function timeout to 5 minutes.
Hopefully, you'll see an error after that

Response: {"message":"Error!","result":[]}

I change the catch Class to Exception
and got this response
{"message":"Error!","result":"Failed to connect to domainoftheerver.eu port 443 after 130149 ms: Couldn't connect to server"}

Awesome! So maybe it's a networking or routing or firewall issue 🧐

Some ways to test and troubleshoot this are to see if a request is success from the server itself and then from the runtime container

Is this normal for example to work for postman calls etc but not for functions calls

not sure tbh, as whenever I got curl errors on function executions, they get fixed after a few trial and errors lmao

Not really. Usually, this is a firewall problem

I'm still having the same problem. I asked the guy and he told me firewall is disabled also he reconfigred the ssl, nowhttp redirects to https.
Also if a make a function that returns for examle string it works fine $res->json("test), but not these others

so how is checking for firewall?

yeah makes sense! I have one question maybe is stupide. When I execute the function who (url ) makes the call to this Database, Is it not the server itself (https:// .../v1)?

It's a container on the server
Recommended threads
- Cannot create a user
Hi, I am using a lowcoder frontend and trying to create a user in Appwrite (python function). Unfortunately, all I got is an error: "Raw body: Error". It means...
- Where is tensorflow support? 3.11 ML doe...
and if i manually tried to add tensorflow i get Cannot access offset of type string on string no matter what
- OAuth2 Error: invalid success param url ...
Hi everyone! I'm trying to implement Google OAuth2 login in a React Native app (using the Android simulator) with Appwrite Cloud, and I'm getting the following ...
