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

**URL:** <https://hub.mender.io/t/artifactinstall-and-artifactcommit-state-scripts-are-not-getting-executed-only-download-script-is-executing/5985>\
**Category:** General Discussions\
**Tags:** update-modules, state-scripts, new-install\
**Created:** [July 7, 2023, 6:23am UTC](https://hub.mender.io/t/artifactinstall-and-artifactcommit-state-scripts-are-not-getting-executed-only-download-script-is-executing/5985 "2023-07-07T06:23:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nareshtech20](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nareshtech20](https://hub.mender.io/u/nareshtech20)\
**Post date:** [July 7, 2023, 6:23am UTC](https://hub.mender.io/t/artifactinstall-and-artifactcommit-state-scripts-are-not-getting-executed-only-download-script-is-executing/5985/1 "2023-07-07T06:23:53Z")

</div>

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**

```auto
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**

```auto
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]"

```

---

<div class="post-metadata">

**Author:** ![nareshtech20](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nareshtech20](https://hub.mender.io/u/nareshtech20)\
**Post date:** [July 7, 2023, 10:24am UTC](https://hub.mender.io/t/artifactinstall-and-artifactcommit-state-scripts-are-not-getting-executed-only-download-script-is-executing/5985/2 "2023-07-07T10:24:15Z")

</div>

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

Regards,  
Naresh

---

<div class="post-metadata">

**Author:** ![nareshtech20](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nareshtech20](https://hub.mender.io/u/nareshtech20)\
**Post date:** [July 7, 2023, 5:10pm UTC](https://hub.mender.io/t/artifactinstall-and-artifactcommit-state-scripts-are-not-getting-executed-only-download-script-is-executing/5985/3 "2023-07-07T17:10:51Z")

</div>

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

As mentioned in [artifact-creation state-scripts](https://docs.mender.io/artifact-creation/state-scripts#root-filesystem-and-artifact-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.
