Forge tunnel not working on Apple Silicon

Hi,

I’m following the hello world tutorial for forge, and forge tunnel doesn’t seem to work at the moment. I’ve read other entries in the forum and they fixed it either by restarting docker, signing into docker, or it just worked fine the next day :slight_smile: However I’m not able to get past that.

My setup is as follows:

  • MacBookPro (apple silicon)
  • forge --version = 7.0.2
  • node --version = v20.11.0
  • docker --version = Docker version 25.0.2, build 29cf629
  • git --version = git version 2.39.3 (Apple Git-145)
  • grok --version = ngrok version 3.6.0

So first odd thing:

Checking Docker image… failed
Cannot pull the tunnel image.

Checking Docker image… failed
Cannot pull the tunnel image.

I’m signed into docker and I can see the atlassian/forge-tunnel image pulled into docker desktop

ngrok is working fine since I can see a debug line stating that the tunnel started
t=2024-02-08T19:59:02+0000 lvl=info msg="started tunnel" obj=tunnels > name=25b1852b-39aa-4cef-9a30-81da35b14930 addr=http://localhost:37935 > url=https://a68d-47-221-143-191.ngrok-free.app

 Started tunnel at address: https://a68d-47-221-143-191.ngrok-free.app
 ▶️  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/{my-app-id}",
    "environmentKey": "default",
    "tunnelDefinitions": {
      "faasTunnelUrl": "https://a68d-47-221-143-191.ngrok-free.app/",
      "customUI": [
        {
          "tunnelUrl": "http://localhost:8034/",
          "resourceKey": "main"
        }
      ]
    },
    "force": true
  }
}
t=2024-02-08T19:59:02+0000 lvl=warn msg="failed to check for update" obj=updater err="Post \"https://update.equinox.io/check\": tls: failed to verify certificate: x509: certificate signed by unknown authority"
 ◀️  GraphQL
 Request ID: fda87eee32da461fa085fb853cabd6a0

Result: {
   "createAppTunnels": {
     **"success": true,**
     "errors": null,
    "keepAlive": "1707424084345"
   }
 }

At the end it runs forge lint with no issues and fails on Bundling code …

=== Running forge lint…
t=2024-02-08T19:59:12+0000 lvl=dbug msg=“heartbeat received” obj=tunnels.session obj=csess id=324193ba7c80 clientid=cfd42722fd17c4032ec5651e52499044 latency_ms=60
No issues found.

=== Bundling code…
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

In the container I see the following logs:

Error: The manifest.yml file is not a valid YAML. Fix it and try again.

and

Rerunning the command with --verbose may give more details.
{“tunnel_error”:true,“name”:“InvalidManifestError”,“attributes”:{“isUserError”:true}}

The hello world app I’m building is as is, deployed and installed manually (forge deploy & forge install)

Any help would be greatly appreciated :slight_smile:

Hi Pedro!
Have you tried the new native mode to avoid using Docker? It’s working well for me on a Mac (but Intel). It could also be an authentication issue: see Forge tunnel problem - #5 by BertrandDrouhard1

Hi @BertrandDrouhard1 I do have an ngrok account, the forge settings list looks ok (all values populated including ngrok-config-path, which I confirm is the right file) and the right contents:

version: "2"
authtoken: {my-auth-token}
region: us
log_level: debug

I haven’t tried using the “docker-less” version, I’ll try that next. Can you point me at the steps to use it that way?

edit: I should add that FORGE_EMAIL and FORGE_API_TOKEN come back empty for me, however doing forge whoami returns my name, email and account id

https://developer.atlassian.com/platform/forge/runtime-reference/native-nodejs-runtime/
This will be the standard, so good to start now!

About FORGE_EMAIL and FORGE_API_TOKEN, you could set them directly in your session (FORGE_EMAIL=your_address) and see if it works…

Thanks! I’ll check that now.

BTW setting the variables in my session didn’t make a difference :frowning:

Hi Pedro,

It’s not your exact problem but have you taken a look at the fix here.

Lemme know if it works. In the meantime I’ve contacted the team working on the tunnel to see if they have additional insights.

Hi @JoshuaHwang, thank you for that. My docker version is for apple silicon ( Docker > Get Info > Application (Apple silicon) ). I also reviewed the Docker setting, and use of Rosetta is unchecked.

The fix you mentioned is somewhat odd in the steps to take or I understand it wrong. It states:

To work around this, disable the “Rosetta” setting on your Docker Desktop and restart your Docker daemon.

But what I did, just to try, was to “enable” Rosetta by checking the option that says

Use Rosetta for x86/amd64 emulation on Apple Silicon

and that did the trick, no bundle error :raised_hands:

1 Like

By the way, I wanted to say that I tried the “docker-less” approach and it works fine :+1: thank you @BertrandDrouhard1 for pointing me towards it.

2 Likes