Hi, I’m trying to develop a forge app that requires sending data on the backend (and frontend custom UI page) to my company’s external API, at api.<company site>
and dev.api.<company site>
. This works fine on the frontend since it runs on the local browser and so API requests there can be made just fine. It also works perfectly fine when running the development app through forge tunnel as my own PC can also obviously access those APIs.
However, when I destroy the tunnel and let the Jira server run my apps, I get this error:
This happens for either development (when not running through forge tunnel), staging, or production.
As for the code I’m using to run this request, it’s just simply using the nodeJS fetch API:
// apiUrl is just "dev.api.<company_name>" as I stated above
await fetch(apiUrl + '/jira/monitoring/execute?auth=' + apiKey, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(e.issue)
});
These APIs are publicly accessible on the internet, all my devices can access them no matter where they are. It seems the Jira servers have a DNS issue? I found similar results when searching elsewhere on these forums or online but they mostly seem to be happening when running the app through forge tunnel, for me the problem seems to be the opposite.
Any ideas? This integration would work so well if it wasn’t for this, and it would be really good for our company to have this.
1 Like
Can you share the traceroute to that address? Also, are you trying to access it via https? If so, who signed the https certificate?
1 Like
I’m not sure how to provide a traceroute from wherever the app is being hosted on Atlassian servers. Yes I am accessing it through HTTPS, the SSL certificate is managed by Amazon as that’s where our app is hosted on Amazon ECS.
If you are having DNS issues, then traceroute will not work, so I was recommending doing so from your computer so we could see a successful network path.
At any rate, there should be no DNS issues with an AWS public service that was also signed by an AWS certificate. The forge platform also runs in AWS.
If you are worried about posting sensitive information here then I would recommend raising a developer support ticket.
1 Like
Okay well, if it’s helpful to you, the domains the app isn’t able to reach are dev.api.cytix. io
and api.cytix. io
(I can’t post them without a space before the .io because I have a new account)
Of course my PC can access those domains as shown by how it performs just fine running in a tunnel, but here’s the trace route for dev.api.cytix. io
and api.cytix. io
:
It’s worth noting that while these end in request time outs, the ping command for both also times out for some reason so I don’t think they respond to ping requests… however just simply accesssing them by HTTP request shows that they do respond, as the curl request to api.dev.cytix.io proves.
So maybe the request time out thing is the issue, perhaps Atlassian expects the service to respond to ping requests? But then I also don’t know why I’d be getting this node error and only getting it when not tunneling - because this javascript code seems to work perfectly fine anywhere else, just not in this Atlassian app 
Oh another thing, I did try and use the IP addresses instead of the hostnames (and even added the IPs to the app manifest of allowed external domains), and instead of the DNS error the requests just kept simply timing out, so again might that be related to the traceroute/ping issue? And if so, how might we go about fixing that?
That’s pretty much all the information I can give, I’m as confused as you are by how there could be DNS issues here as we’ve never had this type of issue with any other service.
Hi @AmyRose, can you please try using the fetch client that we provide via @forge/api
(docs)? From your comment it seems like you might be using the one that comes with NodeJS by default.
The issue is that Forge functions run in an isolated network environment and all network requests must be made through HTTPS (our polyfill version) at the moment.
4 Likes
Thanks so much! Exactly what I needed, I had absolutely no idea that Forge came with its own fetch command. It seems to work perfectly now 