I have created artifacts & .img using mender_convert tool. I have uploaded artifacts into Mender server GUI & triggered the deployments. At the end of deployment, after rebooting the target device but deployment status is showing as failed at Mender server GUI whereas at client side is showing latest artifact. It means that mender client success status is not updating to Mender server GUI,
2021-05-24 06:18:03 +0000 UTC error: Error rebooting device: signal: terminated … 2021-05-24 06:20:20 +0000 UTC error: fw_setenv returned failure: exit status 2 2021-05-24 06:20:20 +0000 UTC error: Failed to probe the U-Boot environment for which separator to use. Got error: exit status 2 2021-05-24 06:20:21 +0000 UTC error: transient error: update commit failed: exit status 2
Could you please assist me to resolve this issue. Below are the logs for your reference.
2021-05-24 05:55:52 +0000 UTC info: Running Mender client version: 2.6.0
2021-05-24 05:55:54 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2021-05-24 05:55:54 +0000 UTC info: No public key was provided for authenticating the artifact
2021-05-24 05:55:54 +0000 UTC info: Opening device "/dev/sda3" for writing
2021-05-24 05:55:54 +0000 UTC info: Native sector size of block device /dev/sda3 is 512 bytes. Mender will write in chunks of 1048576 bytes
2021-05-24 06:17:57 +0000 UTC info: All bytes were successfully written to the new partition
2021-05-24 06:17:57 +0000 UTC info: The optimized block-device writer wrote a total of 49729 frames, where 125 frames did need to be rewritten (i.e., skipped)
2021-05-24 06:17:58 +0000 UTC info: Wrote 52143587328/52143587328 bytes to the inactive partition
2021-05-24 06:18:00 +0000 UTC info: State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]
2021-05-24 06:18:00 +0000 UTC info: State transition: update-after-store [Download_Leave] -> update-install [ArtifactInstall]
2021-05-24 06:18:01 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 3
2021-05-24 06:18:02 +0000 UTC info: State transition: update-install [ArtifactInstall] -> reboot [ArtifactReboot_Enter]
2021-05-24 06:18:03 +0000 UTC info: Rebooting device(s)
2021-05-24 06:18:03 +0000 UTC info: Mender rebooting from active partition: /dev/sda2
2021-05-24 06:18:03 +0000 UTC info: Daemon terminated with SIGTERM
2021-05-24 06:18:03 +0000 UTC error: Error rebooting device: signal: terminated
2021-05-24 06:18:04 +0000 UTC info: State transition: reboot [ArtifactReboot_Enter] -> rollback [ArtifactRollback]
2021-05-24 06:20:17 +0000 UTC info: Running Mender client version: 2.6.0
2021-05-24 06:20:18 +0000 UTC info: State transition: init [none] -> after-reboot [ArtifactReboot_Leave]
2021-05-24 06:20:18 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> after-reboot [ArtifactReboot_Leave]
2021-05-24 06:20:18 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> update-commit [ArtifactCommit_Enter]
2021-05-24 06:20:19 +0000 UTC info: Committing update
2021-05-24 06:20:20 +0000 UTC error: fw_setenv returned failure: exit status 2
2021-05-24 06:20:20 +0000 UTC error: Failed to probe the U-Boot environment for which separator to use. Got error: exit status 2
2021-05-24 06:20:21 +0000 UTC error: transient error: update commit failed: exit status 2
2021-05-24 06:20:21 +0000 UTC info: State transition: update-commit [ArtifactCommit_Enter] -> rollback [ArtifactRollback]
2021-05-24 06:20:21 +0000 UTC info: Performing rollback
2021-05-24 06:20:24 +0000 UTC info: Rolling back to the inactive partition (2).
2021-05-24 06:20:26 +0000 UTC error: fw_setenv returned failure: exit status 1
2021-05-24 06:20:26 +0000 UTC error: Failed to probe the U-Boot environment for which separator to use. Got error: exit status 1
2021-05-24 06:20:26 +0000 UTC error: Rollback failed: exit status 1
2021-05-24 06:20:27 +0000 UTC error: fatal error: exit status 1
2021-05-24 06:20:27 +0000 UTC info: State transition: rollback [ArtifactRollback] -> update-error [ArtifactFailure]
2021-05-24 06:20:27 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2021-05-24 06:20:28 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]
Hi @Rohita83
Interesting that you should not find the fw_env.config file.
Any chance that you could give the commands you used for converting the image, and a download link to the image itself, so I could try and reproduce this?
again second time OTA has failed and appended [INCONSISTENT to artifact name.
After second OTA fw_printenv o/p is
bootcount=1
mender_boot_part=2
upgrade_available=0
mender_uboot_separator=
mender_boot_part_hex=2
2021-05-25 07:16:34 +0000 UTC info: Running Mender client version: 2.5.1
2021-05-25 07:16:35 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2021-05-25 07:16:35 +0000 UTC info: No public key was provided for authenticating the artifact
2021-05-25 07:16:35 +0000 UTC info: Opening device "/dev/sda2" for writing
2021-05-25 07:16:36 +0000 UTC info: Native sector size of block device /dev/sda2 is 512 bytes. Mender will write in chunks of 1048576 bytes
2021-05-25 07:40:47 +0000 UTC info: All bytes were successfully written to the new partition
2021-05-25 07:40:47 +0000 UTC info: The optimized block-device writer wrote a total of 49729 frames, where 22639 frames did need to be rewritten (i.e., skipped)
2021-05-25 07:40:49 +0000 UTC info: Wrote 52143587328/52143587328 bytes to the inactive partition
2021-05-25 07:40:50 +0000 UTC info: State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]
2021-05-25 07:40:50 +0000 UTC info: State transition: update-after-store [Download_Leave] -> update-install [ArtifactInstall]
2021-05-25 07:40:51 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 2
2021-05-25 07:40:52 +0000 UTC info: State transition: update-install [ArtifactInstall] -> reboot [ArtifactReboot_Enter]
2021-05-25 07:40:52 +0000 UTC info: Rebooting device(s)
2021-05-25 07:40:52 +0000 UTC info: Mender rebooting from active partition: /dev/sda3
2021-05-25 07:40:53 +0000 UTC error: Error rebooting device: signal: terminated
2021-05-25 07:40:54 +0000 UTC info: State transition: reboot [ArtifactReboot_Enter] -> rollback [ArtifactRollback]
2021-05-25 07:40:53 +0000 UTC info: Daemon terminated with SIGTERM
2021-05-25 07:43:08 +0000 UTC info: Running Mender client version: 2.5.1
2021-05-25 07:43:08 +0000 UTC info: State transition: init [none] -> after-reboot [ArtifactReboot_Leave]
2021-05-25 07:43:09 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> after-reboot [ArtifactReboot_Leave]
2021-05-25 07:43:09 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> update-commit [ArtifactCommit_Enter]
2021-05-25 07:43:10 +0000 UTC info: Committing update
2021-05-25 07:43:12 +0000 UTC error: fw_setenv returned failure: exit status 1
2021-05-25 07:43:12 +0000 UTC error: Failed to probe the U-Boot environment for which separator to use. Got error: exit status 1
2021-05-25 07:43:12 +0000 UTC error: transient error: update commit failed: exit status 1
2021-05-25 07:43:12 +0000 UTC info: State transition: update-commit [ArtifactCommit_Enter] -> rollback [ArtifactRollback]
2021-05-25 07:43:12 +0000 UTC info: Performing rollback
2021-05-25 07:43:14 +0000 UTC info: Rolling back to the inactive partition (3).
2021-05-25 07:43:15 +0000 UTC error: fw_setenv returned failure: exit status 1
2021-05-25 07:43:15 +0000 UTC error: Failed to probe the U-Boot environment for which separator to use. Got error: exit status 1
2021-05-25 07:43:15 +0000 UTC error: Rollback failed: exit status 1
2021-05-25 07:43:15 +0000 UTC error: fatal error: exit status 1
2021-05-25 07:43:16 +0000 UTC info: State transition: rollback [ArtifactRollback] -> update-error [ArtifactFailure]
2021-05-25 07:43:16 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2021-05-25 07:43:16 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]
surprising that above issue is observing in S3 bucket artifact storage in hosted mender server instead of EC2 minio artifact storage & also here first OTA is success but second or onward OTA is failing with the same image/artifacts.
Below is the sequence:
Flash the new image on the target device
small OTA push i.e. single file OTA update (~1 mins)
Full OS mender OTA update (~30 mins) ==> success deployment
again small OTA push i.e. single file OTA update (~1 mins)
again Full OS mender OTA update (~30 mins) ==> fail deployment as below screenshot
There are several things here which are a bit suspicious. Let’s look at the first issue to begin with:
Error rebooting device: signal: terminated
What the client expects, is that the reboot command succeeds, and then at some point later, the client is killed. But it looks like what’s happening here is that the command fails, but the reboot still happens. I suspect the reason is that the reboot command itself gets killed as part of the reboot, and never gets to report the success. The client is not taking this scenario into account.
If you have a chance to patch the client, can you try to apply this patch:
diff --git a/system/system.go b/system/system.go
index a96d7d8..c676058 100644
--- a/system/system.go
+++ b/system/system.go
@@ -33,10 +33,7 @@ func NewSystemRebootCmd(command Commander) *SystemRebootCmd {
}
func (s *SystemRebootCmd) Reboot() error {
- err := s.command.Command("reboot").Run()
- if err != nil {
- return err
- }
+ s.command.Command("reboot").Run()
// Wait up to ten minutes for reboot to kill the client, otherwise the
// client may mistake a successful return code as "reboot is complete,
Note that it needs to be applied to the client that you upgrade from, not the one upgrade to. So you may need to install it manually first, or flash the device from scratch.
Since i am using mender_convert v2.4.0 tool directly to make artifact which having mender_client version v2.6.0.
To apply above patch into mender_client, i need to modify mender_convert file mender-convert-modify and create deb package for this. Please let me know if i am wrong. could you please assist me to make this deb package.
Since we are on mender Client 2.6, there is a change in the changelog as below screenshot that was dated back in April 2021, titled “mender-binary-delta (1.2.1)” where it mentions that there has been a fix for the incorrect status during a rollback when the bootloader is being used. Would this change be a part of the Client 2.6 release? Or would I have to upgrade the server to 2.7 to get these changes? is the above change relevant to the issue that I am experiencing?
I will also test the change that u have mentioned above and will come back with the result.
The mender-binary-delta version is independent of both the client and the server, it should work with either. It depends on which version you have installed from here.
We are switching to a new changelog structure in the development version of our docs, split into component pages. This avoids everything being lumped together like it is now, which is hopefully easier to understand and follow. Check it out here.
As per you provided mender deb package, I have modified mender convert utility to include this mender client package to create mender artifact as below
Note: Here i have rename your client package name as deb_name=mender-client_2.6.0-LOCAL_amd64.deb
Attached mender convert log for reference. convert.log.yml (26.3 KB)
After creation artifact (i.e. alto_p3_upgV2.6_20210601_Testserver_TEST .mender) & upload it into server GUI successfully, I have triggered OTA update twice but unfortunately it failed, attached logs screenshots for reference below as log-1
Note: Additionally I have seen that OTA deployment (multiple attempts) is not consistent in mender v2.6 with S3 bucket artifact storage as below observations.
@kacf
Additional information, earlier I was using mender version 2.6 with self-hosted Minio (EC2) based storage configuration that OTA deployment time was long ~2 hrs 30 mins but i was not experience this above issue. Once i have switched AWS S3 based storage configuration, the OTA deployment time has down ~30 mins only but having this above mention issue randomly (sometimes its success and sometimes fail). Here I don’t think this error related to S3 based configuration but just it is my observation.
Ok, so at least we got rid of that error. I’d really like to isolate the problem on the client side. Any chance you can copy the artifact onto the device, or to a memory stick, and install it using standalone mode? This would give us a chance to figure out exactly what is going on.
Assuming you have put the artifact in /data/artifact.mender, do these steps to do a manual install:
mender install /data/artifact.mender
reboot
# At this stage, maybe try "fw_printenv" to verify that the
# environment is working correctly.
mender commit