Unable to connect to the device: websocket: bad handshake

hi guys,

I installed the mender-client and mender-connect on the devices I want to connect. Also did the mender client setup for the hosted mender server. Both the devices are listed on the mender server and I see their ID’s.

Downloaded the mender-cli to my computer and did a server login via CLI.
( question: where can I find the mender-cli file that supports arm architecture?) My computer works fine but the edge device uses arm.

Wanted to test the mender-cli port-forward so I connect my computer to the edge device via SSH.
I used this command:

mender-cli port-forward <Device ID> 8080:192.168.10.162:8080
The IP address being the local IP of the edge device and the Device ID being the ID of the edge device I want to connect.

Configuration file not found. Continuing.
Connecting to the device <Device ID>.
FAILURE: Unable to connect to the device: websocket: bad handshake

Sometimes it’s just this:

Forwarding from 127.0.0.1:8080 -> 192.168.10.162:8080 and waiting.

Am I doing something wrong here? By reading the docs it should be simple.
Thank you.

Could it be the same as
this: Mender-connect sometimes fails

Hello Johan :slight_smile:

I logged in via CLI to the mender server.

Then executed this commands:
mender-cli port-forward 3bbe0235-f863-48e9-97e3-dbc1d75fa47g 21000:192.168.8.110:21000

output:

Configuration file not found. Continuing.
Connecting to the device 3bbe0235-f863-48e9-97e3-dbc1d75fa47g...
Forwarding from 127.0.0.1:21000 -> 192.168.8.110:21000

Then in another terminal tab:
ssh mydevice@hosted.mender.io -p 21000

Output:
ssh: connect to host hosted.mender.io port 21000: Connection timed out

sudo journalctl -u mender-client -f

Gives me:

Jun 05 09:54:11 kafka mender[2711]: time="2023-06-05T09:54:11+02:00" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Jun 05 09:54:11 kafka mender[2711]: time="2023-06-05T09:54:11+02:00" level=info msg="State transition: update-check [Sync] -> check-wait [Idle]"
Jun 05 09:54:14 kafka mender[2711]: time="2023-06-05T09:54:14+02:00" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Jun 05 09:54:15 kafka mender[2711]: time="2023-06-05T09:54:15+02:00" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"
Jun 05 09:54:16 kafka mender[2711]: time="2023-06-05T09:54:16+02:00" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Jun 05 09:54:16 kafka mender[2711]: time="2023-06-05T09:54:16+02:00" level=info msg="State transition: update-check [Sync] -> check-wait [Idle]"
Jun 05 09:54:19 kafka mender[2711]: time="2023-06-05T09:54:19+02:00" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Jun 05 09:54:20 kafka mender[2711]: time="2023-06-05T09:54:20+02:00" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"
Jun 05 09:54:21 kafka mender[2711]: time="2023-06-05T09:54:21+02:00" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Jun 05 09:54:21 kafka mender[2711]: time="2023-06-05T09:54:21+02:00" level=info msg="State transition: update-check [Sync] -> check-wait [Idle]"
Jun 05 09:54:24 kafka mender[2711]: time="2023-06-05T09:54:24+02:00" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Jun 05 09:54:25 kafka mender[2711]: time="2023-06-05T09:54:25+02:00" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"

Am I doing something wrong?

I tried also:
mender-cli port-forward 3bbe0235-f863-48e9-97e3-dbc1d75fa47g 21000

still the same.