Can't get 'forge tunnel' working with "meat and potatoes" hello-world Jira app

Hey everyone,

I’m developing in a fresh Linux environment and encountering issues when trying to use forge tunnel with my Jira ‘hello world’ app. The app deploys without any problems in development, but I run into trouble when starting the tunnel.

Here’s what happens:

➜  yomtvrapz forge tunnel
Tunnel redirects requests you make to your local machine. This occurs for any Atlassian site where your app is installed in the specific development environment. You will not see requests from other users.
Press Ctrl+C to cancel.


=== Running forge lint...
No issues found.

=== Bundling code...
✔ Functions bundled.
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  main.js (303 KiB)
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (303 KiB)
      main.js

webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
✔ Resources bundled.

Listening for requests...

After initiating the tunnel, when I try to refresh a Jira issue where the panel is supposed to display, the panel appears to be stuck in a ‘loading’ state and doesn’t render the contents. No activity appears on the console output of ‘forge tunnel’ either.

Here’s the relevant part of my manifest for reference (FWIW):

modules:
  jira:issuePanel:
    - key: yomtvrapz-hello-world-issue-panel
      resource: main
      resolver:
        function: resolver
      render: native
      title: yomtvrapz YOza
      icon: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
  function:
    - key: resolver
      handler: index.handler
resources:
  - key: main
    path: src/frontend/index.jsx
app:
  id: ari:cloud:ecosystem::app/e41f7408-ed45-4f43-be36-756d1ef610c1
  runtime:
    name: nodejs18.x

Additionally, I’ve confirmed that Ngrok is authenticating correctly since altering the token to an incorrect one prevents the tunnel from starting altogether.

I was also expecting to see some references to Docker in the output, as I thought forge tunnel utilized Docker. Is that not the case?

Any insights or advice would be greatly appreciated!

Does passing in --verbose give any more insights?

I was also expecting to see some references to Docker in the output, as I thought forge tunnel utilized Docker. Is that not the case?

This is no longer the case. As of Forge CLI version 9.0.0, all new Forge apps are deployed by default on the latest Forge runtime which doesn’t require Docker when running forge tunnel.

https://developer.atlassian.com/platform/forge/changelog/#CHANGE-1634

1 Like

Not that I can tell… here’s the tail end:

▶️  GraphQL https://api.atlassian.com/graphql
Query: 
      mutation forge_cli_createApplicationTunnels($input: CreateAppTunnelsInput!) {
        createAppTunnels(input: $input) {
          success
          errors {
            message
            extensions {
              errorType
              statusCode
            }
          }
          keepAlive
        }
      }
    
Variables: {
  "input": {
    "appId": "ari:cloud:ecosystem::app/e41f7408-ed45-4f43-be36-756d1ef610c1",
    "environmentKey": "default",
    "tunnelDefinitions": {
      "faasTunnelUrl": "https://77f9-174-26-30-38.ngrok-free.app/",
      "customUI": [
        {
          "tunnelUrl": "http://localhost:8001/",
          "resourceKey": "main"
        }
      ]
    },
    "force": true
  }
}
◀️  GraphQL
Request ID: 4d14266e836b4cd4b51b90580275d778
Result: {
  "createAppTunnels": {
    "success": true,
    "errors": null,
    "keepAlive": "1715573451533"
  }
}

=== Running forge lint...
No issues found.

=== Bundling code...
t=2024-05-12T20:42:00-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=58
✔ Functions bundled.
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  main.js (303 KiB)
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (303 KiB)
      main.js

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
✔ Resources bundled.

Listening for requests on local port 33507...

t=2024-05-12T20:42:10-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=59
t=2024-05-12T20:42:20-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=59
t=2024-05-12T20:42:30-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=58
t=2024-05-12T20:42:40-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=58
t=2024-05-12T20:42:50-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=58
t=2024-05-12T20:43:00-0700 lvl=dbug msg="heartbeat received" obj=tunnels.session obj=csess id=a1f720902ca2 clientid=fa81d790178f425094072e4dd7649227 latency_ms=61

Hi @michael.march, this is strange, are you running forge tunnel on multiple terminals simultaneously? if are doing so, you can sometimes get into a bad state as terminating the forge tunnel command closes the tunnel for your app.

In terms of the references to Docker, the native Node runtime no longer utilizes Docker, as mentioned correctly in the earlier reply.

1 Like

ngrok doesn’t allow more than one tunnel at a time so I don’t think that’s the case.

Yup, that’s true, but every time you exit forge tunnel it will attempt to close off all active tunnels for the app, even if the Ngrok tunnel fails to be established. Running multiple forge tunnel processes may cause conflicts.
Are you still running into this issue? does the issue occur for other apps?