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
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]”
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.
@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.