Hello,
How can one check the device state via cli?
Asking this because I’ve hit a strange state where the device is decommissioned on my hosted.mender.io panel and then rebooted.
Upon booting it hit the network error (raspbian):
journalctl -f -u mender
-- Logs begin at Thu 2016-11-03 17:16:43 GMT. --
Apr 15 07:40:20 raspberrypi mender[315]: time="2019-04-15T07:40:20+01:00" level=info msg="State transition: error [Error] -> idle [Idle]" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: level=error msg="Error receiving scheduled update data: update check request failed: Get https://hosted.mender.io/api/devices/v1/deployments/device/deployments/next?artifact_name=2018-11-13-raspbian-zicher&device_type=raspberrypi3: dial tcp: lookup hosted.mender.io on <ip>:53: dial udp <ip>:53: connect: network is unreachable" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: time="2019-04-15T07:40:20+01:00" level=info msg="authorization data present and valid" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: time="2019-04-15T07:40:20+01:00" level=info msg="State transition: idle [Idle] -> check-wait [Idle]" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: level=error msg="update check failed: transient error: update check request failed: Get https://hosted.mender.io/api/devices/v1/deployments/device/deployments/next?artifact_name=2018-11-13-raspbian-zicher&device_type=raspberrypi3: dial tcp: lookup hosted.mender.io on <ip>:53: dial udp <ip>:53: connect: network is unreachable" module=state
Apr 15 07:40:20 raspberrypi mender[315]: level=info msg="State transition: update-check [Sync] -> error [Error]" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: level=info msg="handling error state, current error: transient error: update check request failed: Get https://hosted.mender.io/api/devices/v1/deployments/device/deployments/next?artifact_name=2018-11-13-raspbian-zicher&device_type=raspberrypi3: dial tcp: lookup hosted.mender.io on <ip>:53: dial udp <ip>:53: connect: network is unreachable" module=state
Apr 15 07:40:20 raspberrypi mender[315]: level=info msg="State transition: error [Error] -> idle [Idle]" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: level=info msg="authorization data present and valid" module=mender
Apr 15 07:40:20 raspberrypi mender[315]: level=info msg="State transition: idle [Idle] -> check-wait [Idle]" module=mender
The device needed to wait for 30mins (UpdatePollIntervalSeconds) to send a new pending device auth request. It uses a mender (stable) image made from a golden image of raspbian (stable) with mender-convert.
What I’m interested in is what state is safe to use to perform application configuration (auth to 3rd party systems, app config fetching to memory/tmp store…). I suppose some Idle or Sync state? I need to perform such operations only if the device is authorized on mender and in ready state.
Thanks in advance!