# Feedback on Mender C++

**URL:** <https://hub.mender.io/t/feedback-on-mender-c/6344>\
**Category:** General Discussions\
**Created:** [November 16, 2023, 12:21pm UTC](https://hub.mender.io/t/feedback-on-mender-c/6344 "2023-11-16T12:21:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [November 16, 2023, 12:21pm UTC](https://hub.mender.io/t/feedback-on-mender-c/6344/1 "2023-11-16T12:21:36Z")

</div>

I have been testing the latest version of the Mender C++ client using:

```auto
PREFERRED_VERSION_mender = "feature-c++-client-git%"
PREFERRED_VERSION_mender-flash = "master-git%"
SRC_URI:pn-mender = "gitsm://github.com/mendersoftware/mender;protocol=https;branch=feature-c++-client"
SRC_URI:pn-mender-native = "gitsm://github.com/mendersoftware/mender;protocol=https;branch=feature-c++-client"

```

I have stumbled upon a couple of things, and I thought I would share them.

#### 1. No ‘mender’ in PATH

There does not seem to be anything called `mender` in PATH anymore, which is instead replaced by `mender-auth`, `mender-flash` and `mender-update`.

This change would break our usage of Mender standalone mode as we run `mender commit` from scripts/applications.

Possible solution is to symlink `mender` → `mender-update` ? Something similar appears to have been done for the `mender-client.service` which now appears to be linked to `mender-authd.service`

#### 2. Very long log messages (pedantic)

When inspecting the log of e.g `mender-authd` with `journalctl`, the error messages look like this:

```auto
Nov 16 12:15:57 eg-e0-dc-a0-65-f2-d9 mender-auth[1191303]: record_id=162 severity=error time="2023-Nov-16 12:15:57.634581" name="Global" msg="Failed to fetch new token: Authentication error: No more servers to try for authentication"

```

1. There is a lot of meta data for each message which leads to very long messages, had to zoom out very far (barely readable) to be even close to fitting it to screen. Maybe I should get a bigger screen 🙂 .

2. There are two instances of timestamp meta-data, should probably turn of internal if used with systemd?

#### 3. Bug triggered in code

My device is in a unauthorized state:

```auto
Nov 16 12:15:57 eg-e0-dc-a0-65-f2-d9 mender-auth[1191303]: record_id=161 severity=info time="2023-Nov-16 12:15:57.634413" name="Global" msg="Authentication error trying server 'https://eu.hosted.mender.io': Unauthorized error: Authentication error(Unauthorized): Failed to authorize with the server.({"error":"dev auth: unauthorized","request_id":"02d8f668-213d-4604-ab72-6d2ebc78afba"})"

```

Which leads to the following error message in `mender-updated`:

```auto
Nov 16 11:44:09 eg-e0-dc-a0-65-f2-d9 mender-update[407]: record_id=142 severity=error time="2023-Nov-16 11:44:09.147633" name="Global" msg="Request to check new deployments failed: Assert `auth_data.server_url != ""` in /usr/src/debug/mender/feature-c++-client-gitAUTOINC+e10722e3d9-r0/git/src/api/client.cpp:31 failed. This is a bug."
Nov 16 11:44:09 eg-e0-dc-a0-65-f2-d9 mender-update[407]: record_id=143 severity=error time="2023-Nov-16 11:44:09.147682" name="Global" msg="Error while polling for deployment: Programming error, should not happen: Assert `auth_data.server_url != ""` in /usr/src/debug/mender/feature-c++-client-gitAUTOINC+e10722e3d9-r0/git/src/api/client.cpp:31 failed. This is a bug."

```

`/etc/mender/mender.conf`

```auto
sudo cat /etc/mender/mender.conf 
{
    "InventoryPollIntervalSeconds": 30,
    "RetryPollIntervalSeconds": 30,
    "ServerURL": "https://eu.hosted.mender.io",
    "TenantToken": "<redacted>",
    "UpdatePollIntervalSeconds": 10
}

```

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [November 16, 2023, 12:36pm UTC](https://hub.mender.io/t/feedback-on-mender-c/6344/2 "2023-11-16T12:36:30Z")

</div>

Thanks so much @mirzak!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [November 17, 2023, 8:23am UTC](https://hub.mender.io/t/feedback-on-mender-c/6344/3 "2023-11-17T08:23:44Z")

</div>

Hey @mirzak, thanks for testing; nice to see some interest in the new client!

> [@mirzak](#):
>
> #### 1. No ‘mender’ in PATH
> 
> There does not seem to be anything called `mender` in PATH anymore, which is instead replaced by `mender-auth`, `mender-flash` and `mender-update`.
> 
> This change would break our usage of Mender standalone mode as we run `mender commit` from scripts/applications.

Yes, it would have to be switched to use `mender-update commit` instead. For scripts, this approach should be pretty safe:

```bash
$ mender-update commit || mender commit

```

The problem with providing a common `mender` command is that the authentication daemon and the update daemon are now completely separate tools, and it’s not always clear which operation is meant for which. Certain operations overlap, such as `mender daemon`. Does that mean `mender-auth daemon` or `mender-update daemon`? Or both? What if only the former is installed? The semantics here are messy, and we end up pretending that it’s all one service, which it isn’t anymore, so we decided that a clean break is better. And a major version is the only time that we can do that.

The Golang client will still be supported for quite a while, so there is time to fix such issues.

> [@mirzak](#):
>
> Possible solution is to symlink `mender` → `mender-update` ? Something similar appears to have been done for the `mender-client.service` which now appears to be linked to `mender-authd.service`

Actually, I think this symlink should not be there. I’ve posted a comment in [this ticket](https://northerntech.atlassian.net/browse/MEN-6812), which is where the symlink was introduced, to discuss it.

> [@mirzak](#):
>
> #### 2. Very long log messages (pedantic)
> 
> When inspecting the log of e.g `mender-authd` with `journalctl`, the error messages look like this:
> 
> ```auto
> Nov 16 12:15:57 eg-e0-dc-a0-65-f2-d9 mender-auth[1191303]: record_id=162 severity=error time="2023-Nov-16 12:15:57.634581" name="Global" msg="Failed to fetch new token: Authentication error: No more servers to try for authentication"
> 
> ```
> 
> 1. There is a lot of meta data for each message which leads to very long messages, had to zoom out very far (barely readable) to be even close to fitting it to screen. Maybe I should get a bigger screen 🙂 .
> 2. There are two instances of timestamp meta-data, should probably turn of internal if used with systemd?

I suppose that an option to turn log messages into plain messages, without extra log context, would make sense, in order to make command line work easier on the eyes. But it’s not something we consider critical. Pull requests are accepted if you find this important! 😄

> [@mirzak](#):
>
> Bug triggered in code

Indeed! Inserted straight into [a ticket](https://northerntech.atlassian.net/browse/MEN-6856).
