Balena tunnel does not forward port

My device is running a development-image of BalenaOS.
I can see my webapp running when I navigate to http://<deviceuid>.local/ inside the browser.
Also when I SSH to the HostOS and check my running containers with balena ps I see it has one container exposing like such 0.0.0.0:80->3000/tcp.

However when I run the balena tunnel <full deviceuid> -p 80:8080 command it does not forward the port and I cannot reach the webapp via browser on 8080.

It just prompts that it’s ‘waiting for connection’.

Fetching application by name 6b35227b44c7d080a69158082d1587db (string)
[Debug]   Application not found
[Debug]   Fetching device by UUID 6b35227b44c7d080a69158082d1587db (string)
[Info]    Opening a tunnel to 6b35227b44c7d080a69158082d1587db...
[Info]     - tunnelling localhost:8080 to 6b35227b44c7d080a69158082d1587db:80
[Info]    Waiting for connections...

And after a minute or so the following

127.0.0.1:60471 => 127.0.0.1:8080 ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error]   :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error]   :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error]   127.0.0.1:60479 => 127.0.0.1:8080 ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error]   :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128

I tried it with other ports like 22222 to gain SSH access via the tunnel but no result.

Hi, I’ll try this on my local device. Which version of balenaos does the device use?

I am using balenaOS 2.44.0+rev3.
My cli is v11.17.3-windows-x64.

I tested locally with https://github.com/balena-io-projects/simple-server-node repo. Changed the port in server.js to listen to 3000 and added docker-compose.yml that looks like this:

version: '2.1'
services:
  server:
    build:
      context: .
    ports:
      - '80:3000'

Then I run balena tunnel <full deviceuid> -p 80:8080 and was able to access the website on http://localhost:8080/.
Can you ensure that you are logged in balena-cli with same credentials which you are logged in dashboard?
Also, can you run same steps as I did and see if it works?

I am using open-balena and don’t have access to any dashboard as far as I know. I logged with balena login and used my ‘super-user’ credentials. Is balena tunnel not working for open-balena maybe?

Sorry, did not notice you were talking about openBalena. balena tunnel should work with openBalena. CLI is unable to connect to the port 3128 on your openBalena instance IP. Can you check your network/firewall config?

Awesome, that indeed resolved the issue and in hindsight it was quite obvious.
Maybe forwarding port 3128 is something worth mentioning on the getting-started page.

Thanks karaxuna!