502 Error in establishing connection issue while using ngrok

I have a third party service accessible from ngrok. My FreshService application’s request methods throw “Error in establishing connection” error with 502 status.

I am running the FreshService app via fdk run command and this problem does not occur when I pack the app and test it as a custom app.

I can assure that the ngrok is not broken and accessible via the same browser window where I have FreshService logged on.

This is how I call the API,

This is the requests.json template,

This is the log trace when I make the request,

2024-10-08 20:19:49.559 +0530 [debug] (e[34mrequest.jse[0m) e[31mMaking request with options as {"method":"GET","url":"https://7591-202-0-112-207.ngrok-free.app/api/1.3/desktop/discover","headers":{"DC-Integ-Param":"Freshservice","User-Agent":"Freshservice"},"body":null,"maxAttempts":1,"retryDelay":0,"timeout":15000,"skipHeaderSanitize":true}e[0m
2024-10-08 20:19:49.566 +0530 [debug] (e[34mrequest.jse[0m) e[31mrequest came back with error as connect EBADF 3.6.98.232:443e[0m

Hey @dhinesh.venkat,
We support context-based substitution for request method invocation only in the installation page. In app.js or any other front-end js the template should use an installation parameter or value defined in config/requests.json.
Read more about template substitution from docs.

Is this in the installation page where the context substitution is failing?

Hi @zach_jones_noel

Thanks for the reply. The request is being made from iparams.html inside the script tag.

I do not think the context substitution is failing. When I check the dev tools, I could see the correct URL formation. This can also be verified from the fdk log trace I shared in the question.

Another strange thing is, when I connect my laptop to mobile hotspot in one of the ISP in India, (Airtel). Everything seems to work. But fails on wi-fi connection.

Let me DM you for some details.

Hi @zach_jones_noel

I have DM’ed you on 9 oct. Have you found anything?

Thanks