Device can't connect to hosted server

Hello Friends!
I configured my mender client on my SBC and authorized it in the dashboard. However, I get the authorization errors and the device can’t update its inventory. I don’t use systemd. There is no startup script for mendor. Buildroot image, not package manager.
I manually entered this commands:

Setup

mender setup --device-type $DEVICE_TYPE --server-url https://eu.hosted.mender.io --tenant-token $TENANT_TOKEN --demo-polling --server-cert /etc/mender/server.crt --data /var/lib/mender

Starting the deamon

# mender daemon
INFO[0000] Loaded configuration file: /etc/mender/mender.conf 
WARN[0000] Could not resolve path link: /dev/mmcblk0p2 Attempting to continue 
WARN[0000] Could not resolve path link: /dev/mmcblk0p3 Attempting to continue 
ERRO[0000] Failed to read the current active partition: No match between boot and root partitions.: Command to read boot environment not found. Tried grub-mender-grubenv-print, systemd-boot-printenv, fw_printenv: executable file not found in $PATH 
INFO[0001] State transition: init [none] -> init [none] 
INFO[0001] State transition: init [none] -> idle [Idle] 
INFO[0001] State transition: idle [Idle] -> check-wait [Idle] 
INFO[0001] State transition: check-wait [Idle] -> inventory-update [Sync] 
WARN[0001] Returning artifact name from /etc/mender/artifact_info file. This is a fallback, in case the information can not be retrieved from the database, and is only expected when an update has never been installed before. 
INFO[0002] Device unauthorized; attempting reauthorization 
INFO[0002] Output (stderr) from command "/usr/share/mender/identity/mender-device-identity": using interface /sys/class/net/wlan0 
ERRO[0002] Failed to authorize with "https://eu.hosted.mender.io": authentication request rejected server error message: dev auth: unauthorized 
WARN[0002] Reauthorization failed with error: transient error: authorization request failed 
ERRO[0002] Failed to submit inventory data: transient error: authorization request failed 
ERRO[0002] inventory submit failed: transient error: authorization request failed 
WARN[0002] Failed to refresh inventory: failed to submit inventory data: inventory submit failed: transient error: authorization request failed 
INFO[0002] State transition: inventory-update [Sync] -> inventory-update-retry-wait [Sync] 
INFO[0002] Handle update inventory retry state try: 0   
WARN[0002] Returning artifact name from /etc/mender/artifact_info file. This is a fallback, in case the information can not be retrieved from the database, and is only expected when an update has never been installed before. 
INFO[0003] Device unauthorized; attempting reauthorization 
INFO[0003] Output (stderr) from command "/usr/share/mender/identity/mender-device-identity": using interface /sys/class/net/wlan0 
ERRO[0004] Failed to authorize with "https://eu.hosted.mender.io": authentication request rejected server error message: dev auth: unauthorized 
WARN[0004] Reauthorization failed with error: transient error: authorization request failed 
ERRO[0004] Failed to submit inventory data: transient error: authorization request failed 
ERRO[0004] inventory submit failed: transient error: authorization request failed 
WARN[0004] Failed to refresh inventory: failed to submit inventory data: inventory submit failed: transient error: authorization request failed 
INFO[0004] Wait 30s before next inventory update attempt in 59.99999825s 

### MEANWHILE I AUTHORIZED MANUALLY IN THE DASHBOARD ###

The device is accepted and but still get this error from the deamon.
ps aux | grep mender no processes
netstat no other connections

Permanent output:

INFO[0431] Device unauthorized; attempting reauthorization 
INFO[0431] Output (stderr) from command "/usr/share/mender/identity/mender-device-identity": using interface /sys/class/net/wlan0 
INFO[0431] successfully received new authorization data from server https://eu.hosted.mender.io 
ERRO[0431] Could not reconfigure proxy with URL "https://eu.hosted.mender.io" and token 'eyJhbGc...' Other applications running on the device won't be able to reach the Mender server. Error: failed to reconfigure proxy: failed to create listener: listen tcp 127.0.0.1:0: bind: cannot assign requested address 
WARN[0431] Reauthorization failed with error: transient error: authorization request failed 
ERRO[0431] Error receiving scheduled update data: update check request failed: transient error: authorization request failed 
ERRO[0431] Update check failed: transient error: update check request failed: transient error: authorization request failed 
INFO[0431] State transition: update-check [Sync] -> error [Error] 
INFO[0431] Handling error state, current error: transient error: update check request failed: transient error: authorization request failed 
INFO[0431] State transition: error [Error] -> idle [Idle] 
INFO[0431] State transition: idle [Idle] -> check-wait [Idle] 
INFO[0433] State transition: check-wait [Idle] -> inventory-update [Sync] 
WARN[0433] Returning artifact name from /etc/mender/artifact_info file. This is a fallback, in case the information can not be retrieved from the database, and is only expected when an update has never been installed before. 

Thanks in advance!

PS: Which values are accepted for --log-level ?

Hi, having a pretty similar issue here. I’m just starting with Mender on a Raspebrry Pi 3/4. I’ll share my logs ins case it helps.

Mar 16 13:52:02 raspberrypi systemd[1]: Started Mender OTA update service.
Mar 16 13:52:03 raspberrypi mender[629]: time="2023-03-16T13:52:03Z" level=info msg="Loaded configuration file: /etc/mender/mender.conf"
Mar 16 13:52:04 raspberrypi mender[629]: time="2023-03-16T13:52:04Z" level=info msg="No dual rootfs configuration present"
Mar 16 13:52:05 raspberrypi mender[629]: time="2023-03-16T13:52:05Z" level=info msg="State transition: init [none] -> init [none]"
Mar 16 13:52:05 raspberrypi mender[629]: time="2023-03-16T13:52:05Z" level=info msg="State transition: init [none] -> idle [Idle]"
Mar 16 13:52:05 raspberrypi mender[629]: time="2023-03-16T13:52:05Z" level=info msg="State transition: idle [Idle] -> check-wait [Idle]"
Mar 16 13:52:05 raspberrypi mender[629]: time="2023-03-16T13:52:05Z" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Mar 16 13:52:06 raspberrypi mender[629]: time="2023-03-16T13:52:06Z" level=info msg="Output (stderr) from command \"/usr/share/mender/inventory/mender-inventory-mender-configure\": An authentication token could not be obtained over DBus."
Mar 16 13:52:06 raspberrypi mender[629]: time="2023-03-16T13:52:06Z" level=warning msg="Inventory tool /usr/share/mender/inventory/mender-inventory-mender-configure wait failed: exit status 1"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=info msg="Device unauthorized; attempting reauthorization"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=info msg="Output (stderr) from command \"/usr/share/mender/identity/mender-device-identity\": using interface /sys/class/net/eth0"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=error msg="Failure occurred while executing authorization request: Method: Post, URL: https://192.168.1.102/api/devices/v1/authentication/auth_requests"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=error msg="Failed to authorize with \"https://192.168.1.102\": Unknown url.Error type: Host validation error"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=warning msg="Reauthorization failed with error: transient error: authorization request failed"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=error msg="Failed to submit inventory data: transient error: authorization request failed"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=error msg="inventory submit failed: transient error: authorization request failed"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=warning msg="Failed to refresh inventory: failed to submit inventory data: inventory submit failed: transient error: authorization request failed"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=info msg="State transition: inventory-update [Sync] -> inventory-update-retry-wait [Sync]"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=info msg="Handle update inventory retry state try: 0"
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=info msg="Output (stderr) from command \"/usr/share/mender/inventory/mender-inventory-mender-configure\": An authentication token could not be obtained over DBus."
Mar 16 13:52:08 raspberrypi mender[629]: time="2023-03-16T13:52:08Z" level=warning msg="Inventory tool /usr/share/mender/inventory/mender-inventory-mender-configure wait failed: exit status 1"
Mar 16 13:52:10 raspberrypi mender[629]: time="2023-03-16T13:52:10Z" level=info msg="Device unauthorized; attempting reauthorization"
Mar 16 13:52:10 raspberrypi mender[629]: time="2023-03-16T13:52:10Z" level=info msg="Output (stderr) from command \"/usr/share/mender/identity/mender-device-identity\": using interface /sys/class/net/eth0"
Mar 16 13:52:10 raspberrypi mender[629]: time="2023-03-16T13:52:10Z" level=error msg="Failure occurred while executing authorization request: Method: Post, URL: https://192.168.1.102/api/devices/v1/authentication/auth_requests"
Mar 16 13:52:10 raspberrypi mender[629]: time="2023-03-16T13:52:10Z" level=error msg="Failed to authorize with \"https://192.168.1.102\": Unknown url.Error type: Host validation error"

Here’s my configuration as well:
/etc/mender/mender.conf

{
    "HttpsClient": {},
    "Security": {},
    "Connectivity": {},
    "DeviceTypeFile": "/var/lib/mender/device_type",
    "DBus": {
        "Enabled": true
    },
    "UpdateControlMapExpirationTimeSeconds": 90,
    "UpdateControlMapBootExpirationTimeSeconds": 45,
    "UpdatePollIntervalSeconds": 5,
    "InventoryPollIntervalSeconds": 5,
    "RetryPollIntervalSeconds": 30,
    "ServerCertificate": "/etc/mender/server-ca-chain.pem",
    "Servers": [
        {
            "ServerURL": "https://192.168.1.102"
        }
    ]
}

Mender’s config folder looks lie this:

pi@raspberrypi:~ $ ls -l /etc/mender/
total 24
drwxr-xr-x 2 root root 4096 Mar 16 13:40 identity
drwxr-xr-x 2 root root 4096 Mar 16 13:40 inventory
-rw-r--r-- 1 root root   52 Mar 16 13:40 mender-connect.conf
-rw------- 1 root root  533 Mar 16 13:40 mender.conf
drwxr-xr-x 2 root root 4096 Mar 16 13:40 scripts
-rw-r--r-- 1 root root 2636 Mar 16 13:49 server-ca-chain.pem
pi@raspberrypi:~ $

Any help would be much appreciated.

For me the solution was to bring up lo interface. Since I have custom S40network script in etc/init.d/, that is something I missed out.
ifup lo before starting mender.

1 Like

Kudos for @mister_kanister for pointing the solution. Regarding your PS, the possible --log-level values, they can be debug, info, warning, error, fatal or panic. Earlier log levels will also log the subsequent levels (so debug will log everything). The default log level is info.

Kind regards,
Estape

1 Like