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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...