forge app external request ends up with 502

Roman Kern January 16, 2025

Hello together,

I'm facing a problem with external API call. It's end up with 502, even the api is available and manifest allows the api call

the code

 

  const response = await api.fetch('https://myapi.com/v1/retrieve',{
    method: 'POST',
    headers: {
      'api-key': `${process.env.auth}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(request)
  });
 
  if(!response.ok){
    console.error(JSON.stringify(response));
    throw new Error(`Error: ${response.status} ${response.statusText} ${await response.text()}`);
  }
Manifest.yml
permissions:
  external:
    fetch:
      backend:
        - 'https://myapi.com'

 

modules:
  jira:issuePanel:
...

 

 

ERROR 10:23:14.409  {"size":0,"timeout":0} --> first line of console.error(JSON..

ERROR 10:23:14.423  Error: Error: 502 Bad Gateway Bad Gateway

 

is that beacause, I'm using url without www?

2 answers

1 accepted

0 votes
Answer accepted
Roman Kern January 21, 2025
0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2025

Hi,

The 502 error indicate an error on the server side. Did you try your API with postman on your local machine ?

Roman Kern January 17, 2025

yes, everything works fine... is their any way to see internal logs, except forge logs/tunnel for the api call?why the external api was blocked, etc?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events