I’ve been working with Mender for a couple of weeks now, and I have been unable to perform a successful update. I’ve used mender-artifact to place a script (ArtifactReboot_Leave_00_waitForNetwork) in /etc/mender/scripts/ in the artifact that waits for a successful ping of our DNS server. However, this script never executes. The scripts I’ve added to the rootfs execute without issue. Any help to get beyond this issue would be appreciated.
Pretty sure this is relevant:
error: transient error: Reboot to new update failed. Expected “upgrade_available” flag to be true but it was false
But even before that, the log shows the state AfterReboot_Leave, but the script didn’t execute.
Here is an excerpt from the deployment log:
2019-12-04 23:33:12 +0000 UTC info: State transition: update-fetch [Download_Enter] → update-store [Download_Enter]
2019-12-04 23:33:12 +0000 UTC debug: handle update install state
2019-12-04 23:33:12 +0000 UTC debug: status reported, response 204 No Content
2019-12-04 23:33:12 +0000 UTC debug: Read data from device manifest file: device_type=raspberrypi3
2019-12-04 23:33:12 +0000 UTC debug: Current manifest data: raspberrypi3
2019-12-04 23:33:12 +0000 UTC info: no public key was provided for authenticating the artifact
2019-12-04 23:33:12 +0000 UTC debug: checking if device [raspberrypi3] is on compatible device list: [raspberrypi3]
2019-12-04 23:33:12 +0000 UTC debug: installer: successfully read artifact [name: gg2; version: 3; compatible devices: [raspberrypi3]]
2019-12-04 23:33:12 +0000 UTC debug: Trying to install update of size: 8984199168
2019-12-04 23:33:12 +0000 UTC debug: Active partition: /dev/mmcblk0p2
2019-12-04 23:33:12 +0000 UTC debug: Detected inactive partition /dev/mmcblk0p3, based on active partition /dev/mmcblk0p2
2019-12-04 23:33:12 +0000 UTC info: native sector size of block device /dev/mmcblk0p3 is 512, we will write in chunks of 1048576
2019-12-04 23:33:13 +0000 UTC info: opening device /dev/mmcblk0p3 for writing
2019-12-04 23:33:13 +0000 UTC info: partition /dev/mmcblk0p3 size: 8984199168
2019-12-05 00:06:37 +0000 UTC info: wrote 8984199168/8984199168 bytes of update to device /dev/mmcblk0p3
2019-12-05 00:06:39 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:06:39 +0000 UTC info: State transition: update-store [Download_Enter] → update-after-store [Download_Leave]
2019-12-05 00:06:39 +0000 UTC info: State transition: update-after-store [Download_Leave] → update-install [ArtifactInstall]
2019-12-05 00:06:39 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:39 +0000 UTC debug: start executing script: Download_Leave_00_downloadLeave
2019-12-05 00:06:39 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:06:40 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:06:40 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:40 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:06:40 +0000 UTC debug: Inactive partition: /dev/mmcblk0p3
2019-12-05 00:06:40 +0000 UTC debug: Marking inactive partition (/dev/mmcblk0p3) as the new boot candidate.
2019-12-05 00:06:40 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 3
2019-12-05 00:06:40 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-12-05 00:06:40 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-12-05 00:06:40 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-12-05 00:06:40 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-12-05 00:06:40 +0000 UTC debug: Marking inactive partition as a boot candidate successful.
2019-12-05 00:06:40 +0000 UTC info: State transition: update-install [ArtifactInstall] → reboot [ArtifactReboot_Enter]
2019-12-05 00:06:40 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:40 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:40 +0000 UTC debug: handling reboot state
2019-12-05 00:06:40 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:06:40 +0000 UTC info: rebooting device(s)
2019-12-05 00:06:40 +0000 UTC info: Mender rebooting from active partition: /dev/mmcblk0p2
2019-12-05 00:06:55 +0000 UTC info: Running Mender version 2.1.1
2019-12-05 00:06:55 +0000 UTC info: State transition: init [none] → after-reboot [ArtifactReboot_Leave]
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: upgrade_available=0
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:0]
2019-12-05 00:06:55 +0000 UTC error: transient error: Reboot to new update failed. Expected “upgrade_available” flag to be true but it was false
2019-12-05 00:06:55 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] → rollback [ArtifactRollback]
2019-12-05 00:06:55 +0000 UTC debug: transitioning to error state
2019-12-05 00:06:55 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:55 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:55 +0000 UTC info: performing rollback
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-12-05 00:06:55 +0000 UTC debug: Have U-Boot variable: upgrade_available=0
2019-12-05 00:06:55 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:0]
2019-12-05 00:06:55 +0000 UTC debug: will try to rollback reboot the device
2019-12-05 00:06:55 +0000 UTC info: State transition: rollback [ArtifactRollback] → rollback-reboot [ArtifactRollbackReboot_Enter]
2019-12-05 00:06:55 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:55 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:06:55 +0000 UTC info: rebooting device(s) after rollback
2019-12-05 00:06:55 +0000 UTC info: Mender rebooting from inactive partition: /dev/mmcblk0p2
2019-12-05 00:07:07 +0000 UTC info: Running Mender version 2.1.1
2019-12-05 00:07:07 +0000 UTC info: Update was interrupted in state: rollback-reboot
2019-12-05 00:07:07 +0000 UTC info: State transition: init [none] → verify-rollback-reboot [ArtifactRollbackReboot_Leave]
2019-12-05 00:07:07 +0000 UTC debug: transitioning to error state
2019-12-05 00:07:07 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-12-05 00:07:07 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-12-05 00:07:07 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-12-05 00:07:07 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-12-05 00:07:07 +0000 UTC debug: Have U-Boot variable: upgrade_available=0
2019-12-05 00:07:07 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:0]
2019-12-05 00:07:07 +0000 UTC info: State transition: verify-rollback-reboot [ArtifactRollbackReboot_Leave] → after-rollback-reboot [ArtifactRollbackReboot_Leave]
2019-12-05 00:07:07 +0000 UTC debug: handling state after rollback reboot
2019-12-05 00:07:07 +0000 UTC info: State transition: after-rollback-reboot [ArtifactRollbackReboot_Leave] → update-error [ArtifactFailure]
2019-12-05 00:07:07 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:07:07 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:07:07 +0000 UTC debug: handle update error state
2019-12-05 00:07:07 +0000 UTC info: State transition: update-error [ArtifactFailure] → cleanup [Error]
2019-12-05 00:07:07 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:07:07 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:07:07 +0000 UTC debug: Handling Cleanup state
2019-12-05 00:07:07 +0000 UTC info: State transition: cleanup [Error] → update-status-report [none]
2019-12-05 00:07:07 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-12-05 00:07:07 +0000 UTC debug: handle update status report state
2019-12-05 00:07:07 +0000 UTC error: failed to report status: Put https://ec2-***-***-***-***.compute-1.amazonaws.com/api/devices/v1/deployments/device/deployments/0cc289f8-9e09-41cd-b169-5cc0bd36b263/status: dial tcp: lookup ec2-***-***-***-***.compute-1.amazonaws.com on 10.9.8.8:53: dial udp 10.9.8.8:53: connect: network is unreachable
2019-12-05 00:07:07 +0000 UTC error: error reporting update status: reporting status failed: Put https://ec2-***-***-***-***.compute-1.amazonaws.com/api/devices/v1/deployments/device/deployments/0cc289f8-9e09-41cd-b169-5cc0bd36b263/status: dial tcp: lookup ec2-***-***-***-***.compute-1.amazonaws.com on 10.9.8.8:53: dial udp 10.9.8.8:53: connect: network is unreachable
2019-12-05 00:07:07 +0000 UTC error: failed to send status to server: transient error: reporting status failed: Put https://ec2-***-***-***-***.compute-1.amazonaws.com/api/devices/v1/deployments/device/deployments/0cc289f8-9e09-41cd-b169-5cc0bd36b263/status: dial tcp: lookup ec2-***-***-***-***.compute-1.amazonaws.com on 10.9.8.8:53: dial udp 10.9.8.8:53: connect: network is unreachable
2019-12-05 00:07:07 +0000 UTC info: State transition: update-status-report [none] → update-retry-report [none]
2019-12-05 00:10:18 +0000 UTC debug: wait complete
2019-12-05 00:10:18 +0000 UTC info: State transition: update-retry-report [none] → update-status-report [none]
2019-12-05 00:10:18 +0000 UTC debug: handle update status report state
2019-12-05 00:10:19 +0000 UTC debug: status reported, response 204 No Content
2019-12-05 00:10:19 +0000 UTC debug: attempting to upload deployment logs for failed update