# Mender dunfell local update issue

**URL:** <https://hub.mender.io/t/mender-dunfell-local-update-issue/3381>\
**Category:** Board Integrations\
**Tags:** yocto, dunfell\
**Created:** [March 16, 2021, 6:16pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381 "2021-03-16T18:16:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [March 16, 2021, 6:16pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/1 "2021-03-16T18:16:06Z")

</div>

Hello,  
I’m upgrading my project from warrior to dunfell.  
I’ve generated a yocto-mender image for machine jetson-tx2. The flash is successful. But I have got the following error while I attempt a local update. Can someone help me to get through

> ```
> INFO[0000] Start updating from local image file: [test-image-custom-jetson-tx2.mender] 
> 
> ```
> 
> Installing Artifact of size 389511680…  
> INFO[0000] No public key was provided for authenticating the artifact  
> INFO[0000] Opening device “/dev/mmcblk0p33” for writing  
> INFO[0000] Native sector size of block device /dev/mmcblk0p33 is 512 bytes. Mender will write in chunks of 1048576 bytes  
> … - 100 %  
> INFO[0029] All bytes were successfully written to the new partition  
> INFO[0029] The optimized block-device writer wrote a total of 3892 frames, where 0 frames did need to be rewritten (i.e., skipped)  
> INFO[0029] Wrote 4080218112/4080218112 bytes to the inactive partition  
> INFO[0029] Enabling partition with new image installed to be a boot candidate: 33  
> INFO[0030] Collected output (stderr) while running script /var/lib/mender/scripts/ArtifactInstall\_Leave\_80\_bl-update  
> /usr/bin/setup-nv-boot-control: line 19: /etc/nv\_boot\_control.conf: No such file or directory  
> chmod: cannot operate on dangling symlink ‘/etc/nv\_boot\_control.conf’  
> ERR: bootloader update failed
> 
> ---------- end of script output  
> ERRO[0030] ArtifactInstall\_Leave script failed: statescript: error executing ‘ArtifactInstall\_Leave\_80\_bl-update’: 1 : exit status 1  
> Rolling back Artifact…  
> INFO[0031] Rolling back to the active partition: (1).  
> ERRO[0031] statescript: error executing ‘ArtifactInstall\_Leave\_80\_bl-update’: 1 : exit status 1

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [March 18, 2021, 2:33pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/2 "2021-03-18T14:33:47Z")

</div>

Hi, I will certainly do my very best.

To start off with, it seems one of your `State Scripts` are failing.  
What happens if you run an update without this state script?

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [March 19, 2021, 12:49pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/3 "2021-03-19T12:49:03Z")

</div>

@oleorhagen I’ve following error if I try to run without the StateScripts

```
ERRO[0030] ArtifactInstall_Leave script failed: statescript: error executing 'ArtifactInstall_Leave_80_bl-update': -1 : fork/exec /var/lib/mender/scripts/ArtifactInstall_Leave_80_bl-update: exec format error 
Rolling back Artifact...

```

I was debugging the statescripts, it’s not only one, **install** and **commit** scripts were failing for **jetson-tx2** machine and **install** script were failing for **jetson-xavier.**

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [March 22, 2021, 11:25am UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/4 "2021-03-22T11:25:49Z")

</div>

Hi, just to establish a common baseline:

Can you run `mender-artifact read <artifact_name>` and post the output?

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [March 22, 2021, 11:31am UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/5 "2021-03-22T11:31:33Z")

</div>

Mender artifact:  
Name: tegra-custom  
Format: mender  
Version: 3  
Signature: no signature  
Compatible devices: ‘[jetson-tx2]’  
Provides group:  
Depends on one of artifact(s): []  
Depends on one of group(s): []  
State scripts:  
ArtifactCommit\_Enter\_80\_bl-check-update  
ArtifactInstall\_Leave\_80\_bl-update  
ArtifactRollback\_Leave\_80\_bl-rollback

Updates:  
0:  
Type: rootfs-image  
Provides:  
rootfs-image.checksum: 2a31f04a8361de5e86067436df5bc23b73356fd0eecb3b6e4e32e5ded7b8d243  
rootfs-image.version: tegra-custom  
Depends: Nothing  
Metadata: Nothing  
Files:  
name: tegra-custom-jetson-tx2.ext4  
size: 4080218112  
modified: 2021-03-22 12:05:59 +0100 CET  
checksum: 2a31f04a8361de5e86067436df5bc23b73356fd0eecb3b6e4e32e5ded7b8d243

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [March 22, 2021, 12:25pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/6 "2021-03-22T12:25:25Z")

</div>

Well, considering the scripts are still in there,

can you pase the scripts here?

Also, a good way to help diagnose `State Scripts` are to write to stderr from the script. This will get collected in the client logs, and shown upon error.

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [March 22, 2021, 1:17pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/7 "2021-03-22T13:17:03Z")

</div>

@oleorhagen [meta-mender-community/meta-mender-tegra/recipes-mender/tegra-state-scripts/files at e4e7c212e92db7edc7cb5bd94499cf48d249a93c · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/tree/e4e7c212e92db7edc7cb5bd94499cf48d249a93c/meta-mender-tegra/recipes-mender/tegra-state-scripts/files)

Here is the state scripts I’m using. Indeed the state scripts is failing at different points.

List of issues:

1. Can’t operate in a dangling point. _[Line](https://github.com/mendersoftware/meta-mender-community/blob/e4e7c212e92db7edc7cb5bd94499cf48d249a93c/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot#L57)_

2. Sometimes it outputs invalid value than expected. **[Line](https://github.com/mendersoftware/meta-mender-community/blob/e4e7c212e92db7edc7cb5bd94499cf48d249a93c/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot#L32)**

3. Invalid ouptut: **[Line](https://github.com/mendersoftware/meta-mender-community/blob/e4e7c212e92db7edc7cb5bd94499cf48d249a93c/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot#L8)**

4. Invalid output **[Line](https://github.com/mendersoftware/meta-mender-community/blob/e4e7c212e92db7edc7cb5bd94499cf48d249a93c/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script#L35)**

I’ve fixed them myself. And It’s working now 🙂

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [March 22, 2021, 1:20pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/8 "2021-03-22T13:20:51Z")

</div>

@anishmonachan that is great!

We would really love a PR too, if you have fixed issues in the setup 🙂

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [March 22, 2021, 1:21pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/9 "2021-03-22T13:21:25Z")

</div>

Sure!  
I’ll create a PR 🙂

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [March 22, 2021, 1:21pm UTC](https://hub.mender.io/t/mender-dunfell-local-update-issue/3381/10 "2021-03-22T13:21:59Z")

</div>

And mark the issue as resolved 🙂
