# .mender file incomplete

**URL:** <https://hub.mender.io/t/mender-file-incomplete/797>\
**Category:** General Discussions\
**Tags:** yocto, raspberry-pi-3, thud\
**Created:** [July 5, 2019, 4:38pm UTC](https://hub.mender.io/t/mender-file-incomplete/797 "2019-07-05T16:38:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [July 5, 2019, 4:38pm UTC](https://hub.mender.io/t/mender-file-incomplete/797/1 "2019-07-05T16:38:05Z")

</div>

I’m having issues signing my artifacts since a few days. I did some digging, and somehow the .mender files are incomplete. mender-artifact read shows the rootfs image is over 200MB big, but the .mender file itself is only 90MB. I’m using version 2 of the artifact format.

The mender-artifact version is 3.0.1. Am I missing something obvious?

I already cleared out the cache of my yocto installation twice.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [July 5, 2019, 4:51pm UTC](https://hub.mender.io/t/mender-file-incomplete/797/2 "2019-07-05T16:51:42Z")

</div>

> [@mterwoord](#):
>
> I’m having issues signing my artifacts since a few days. I did some digging, and somehow the .mender files are incomplete. mender-artifact read shows the rootfs image is over 200MB big, but the .mender file itself is only 90MB. I’m using version 2 of the artifact format.

The Mender Artifact (`.mender`) is compressed, so it is expected to be smaller then the rootfs image.

Can you share the errors you are seeing, or steps to reproduce the problems you are experiencing.

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [July 6, 2019, 9:17am UTC](https://hub.mender.io/t/mender-file-incomplete/797/3 "2019-07-06T09:17:11Z")

</div>

The issue is that mender-artifact sign, gives the following error:

Could not finalize tar archive: archive/tar: missed writing 90393524 bytes

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [July 6, 2019, 9:30am UTC](https://hub.mender.io/t/mender-file-incomplete/797/4 "2019-07-06T09:30:27Z")

</div>

Ouch. Turns out, that using mender-artifact 2.4.1, it just works, but with 3.0.1, i get the mentioned error.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [July 6, 2019, 1:24pm UTC](https://hub.mender.io/t/mender-file-incomplete/797/5 "2019-07-06T13:24:52Z")

</div>

Hm, yepp. I can see it as well.

This worked just fine,

```auto
mender-artifact write rootfs-image -t beaglebone -n mender-2.0.1 -f core-image-base-beaglebone-yocto-grub.ext4 -k private.key -o artifact-signed.mender

```

But trying to sign an existing artifact gave me a similar error to yours,

```auto
$ mender-artifact sign artifact.mender -k private.key -o artifact-signed.mender
Could not finalize tar archive: archive/tar: missed writing 37277864 bytes

```

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [July 6, 2019, 1:29pm UTC](https://hub.mender.io/t/mender-file-incomplete/797/6 "2019-07-06T13:29:24Z")

</div>

Created a bug,

[https://tracker.mender.io/browse/MEN-2631](https://tracker.mender.io/browse/MEN-2631)

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [July 6, 2019, 4:02pm UTC](https://hub.mender.io/t/mender-file-incomplete/797/7 "2019-07-06T16:02:56Z")

</div>

Don’t have time to test this yet, but can I use an old (2.4.1) mender-artifact to sign directory artifacts?

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [July 8, 2019, 6:31am UTC](https://hub.mender.io/t/mender-file-incomplete/797/8 "2019-07-08T06:31:12Z")

</div>

Did some investigation: If the artifact is less than 1M, than it should work with 3.0.1. If it’s larger, than unfortunately you cannot sign a directory artifact with that command (2.4.1 lacks the functionality, and 3.0.1 has the bug). However, you can sign it with 3.0.1 while making the initial artifact, like this:

```auto
directory-artifact-gen <OTHER_OPTIONS> -- -k private.key

```

You may get a message that the verification fails with the provided key, but this is just because the `directory-artifact-gen` script isn’t smart enough to pass the correct key to `mender-artifact`. You can verify it manually with `mender-artifact read -k public.key <ARTIFACT>`.
