Hi,
As part of our customer requirement, downgrading of SW installed in the system should not be possible. I see there is no direct support for this feature using free version of mender.
Mender Client version: 2.6
I tried to achieve this functionality by using state script. I am executing the state script in Download_Enter state. The state script checks for the current artifact version and the incoming artifact version. If the new version is lower than the current version it exits with return code ‘1’.
During the testing I noticed that although the mender client aborts the deployment , the deployment status is still in progress in the mender server.
Status seen in mender server:
"downloading:
Executing script: Download_Enter_02_compare-artifact-version
"
If the box is restarted or the mender client is restarted, the download check is happening again. The client aborts the software update, but in the server the status is still in deployment.
Any idea how to abort the deployment also in the server when the download_enter state script fails?
Any other idea to do the version check is also welcome.
Logs:
Sep 29 07:49:21 mender[426]: time=“2021-09-29T07:49:21Z” level=info msg=“State transition: check-wait [Idle] → inventory-update [Sync]”
Sep 29 07:49:23 mender[426]: time=“2021-09-29T07:49:23Z” level=info msg=“State transition: inventory-update [Sync] → check-wait [Idle]”
Sep 29 07:49:23 mender[426]: time=“2021-09-29T07:49:23Z” level=info msg=“State transition: check-wait [Idle] → update-check [Sync]”
Sep 29 07:49:24 mender[426]: time=“2021-09-29T07:49:24Z” level=info msg="Correct request for getting image from: “…”
Sep 29 07:49:24 mender[426]: time=“2021-09-29T07:49:24Z” level=info msg=“State transition: update-check [Sync] → update-fetch [Download_Enter]”
Sep 29 07:49:24 mender[426]: time=“2021-09-29T07:49:24Z” level=info msg=“Executing script: Download_Enter_02_compare-artifact-version”
Sep 29 07:49:25 mender[426]: time=“2021-09-29T07:49:25Z” level=error msg=“transient error: error calling enter script for (error) update-fetch state: error running enter state script(s) for Download_Enter state: statescript: error executing ‘Download_Enter_02_compare-artifact-version’: 1 : exit status 1”
Sep 29 07:49:25 mender[426]: time=“2021-09-29T07:49:25Z” level=info msg=“State transition: update-fetch [Download_Enter] → error [Error]”
Sep 29 07:49:25 mender[426]: time=“2021-09-29T07:49:25Z” level=info msg=“Handling error state, current error: transient error: error calling enter script for (error) update-fetch state: error running enter state script(s) for Download_Enter state: statescript: error executing ‘Download_Enter_02_compare-artifact-version’: 1 : exit status 1”
Sep 29 07:49:25 mender[426]: time=“2021-09-29T07:49:25Z” level=info msg=“State transition: error [Error] → idle [Idle]”
Sep 29 07:49:25 mender[426]: time=“2021-09-29T07:49:25Z” level=info msg=“State transition: idle [Idle] → check-wait [Idle]”
Thanks & Regards,
Vinothkumar