Forge remote returns invalid response from remote

modules:
  jira:globalPage:
    - key: feature-test-hello-world-page
      resource: main
      resolver:
        endpoint: app-endpoint
      title: feature-test
  endpoint:
    - key: app-endpoint
      remote: backend
      auth:
        appUserToken:
          enabled: true
        appSystemToken:
          enabled: true
remotes:
  - key: backend
    baseUrl: "https://forgedemoapp.graytree-b647eebd.eastus.azurecontainerapps.io"
resources:
  - key: main
    path: static/hello-world/build
    tunnel:
      port: 3000
permissions:
  scopes:
    - read:app-system-token
    - read:app-user-token
app:
  runtime:
    name: nodejs18.x

I trying to make a request to my deployed backend and I keep getting the invalid response error. my backend is a very simple spring boot application with one endpoint “/” that returns a string…

Hi @VictorAmadi ,

As per this page, you may need to add a declaration to your remote that it is making a fetch call and additional permissions to your manifest as follows:

remotes:
  - key: backend
    baseUrl: "https://forgedemoapp.graytreeb647eebd.eastus.azurecontainerapps.io"
    operations:
      - fetch
permissions:
  ...
  external:
    fetch:
      backend:
        - remote-backend
        - 'forgedemoapp.graytree-b647eebd.eastus.azurecontainerapps.io'

If this doesn’t fix it, can you share more of your code and the details of the error.

Dugald

Thank you so much for you feedback. Actually i just realised on my backend end that the headers according to this page are not being passed to my remote backend… I guess that is why my problem lies now

Is the string “remote-backend” built from the “backend” key in the “remotes” array? Or is this pseudocode? I can’t get anything like this to work in my manifest.
Which page documents this way of building the string?

Welcome to the Atlassian developer community @PaulHicks,

There’s a dedicated section in the docs about the Forge manifest with a specific section on Remotes.

I think @dmorrow’s example was in error. A better example exists in the Data Residency section:

permissions:
  external:
    fetch:
      backend:
        - remote: remote-backend
remotes:
  - key: remote-backend
    baseUrl: "https://backend.example.com"
    operations:
      - fetch

The 1st time we see remote-backend, that’s a forward reference (perhaps a confusing way to illustrate the principles) to the definition in remotes. Then, the 2nd time, we see remote-backend, it’s as the key to an object that defines “where” that remote is and what “channels” it supports.

If that’s not enough to wire things together, do you want to paste your manifest into this thread for some extra eyes on?

Solution: I was calling the ‘/’ but instead I created a ‘/api’ path and when I called that, it worked