Remote terminal connection failed

Hi,

I updated my Mender Open-Source server to 2.6 as we wanted to test the new remote terminal feature, but it doesn’t work so far.

We use Raspberry Pi 3 model A+ in our project, with Yocto image and Mender system update (everything work fine apart from this new feature), I added mender-connect to the image following those guidelines, I do see the remote terminal connection button for the device updated with the new image, but when I click on it, I see the terminal open and close very fast, with a “Connection died with the device” message at the bottom.

This is the result of systemctl status mender-connect command on my device:

[[0;1;32m●[[0m mender-connect.service - Mender Connect service
Loaded: loaded (/lib/systemd/system/mender-connect.service; enabled; vendor preset: enabled)
Active: [[0;1;32mactive (running)[[0m since Thu 2021-02-18 11:01:17 CET; 19min ago
Main PID: 283 (mender-connect)
Tasks: 12 (limit: 413)
CGroup: /system.slice/mender-connect.service
└─283 /usr/bin/mender-connect daemon

Feb 18 11:01:17 Alto systemd[1]: Started Mender Connect service.
Feb 18 11:01:17 Alto mender-connect[283]: time=“2021-02-18T11:01:17+01:00” level=info msg=“Loaded configuration file: /etc/mender/mender-connect.conf”
Feb 18 11:01:18 Alto mender-connect[283]: time=“2021-02-18T11:01:18+01:00” level=warning msg=“call to GetJWTToken on the Mender D-Bus API failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name io.mender.AuthenticationManager was not provided by any .serv
ice files”
Feb 18 11:01:18 Alto mender-connect[283]: time=“2021-02-18T11:01:18+01:00” level=info msg=“waiting for JWT token (waitForJWTToken)”
Feb 18 11:01:19 Alto mender-connect[283]: time=“2021-02-18T11:01:19+01:00” level=info msg=“loadServerTrust loading certificate from /etc/mender/server.crt”
Feb 18 11:01:19 Alto mender-connect[283]: time=“2021-02-18T11:01:19+01:00” level=info msg=“API Gateway certificate (in PEM format): […]”
Feb 18 11:01:19 Alto mender-connect[283]: time=“2021-02-18T11:01:19+01:00” level=info msg=“Issuer: [], Valid from: 2020-10-27 12:06:34 +0000 UTC, Valid to: 2030-10-25 12:06:34 +0000 UTC”

I guess this is related to the JWT warning message, but I don’t know how to fix this.
This is the content of the mender-connect.conf:

{
“ClientProtocol”: “https”,
“ServerCertificate”: “/etc/mender/server.crt”,
“ServerURL”: “***”,
“User”: “root”,
“ShellCommand”: “/bin/sh”,
“Terminal”: {
“Height”: 24,
“Width”: 128
},
“Sessions”: {
“StopExpired”: false,
“ExpireAfter”: 255,
“ExpireAfterIdle”: 16,
“MaxPerUser”: 4
}
}

Any help would be very appreciated.

Yoann

Hello @Piocky, which version of the Mender client you are running? You need the latest stable version, which provides the D-Bus API that mender-connect consumes.

Hi @tranchitella,

I’m using the last commit on Dunfell branch, but i’m not sure to use the last stable version of mender-client. Where should I specify which version to use?
It seems to be the 2.5.0 version of mender-client, I don’t have the PREFERRED_VERSION_pn-mender-client variable set in my local.conf file, so the build should use the latest stable version right?

@Piocky: It is not necessary to set PREFERRED_VERSION, it should select the latest version automatically. What does your client log say?

journalctl -u mender-client
[[0;1;32m●[[0m mender-client.service - Mender OTA update service
-- Logs begin at Wed 2021-02-17 18:43:30 CET, end at Thu 2021-02-18 11:28:23 CET. --
-- Logs begin at Wed 2021-02-17 18:43:30 CET, end at Thu 2021-02-18 11:28:23 CET. --
-- Logs begin at Wed 2021-02-17 18:43:30 CET, end at Thu 2021-02-18 11:28:23 CET. --
-- Logs begin at Wed 2021-02-17 18:43:30 CET, end at Thu 2021-02-18 11:28:23 CET. --
Feb 17 19:37:37 Alto systemd[1]: Started Mender OTA update service.
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="Loaded configuration file: /var/lib/mender/mender.conf"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="Loaded configuration file: /etc/mender/mender.conf"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="Mender running on partition: /dev/mmcblk0p2"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="State transition: init [none] -> init [none]"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="State transition: init [none] -> idle [Idle]"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="State transition: idle [Idle] -> check-wait [Idle]"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Feb 18 11:01:18 Alto mender[282]: time="2021-02-18T11:01:18+01:00" level=warning msg="Inventory tool /usr/share/mender/inventory/mender-inventory-geo wait failed: exit status 3"
Feb 18 11:01:19 Alto mender[282]: time="2021-02-18T11:01:19+01:00" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"
Feb 18 11:01:19 Alto mender[282]: time="2021-02-18T11:01:19+01:00" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Feb 18 11:01:19 Alto mender[282]: time="2021-02-18T11:01:19+01:00" level=info msg="State transition: update-check [Sync] -> check-wait [Idle]"

I can’t see anything wrong in there. What is the output of:

cat /usr/share/dbus-1/system.d/io.mender.AuthenticationManager.conf

It works now! I can’t tell you what it was exactly, but the freelance who deployed the server tell me that he made some manual changes in production/config/prod.yml at the time there were problems with group and deploy. He changed back to normal and we restart the dockers, now the Rmote Terminal works well.
Thanks a lot for your help and reactivity!