Hi,
Mender client throwing following errors on my device…
root@solidrun-imx6:~# cat /var/log/kern.log | grep mender
Apr 26 09:32:26 solidrun-imx6 mender[454]: level=info msg="Configuration file does not exist: /var/lib/mender/mender.conf" module=config
Apr 26 09:32:26 solidrun-imx6 mender[454]: level=info msg="Loaded configuration file: /etc/mender/mender.conf" module=config
Apr 26 09:32:26 solidrun-imx6 mender[454]: level=info msg="Mender running on partition: /dev/mmcblk0p2" module=main
Apr 26 09:32:27 solidrun-imx6 mender[454]: level=info msg="API Gateway certificate (in PEM format): \n-----BEGIN CERTIFICATE-----\nMIIFwjCCA6qgAwIBAgIJAM12YhUgT0yJMA0GCSqGSIb3DQEBCwUAMHYxCzAJBgNV\nBAYTAklOMQswCQYDVQQIDAJUUzEMMAoGA1UEBwwDSFlEMQ0wCwYDVQQKDARESUdJ\nMQwwCgYDVQQLDANJT1QxEzARBgNVBAMMCmxlc2hhbi5jb20xGjAYBgkqhkiG9w0B\nCQEWC3JhbUB0Y3MuY29tMB4XDTE5MDIyMjA2MTY1N1oXDTIwMDIyMjA2MTY1N1ow\ndjELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAlRTMQwwCgYDVQQHDANIWUQxDTALBgNV\nBAoMBERJR0kxDDAKBgNVBAsMA0lPVDETMBEGA1UEAwwKbGVzaGFuLmNvbTEaMBgG\nCSqGSIb3DQEJARYLcmFtQHRjcy5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw\nggIKAoICAQDbX01+Y+7e0SdZVlXAAQQ1ChBhe0XUcB6Kht4nqWMtx9pwJ98gRbRP\n0uieyEnA96DlTYp5ntnBWGb9Zcp/0IuKK7TGXhXZtoaedLaSEhxiq7F5QbW3WJuf\nkuo7yDXpxhw4zmjm1RlDW7BLlSGhDR+fFeRGE/diu0h8vc/eFDkL38PspVKvxLiS\n7VyVuikdQ1WSDEbOFhN92BOQ4dnSuhVBQLEtp8p74S5MS3QVpjKQOyFSB+ktlBXU\nIk6QKEGWiXPJ3LeRoXJqUSNpMDag+nrid5VtBgliAtTYBWrtmxXsZbZ341c9Dr47\nvKVkHZ9zNpQLJ6CeymOuL/dDFLVrF6Ny3R3YgWDO9d+rmRq5718SiyobRvBsnWT8\nM9kUPtDG3BvztvUyPmKa/1gELkISrpi2O3eZXpMmPYLP
Apr 26 09:32:27 solidrun-imx6 mender[454]: level=info msg="Issuer: [DIGI], Valid from: 2019-02-22 06:16:57 +0000 UTC, Valid to: 2020-02-22 06:16:57 +0000 UTC" module=client
Apr 26 09:32:27 solidrun-imx6 mender[454]: level=info msg="State transition: init [none] -> init [none]" module=mender
Apr 26 09:32:27 solidrun-imx6 mender[454]: level=info msg="State transition: init [none] -> idle [Idle]" module=mender
Apr 26 09:32:27 solidrun-imx6 mender[454]: level=info msg="State transition: idle [Idle] -> authorize [Sync]" module=mender
Apr 26 09:34:12 solidrun-imx6 mender[454]: level=error msg="Failure occured while executing authorization request: &url.Error{Op:\"Post\", URL:\"https://leshan.com/api/devices/v1/authentication/auth_requests\", Err:x509.HostnameError{Certificate:(*x509.Certificate)(0x1908000), Host:\"leshan.com\"}}" module="client_auth"
Apr 26 09:34:12 solidrun-imx6 mender[454]: level=error msg="authorization request error: x509: certificate is valid for docker.mender.io, not leshan.com" module="client_auth"
Apr 26 09:34:12 solidrun-imx6 mender[454]: level=error msg="authorize failed: transient error: authorization request failed: generic error occured while executing authorization request: Post https://leshan.com/api/devices/v1/authentication/auth_requests: **x509: certificate is valid for docker.mender.io, not leshan.com" module=state**
Apr 26 09:34:12 solidrun-imx6 mender[454]: level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Following are changes i have done in yocto mender build…
local.conf
MENDER_DEMO_HOST_IP_ADDRESS = "10.42.0.223"
MENDER_SERVER_URL = "https://leshan.com"
FILESEXTRAPATHS_prepend_pn-mender := "/etc/apache2/ssl:"
SRC_URI_append_pn-mender = " file://leshan.crt"
mender.conf in receips-mender/mender/files**/mender.conf**
{
"InventoryPollIntervalSeconds": 30,
"RetryPollIntervalSeconds": 30,
"RootfsPartA": "/dev/mmcblk0p2",
"RootfsPartB": "/dev/mmcblk0p3",
"ServerCertificate": "/etc/mender/leshan.crt",
"ServerURL": "https://leshan.com",
"TenantToken": "",
"UpdatePollIntervalSeconds": 30
}
Following are my changes on device side while device up and running
cat /etc/mender/mender.conf
{
"InventoryPollIntervalSeconds": 1800,
"RetryPollIntervalSeconds": 300,
"RootfsPartA": "/dev/mmcblk0p2",
"RootfsPartB": "/dev/mmcblk0p3",
"ServerCertificate": "/etc/mender/leshan.crt",
"ServerURL": "https://leshan.com",
"TenantToken": "dummy",
"UpdatePollIntervalSeconds": 1800
}
root@solidrun-imx6:~# ls -lrt /etc/mender/
total 16
-rw-r--r-- 1 root root 24 Mar 18 10:11 artifact_info
-rw-r--r-- 1 root root 312 Apr 26 06:41 mender.conf
drwxr-xr-x 2 root root 4096 Apr 26 06:47 scripts
-rw-r--r-- 1 root root 2057 Apr 26 09:29 leshan.crt
cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.42.0.1 leshan.com
Edit: @mirzak: Prettified logs