Unable to install mender client using deb package. Json parsing error

I just followed deb package instructions to install mender client. I am getting following error

ERRO[0031] Error parsing JSON response.: json: cannot unmarshal object into Go value of type string 
dpkg: error processing package mender-client:armhf (--install):
 installed mender-client:armhf package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 mender-client:armhf

Steps I followed are
wget https://d1b0l86ne08fsf.cloudfront.net/2.3.0/dist-packages/debian/armhf/mender-client_2.3.0-1_armhf.deb && sudo dpkg -i --force-confdef --force-confold mender-client_2.3.0-1_armhf.deb

It gave me liblzma5 error. I did sudo apt --fix-broken to fix it. And after that above mentioned error pops up. I am updating my package after a while now. I didnt have this problem last time.

Another Issue I am having is that after updating to the latest version I am unable to use cpuid as identifier. It was working fine before. I used following command to get my cpuid

grep Serial /proc/cpuinfo | tr -d "\n\r\t" | sed 's/Serial/cpuid/' | sed 's/:/=/' | tr -d "[:blank:]" | sed 's/$/\n/'

As soon as I shift back to mac address the device shows up

Looking forward to hearing from you

Thanks

Hello @zainmehdi! Two things:

  1. Which board and OS are you using?
  2. Can you post the contents of mender.conf? Make sure to hide the TenantToken if there is one.

Hi @kacf,

I am using Nano Pi Neo 4 with Ubuntu 18.04.

Here are the contents of mender.conf

{
    "ClientProtocol": "https",
    "ArtifactVerifyKey": "",
    "HttpsClient": {
        "Certificate": "",
        "Key": "",
        "SkipVerify": false
    },
    "RootfsPartA": "",
    "RootfsPartB": "",
    "DeviceTypeFile": "/var/lib/mender/device_type",
    "UpdatePollIntervalSeconds": 5,
    "InventoryPollIntervalSeconds": 5,
    "RetryPollIntervalSeconds": 30,
    "StateScriptTimeoutSeconds": 0,
    "StateScriptRetryTimeoutSeconds": 0,
    "StateScriptRetryIntervalSeconds": 0,
    "ModuleTimeoutSeconds": 0,
    "ServerCertificate": "",
    "ServerURL": "",
    "UpdateLogPath": "",
    "TenantToken": "Removed",
    "Servers": [
        {
            "ServerURL": "https://hosted.mender.io"
        }
    ]
}

PS: When I use CPU serial number as an identifier I am getting following error in service status

The client server-certificate can not be loaded: (open : no such file or directory). The client will continue running, but may not be able to communicate with the server

I cannot see anything wrong in there. I thought maybe an existing config file would confuse the mender setup step which is run automatically as part of the deb package installation. Does it work if you remove the mender.conf file first?

I didnt try removing the conf file. But when I change identity script to use mac address instead of cpu serial number it shows up in hosted mendee server. I mentioned the error below it is unable to get authorisation.

@kacf @mirzak Here is mender.conf file. I am still unable to use cpu serial number as identifier. Can I please get some updates on it. If I use MAC address the device shows up as pending in the device list.

set -ue

SCN=/sys/class/net
min=65535
arphrd_ether=1
ifdev=

# find iface with lowest ifindex, skip non ARPHRD_ETHER types (lo, sit ...)
for dev in $SCN/*; do
    if [ ! -f "$dev/type" ]; then
        continue
    fi

    iftype=$(cat $dev/type)
    if [ $iftype -ne $arphrd_ether ]; then
        continue
    fi

    idx=$(cat $dev/ifindex)
    if [ $idx -lt $min ]; then
        min=$idx
        ifdev=$dev
    fi
done

if [ -z "$ifdev" ]; then
    echo "no suitable interfaces found" >&2
    exit 1
else
    echo "using interface $ifdev" >&2
    # grab MAC address
    #echo "mac=$(cat $ifdev/address)"
    grep Serial /proc/cpuinfo | tr -d "\n\r\t" | sed 's/Serial/cpuid/' | sed 's/:/=/' | tr -d "[:blank:]" | sed 's/$/\n/'
fi

Output Log:

Sep 04 08:55:57 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:57+09:00” level=info msg=“No dual rootfs configuration present”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=warning msg=“IGNORING ERROR: The client server-certificate can not be loaded: (open : no such file or directory). The client will continue running, but may not be able to communicate with the server. If this is not your intention please add a valid server certificate”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=warning msg=“IGNORING ERROR: The client server-certificate can not be loaded: (open : no such file or directory). The client will continue running, but may not be able to communicate with the server. If this is not your intention please add a valid server certificate”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=info msg=“State transition: init [none] -> init [none]”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=info msg=“State transition: init [none] -> idle [Idle]”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=info msg=“State transition: idle [Idle] -> authorize-wait [Idle]”
Sep 04 08:55:58 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:58+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 04 08:55:59 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:59+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 04 08:55:59 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:59+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 04 08:55:59 NanoPi-NEO4 mender[14052]: time=“2020-09-04T08:55:59+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”

When you change to cpuid, does it help to run this afterwards:

rm /var/lib/mender/mender-agent.pem /var/lib/mender/mender-store*
systemctl restart mender-client

@kacf I tried those command and still the same response.

Here is the log if that helps

Sep 04 16:50:30 NanoPi-NEO4 systemd[1]: Started Mender OTA update service.
Sep 04 16:50:36 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:36+09:00” level=info msg=“Loaded configuration file: /etc/mender/mender.conf”
Sep 04 16:50:36 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:36+09:00” level=info msg=“No dual rootfs configuration present”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=warning msg=“IGNORING ERROR: The client server-certificate can not be loaded: (open : no such file or directory). The client will continue running, but may not be able to communicate with the server. If this is not your intention please add a valid server certificate”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=warning msg=“IGNORING ERROR: The client server-certificate can not be loaded: (open : no such file or directory). The client will continue running, but may not be able to communicate with the server. If this is not your intention please add a valid server certificate”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=info msg=“State transition: init [none] -> init [none]”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=info msg=“State transition: init [none] -> idle [Idle]”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=info msg=“State transition: idle [Idle] -> authorize-wait [Idle]”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Failure occurred while executing authorization request: &url.Error{Op:“Post”, URL:“https://hosted.mender.io/api/devices/v1/authentication/auth_requests”, Err:(*net.OpError)(0x10fa0c0)}”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Failure occurred while executing authorization request: &url.Error{Op:“Post”, URL:“https://hosted.mender.io/api/devices/v1/authentication/auth_requests”, Err:(*net.OpError)(0x10fa0c0)}”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Authorization request error: dial tcp: lookup hosted.mender.io on [::1]:53: server misbehaving”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Authorization request error: dial tcp: lookup hosted.mender.io on [::1]:53: server misbehaving”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: generic error occurred while executing authorization request: Post https://hosted.mender.io/api/devices/v1/authentication/auth_requests: dial tcp: lookup hosted.mender.io on [::1]:53: server misbehaving”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 04 16:50:37 NanoPi-NEO4 mender[481]: time=“2020-09-04T16:50:37+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: generic error occurred while executing authorization request: Post https://hosted.mender.io/api/devices/v1/authentication/auth_requests: dial tcp: lookup hosted.mender.io on [::1]:53: server misbehaving”
Sep 07 12:00:15 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:15+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:00:17 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:17+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:00:17 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:17+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:00:17 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:17+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:00:45 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:45+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:00:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:00:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:00:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:00:46+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:01:15 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:15+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:01:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:01:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:01:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:16+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:01:45 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:45+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:01:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:01:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:01:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:01:46+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:02:15 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:15+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:02:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:02:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:02:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:16+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:02:45 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:45+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:02:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:02:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:02:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:02:46+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:03:15 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:15+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:03:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:03:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:03:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:16+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:03:45 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:45+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:03:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:03:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:46+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:03:46 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:03:46+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”
Sep 07 12:04:15 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:04:15+09:00” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]”
Sep 07 12:04:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:04:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:04:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:04:16+09:00” level=error msg=“Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized”
Sep 07 12:04:16 NanoPi-NEO4 mender[481]: time=“2020-09-07T12:04:16+09:00” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]”

The log looks ok to me, it just says that the device is unauthorized because it has not been accepted in the UI. Are you not able to see it in the Pending list? Make sure the device is not in the list of Rejected devices.

I checked the device and its not in the rejected list. I cant seem to figure out whats wrong. It was working perfectly with previous mender clients.

If this is Hosted Mender, perhaps you should also double check that the
TenantToken is correctly set on the client.

@kacf Thanks alot for your support. The issue has been resolved. The device had to be decommissioned in order for it to be detected again with the proper IDs.

I’m glad it worked out!