Artifact deployment failed in RPi

Hi,
I’m new to Mender, so I might ask some basic questions. For exploring Mender, I converted a raw image into Mender client. Then copied the image file into another SD card and added a new directory and file in home/pi/ as a marker. Then converted this image file and used the (.mender) file i-e: Artifact to update the client. Uploaded the Artifact in releases tab, then created deployment. My deployment fails by giving this error:

> 2020-07-10 09:35:26 +0000 UTC error: transient error: Reboot to new update failed. Expected “upgrade_available” flag to be true but it was false
I searched for this issue but couldn’t find it. Your help is appreciated.
My deployment log:

2020-07-10 09:28:22 +0000 UTC info: Running Mender client version: 2.3.0b1
2020-07-10 09:28:24 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2020-07-10 09:28:24 +0000 UTC info: No public key was provided for authenticating the artifact
2020-07-10 09:28:24 +0000 UTC info: Opening device “/dev/mmcblk0p3” for writing
2020-07-10 09:28:24 +0000 UTC info: Native sector size of block device /dev/mmcblk0p3 is 512 bytes. Mender will write in chunks of 1048576 bytes
2020-07-10 09:35:13 +0000 UTC info: All bytes were successfully written to the new partition
2020-07-10 09:35:13 +0000 UTC info: The optimized block-device writer wrote a total of 1924 frames, where 0 frames did need to be rewritten (i.e., skipped)
2020-07-10 09:35:13 +0000 UTC info: Wrote 2017259520/2017259520 bytes to the inactive partition
2020-07-10 09:35:15 +0000 UTC info: State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]
2020-07-10 09:35:15 +0000 UTC info: State transition: update-after-store [Download_Leave] -> update-install [ArtifactInstall]
2020-07-10 09:35:15 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 3
2020-07-10 09:35:15 +0000 UTC info: State transition: update-install [ArtifactInstall] -> reboot [ArtifactReboot_Enter]
2020-07-10 09:35:15 +0000 UTC info: Rebooting device(s)
2020-07-10 09:35:15 +0000 UTC info: Mender rebooting from active partition: /dev/mmcblk0p2
2020-07-10 09:35:26 +0000 UTC info: Running Mender client version: 2.3.0b1
2020-07-10 09:35:26 +0000 UTC info: State transition: init [none] -> after-reboot [ArtifactReboot_Leave]
2020-07-10 09:35:26 +0000 UTC error: transient error: Reboot to new update failed. Expected “upgrade_available” flag to be true but it was false
2020-07-10 09:35:26 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> rollback [ArtifactRollback]
2020-07-10 09:35:26 +0000 UTC info: Performing rollback
2020-07-10 09:35:26 +0000 UTC info: State transition: rollback [ArtifactRollback] -> rollback-reboot [ArtifactRollbackReboot_Enter]
2020-07-10 09:35:27 +0000 UTC info: Rebooting device(s) after rollback
2020-07-10 09:35:27 +0000 UTC info: Mender rebooting from inactive partition: /dev/mmcblk0p2
2020-07-10 09:35:40 +0000 UTC info: Running Mender client version: 2.3.0b1
2020-07-10 09:35:40 +0000 UTC info: Mender shut down in state: rollback-reboot
2020-07-10 09:35:40 +0000 UTC info: State transition: init [none] -> verify-rollback-reboot [ArtifactRollbackReboot_Leave]
2020-07-10 09:35:40 +0000 UTC info: State transition: verify-rollback-reboot [ArtifactRollbackReboot_Leave] -> after-rollback-reboot [ArtifactRollbackReboot_Leave]
2020-07-10 09:35:40 +0000 UTC info: State transition: after-rollback-reboot [ArtifactRollbackReboot_Leave] -> update-error [ArtifactFailure]
2020-07-10 09:35:40 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2020-07-10 09:35:40 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]

Hi @usman, welcome to Mender hub.

I’m not understanding your workflow here. Can you share more details? Specifically I need to understand what OS/Distro your initial image was using, the exact details of how you converted it and the commands used to copy the image into and off of the SDCard.

Regards,
Drew Moseley

1 Like

Thank you for your warm welcome.
Actually, I went through this tutorial (Raspberry Pi 3 Model B/B+ Raspbian). Downloaded the Raspbian Linux 10 Buster Lite from (raspberrypi.org) as mentioned in tutorial. Built docker image for mender-convert, then converted the image to support Mender. Copied token as I used Mender Professional. Then, used the below mentioned commands.

./scripts/bootstrap-rootfs-overlay-hosted-server.sh
–output-dir ${PWD}/rootfs_overlay_demo
–tenant-token “Paste token from Mender Professional”

MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert
–disk-image input/2020-02-05-raspbian-buster-lite.img
–config configs/raspberrypi3_config
–overlay ./rootfs_overlay_demo

After the images were made in deploy folder, I used etcher to burn the .img.gz file into the SD-card. Once the SD-card booted I checked device connection on Mender Professional it was connected after sometime. Then created a new directory and a new file as marker. Used WIN32 disk imager to read .img of updated firmware, then did the mender-convert steps again. When it completed and images were produced then uploaded the .mender file to Mender Professional under the releases section, then created deployment.

Hi @drewmoseley, I’m looking forward for your reply. Thanks

I was able to reproduce this. It appears to be related to using the sdimg file as the input rather than the stock single rootfs partition image. It seems to mistake the u-boot binary with the kernel binary when using SDIMG as input. I created a PR with a proposed solution here: https://github.com/mendersoftware/mender-convert/pull/224

@usman if you can try that PR in your local setup and let me know whether it works for you that would be most helpful.

Drew

I have applied the solution you proposed in PR into my local setup. Then tested with raw image by creating a marker (text file), it was successful. Artifact was uploaded without errors, and the new active Rootfs had the marker in it. Thanks a lot for your help.
Regards,
Usman