Ask for help with "transient error: failed to read environment variable: exit status 247" prevents deployment of Yocto image on Raspi3b+

Hi all,

I am using a Raspi 3 image with integrated mender client: https://d4o6e0uccgv40.cloudfront.net/2021-01-11-raspios-buster-armhf-lite/arm/2021-01-11-raspios-buster-armhf-lite-raspberrypi3-mender-2.6.0.img.xz

I followed the amazingly helpful guidelines in Raspberry Pi 3 Model B/B+. I can successfully generate the image and upload it as an artifact. However, when running a deployment to Raspi 3b, I get an error “transient error: failed to read environment variable: exit status 247” and deployment is in status “failure”:

2021-07-04 09:28:17 +0000 UTC info: Running Mender client version: 2.6.0
2021-07-04 09:28:18 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2021-07-04 09:28:18 +0000 UTC info: No public key was provided for authenticating the artifact
2021-07-04 09:28:18 +0000 UTC info: Opening device "/dev/mmcblk0p3" for writing
2021-07-04 09:28:18 +0000 UTC info: Native sector size of block device /dev/mmcblk0p3 is 512 bytes. Mender will write in chunks of 1048576 bytes
2021-07-04 09:28:46 +0000 UTC info: All bytes were successfully written to the new partition
2021-07-04 09:28:46 +0000 UTC info: The optimized block-device writer wrote a total of 201 frames, where 8 frames did need to be rewritten (i.e., skipped)
2021-07-04 09:28:46 +0000 UTC info: Wrote 209715200/209715200 bytes to the inactive partition
2021-07-04 09:28:46 +0000 UTC info: State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]
2021-07-04 09:28:46 +0000 UTC info: State transition: update-after-store [Download_Leave] -> update-install [ArtifactInstall]
2021-07-04 09:28:46 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 3
2021-07-04 09:28:46 +0000 UTC info: State transition: update-install [ArtifactInstall] -> reboot [ArtifactReboot_Enter]
2021-07-04 09:28:46 +0000 UTC info: Rebooting device(s)
2021-07-04 09:28:47 +0000 UTC info: Mender rebooting from active partition: /dev/mmcblk0p2
2021-07-04 09:28:47 +0000 UTC info: Daemon terminated with SIGTERM
2021-07-04 09:31:03 +0000 UTC info: Running Mender client version: 2.6.0
2021-07-04 09:31:03 +0000 UTC info: State transition: init [none] -> after-reboot [ArtifactReboot_Leave]
2021-07-04 09:31:03 +0000 UTC error: transient error: failed to read environment variable: exit status 247
2021-07-04 09:31:03 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> rollback [ArtifactRollback]
2021-07-04 09:31:03 +0000 UTC info: Performing rollback
2021-07-04 09:31:03 +0000 UTC error: Rollback failed: Could not determine whether device has an update: failed to read environment variable: exit status 247
2021-07-04 09:31:03 +0000 UTC error: fatal error: Could not determine whether device has an update: failed to read environment variable: exit status 247
2021-07-04 09:31:03 +0000 UTC info: State transition: rollback [ArtifactRollback] -> update-error [ArtifactFailure]
2021-07-04 09:31:03 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2021-07-04 09:31:03 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]

Any hints on where to look for a root cause?

Thanks, Andrei

Hi @andreisv,

If the links are correct, it seems you are generating the initial image that you flash into your raspberry using the Debian-based system RaspiOS (first link) and the mender-convert tool. For generating the artifact, you are using the tutorial created for Yocto-based images (second link). If that is the case, both workflows are not compatible between them.

If you use RaspiOS and mender-convert (first one), you have to follow this other tutorial: Raspberry Pi 3 Model B/B+ Raspbian, and it will generate a compatible artifact (with *.mender extension) that will work out of the box with your current system.

If you want to stick with the Yocto workflow (second link), you need to generate only the Yocto-based images/systems and you don’t need to use the RaspiOS system you downloaded initially.

Hope it helps to clarify. Have a great day! :slight_smile:
Luis