# Artifact fails to install because of unexpected EOF

**URL:** <https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429>\
**Category:** General Discussions\
**Created:** [November 19, 2022, 12:09pm UTC](https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429 "2022-11-19T12:09:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pamolloy](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pamolloy/32/1789_2.png) [@pamolloy](https://hub.mender.io/u/pamolloy)\
**Post date:** [November 19, 2022, 12:09pm UTC](https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429/1 "2022-11-19T12:09:51Z")

</div>

Building the artifact in Buildroot:

```auto
$ make
...
buildroot/output/host/usr/bin/mender-artifact write rootfs-image --file buildroot/output/images/rootfs.ext4 --output-path buildroot/output/images/foo-rootfs.mender --artifact-name foo-rootfs --device-type foo
Writing Artifact...
Version ✓
Manifest ✓
Manifest signature ✓
Header ✓
Payload
.............................................................. - 100 %
$ buildroot/output/host/usr/bin/mender-artifact --version
mender-artifact version 3.8.0

```

Attempting to install the artifact on the target:

```auto
# mender install ./foo-rootfs.mender 
INFO[0000] Loaded configuration file: /etc/mender/mender.conf 
INFO[0000] Mender running on partition: /dev/mmcblk0p2  
INFO[0000] Start updating from local image file: [./foo-rootfs.mender] 
Installing Artifact of size 26459648...
INFO[0000] No public key was provided for authenticating the artifact 
ERRO[0000] Reading headers failed: installer: failed to read Artifact: readHeaderV3: handleHeaderReads: r
eadHeader: readNext: Failed to get next header: reader: error reading archive: unexpected EOF 
ERRO[0000] installer: failed to read Artifact: readHeaderV3: handleHeaderReads: readHeader: readNext: Fai
led to get next header: reader: error reading archive: unexpected EOF 
# mender --version
3.4.0 runtime: go1.18.6

```

Note that when I upload the `rootfs.ext4` directly to [hosted.mender.io](http://hosted.mender.io), which should generate a Mender artifact, I do not have this issue. Instead I run into the following:

> [@Deployment fails because of 500 Internal Server Error from hosted.mender.io](https://hub.mender.io/t/deployment-fails-because-of-500-internal-server-error-from-hosted-mender-io/5431):
>
> After starting a deployment based on an artifact generated by [hosted.mender.io](http://hosted.mender.io), the client on the target repeatedly logs the following: Nov 19 12:29:40 buildroot mender[6756]: time="2022-11-19T12:29:40Z" level=error msg="Error receiving scheduled update data: failed to check update info on the server. Response: &{500 Internal Server Error 500 HTTP/1.1 1 1 map[Connection:[keep-alive] Content-Length:[66] Content-Type:[application/json] Date:[Sat, 19 Nov 2022 12:29:37 GMT] Referrer-Policy:[no-refe…

---

<div class="post-metadata">

**Author:** ![pamolloy](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pamolloy/32/1789_2.png) [@pamolloy](https://hub.mender.io/u/pamolloy)\
**Post date:** [November 21, 2022, 10:28am UTC](https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429/2 "2022-11-21T10:28:20Z")

</div>

I downloaded the pre-built `mender-artifact` version 3.9 and built a new artifact. That artifact installed successfully on the target.

---

<div class="post-metadata">

**Author:** ![pamolloy](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pamolloy/32/1789_2.png) [@pamolloy](https://hub.mender.io/u/pamolloy)\
**Post date:** [November 21, 2022, 10:36am UTC](https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429/3 "2022-11-21T10:36:37Z")

</div>

I bumped the version in Buildroot from 3.8.0 to 3.9.0 and it appears to also work successfully.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [November 22, 2022, 4:19pm UTC](https://hub.mender.io/t/artifact-fails-to-install-because-of-unexpected-eof/5429/4 "2022-11-22T16:19:34Z")

</div>

Thanks for sharing the solution!
