ArtifactInstall and ArtifactCommit state scripts are not getting executed, only Download script is executing

ArtifactInstall and ArtifactCommit state scripts are not getting executed, only Download scripts are executing, any reason ? Tried single, multiple artifacts and update custom module installation, all deployments are successful and can see updates on client.

List of state scripts

root@ip-172-31-41-140:/etc/mender/scripts# ls -lrt
total 40
-rw-r--r-- 1 root root    1 Feb 20 18:49 version
-rwxr-xr-x 1 root root  437 Jul  5 13:07 ArtifactInstall_Enter_02_user-confirm-test2
-rwxr-xr-x 1 root root  437 Jul  5 13:08 ArtifactCommit_Enter_03_user-confirm-test3
-rwxr-xr-x 1 root root  438 Jul  5 13:39 Download_Enter_01_user-confirm-test
-rwxr-xr-x 1 root root  438 Jul  5 13:40 Download_Leave_04_user-confirm-test4
-rwxr-xr-x 1 root root  368 Jul  7 03:48 ArtifactCommit_Enter_00
-rwxr-xr-x 1 root root  366 Jul  7 03:49 ArtifactReboot_Enter_00
-rwxr-xr-x 1 root root  392 Jul  7 03:50 ArtifactCommit_Enter_01

Mender client logs

Jul 07 05:58:18 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:18Z" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"
Jul 07 05:58:18 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:18Z" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Jul 07 05:58:18 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:18Z" level=info msg="State transition: update-check [Sync] -> check-wait [Idle]"
Jul 07 05:58:18 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:18Z" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"
Jul 07 05:58:33 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:33Z" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]"
Jul 07 05:58:33 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:33Z" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]"
Jul 07 05:58:33 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:33Z" level=info msg="Validating the Update Info: https://hosted-mender-artifacts.s3.amazonaws.com/643fb5a/1efed1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQWI%2F20230707%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230707T055833Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D%22web-file-10_76.mender%22&response-content-type=application%2Fvnd.mender-artifact&x-id=GetObject&X-Amz-Signature=d5e388528 [name: web-file-10_76; devices: [qemux86-64]]"
Jul 07 05:58:33 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:33Z" level=info msg="State transition: update-check [Sync] -> update-fetch [Download_Enter]"
Jul 07 05:58:33 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:58:33Z" level=info msg="Executing script: Download_Enter_01_user-confirm-test"
Jul 07 05:59:03 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:03Z" level=info msg="Collected output (stderr) while running script /etc/mender/scripts/Download_Enter_01_user-confirm-test\nmender:web-file-10_67: Download_Enter_01_user-confirm-test was called!\nmender:Returning 0 from /etc/mender/scripts/Download_Enter_01_user-confirm-test state script\n\n---------- end of script output"
Jul 07 05:59:03 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:03Z" level=info msg="Running Mender client version: 3.5.0"
Jul 07 05:59:04 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:04Z" level=info msg="State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]"
Jul 07 05:59:04 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:04Z" level=info msg="No public key was provided for authenticating the artifact"
Jul 07 05:59:06 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:06Z" level=info msg="State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]"
Jul 07 05:59:06 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:06Z" level=info msg="State transition: update-after-store [Download_Leave] -> mender-update-control-refresh-maps [none]"
Jul 07 05:59:06 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:06Z" level=info msg="Executing script: Download_Leave_04_user-confirm-test4"
Jul 07 05:59:34 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:34Z" level=info msg="Collected output (stderr) while running script /etc/mender/scripts/Download_Leave_04_user-confirm-test4\nmender:web-file-10_67: Download_Leave_04_user-confirm-test4 was called!\nmender:Returning 0 from /etc/mender/scripts/Download_Leave_04_user-confirm-test4 state script\n\n---------- end of script output"
Jul 07 05:59:34 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:34Z" level=info msg="State transition: mender-update-control-refresh-maps [none] -> mender-update-control [none]"
Jul 07 05:59:34 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:34Z" level=info msg="State transition: mender-update-control [none] -> update-install [ArtifactInstall]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: update-install [ArtifactInstall] -> mender-update-control-refresh-maps [none]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: mender-update-control-refresh-maps [none] -> mender-update-control [none]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: mender-update-control [none] -> update-commit [ArtifactCommit_Enter]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="Device unauthorized; attempting reauthorization"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="Output (stderr) from command \"/usr/share/mender/identity/mender-device-identity\": using interface /sys/class/net/eth0"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="successfully received new authorization data from server https://hosted.mender.io"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="Local proxy stopped" thread=proxy
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=error msg="Proxy Shutdown failed: context canceled\n" thread=proxy
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="Local proxy started" thread=proxy
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="Reauthorization successful"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: update-commit [ArtifactCommit_Enter] -> update-after-first-commit [none]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: update-after-first-commit [none] -> update-after-commit [ArtifactCommit_Leave]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: update-after-commit [ArtifactCommit_Leave] -> cleanup [none]"
Jul 07 05:59:35 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:35Z" level=info msg="State transition: cleanup [none] -> update-status-report [none]"
Jul 07 05:59:36 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:36Z" level=info msg="State transition: update-status-report [none] -> idle [Idle]"
Jul 07 05:59:36 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:36Z" level=info msg="State transition: idle [Idle] -> check-wait [Idle]"
Jul 07 05:59:36 ip-172-31-41-140 mender[117273]: time="2023-07-07T05:59:36Z" level=info msg="State transition: check-wait [Idle] -> inventory-update [Sync]"

are there any conditions for ArtifactInstall and ArtifactCommit scripts to execute ?

Regards,
Naresh

found solution https://hub.mender.io/t/state-scripts-do-not-get-executed/3901/4?u=nareshtech20

As mentioned in artifact-creation state-scripts

Blockquote
The reason for having both root filesystem and Artifact scripts is related to the fact that some scripts must run before the Client downloads the Artifact and as such can not be delivered with the Artifact. Those scripts are Idle , Sync and Download . Therefore it is important to remember that when deploying a new update, all scripts will be run from the currently running root filesystem until ArtifactInstall , at which point the scripts from the new Artifact will take over.
Blockquote

Only Idle, Sync, Download state scripts can be on device, remaining states scripts ArtifactInstall, ArtifactReboot, ArtifactCommit, ArtifactRollback, ArtifactRollbackReboot, ArtifactFailure should be part of artifact itself.

1 Like