# Mender 2.0 beta / mender-artifact 3.0.0b1: "Error selecting images for modification: error validating signature"

**URL:** <https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497>\
**Category:** General Discussions\
**Tags:** thud\
**Created:** [April 24, 2019, 8:53am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497 "2019-04-24T08:53:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://hub.mender.io/u/jostor)\
**Post date:** [April 24, 2019, 8:53am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/1 "2019-04-24T08:53:10Z")

</div>

I have upgraded to mender 2.0 beta and mender-artifact 3.0.0b1. When I try signing my mender artifact I get this error: “Error selecting images for modification: error validating signature”.  
When using mender 1.6 and mender-artifact version 2.3.0 with the same key, it was working as it should. I am using thud branch  
Any suggestions?

Thanks for your help!

---

<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:** [April 24, 2019, 8:55am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/2 "2019-04-24T08:55:26Z")

</div>

Hi @jostor,

Can you share the full command that you are running?

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://hub.mender.io/u/jostor)\
**Post date:** [April 24, 2019, 8:58am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/3 "2019-04-24T08:58:37Z")

</div>

I am running./mender-artifact modify artifact-signed.mender -k private.key

Just realized there is also a mender-artifact sign command. This command runs without errors. What is the difference?

---

<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:** [April 24, 2019, 8:59am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/4 "2019-04-24T08:59:00Z")

</div>

Oki, I see it

```auto
$ mender-artifact modify my-update-1.0-signed.mender -k private.key
Error selecting images for modification: error validating signature

```

```auto
$ mender-artifact -version
mender-artifact version 3.0.0b1

```

---

<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:** [April 24, 2019, 9:07am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/5 "2019-04-24T09:07:51Z")

</div>

The difference is different code paths but I do not have detailed insights in this part. This looks like a bug to me and I have created a bug in the tracker where you can track progress of this.

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

Thanks for reporting.

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://hub.mender.io/u/jostor)\
**Post date:** [April 24, 2019, 9:09am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/6 "2019-04-24T09:09:04Z")

</div>

Ok, thanks for your help!

---

<div class="post-metadata">

**Author:** ![lluiscampos](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lluiscampos/32/112_2.png) [@lluiscampos](https://hub.mender.io/u/lluiscampos)\
**Post date:** [April 24, 2019, 1:15pm UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/7 "2019-04-24T13:15:36Z")

</div>

Hi @jostor and welcome to Mender Hub!

I am working in the bug you reported. I actually found two related issues, but not yet the root cause for yours.

I need to better understand your workflow. I think you do something like:

1. Create the artifact with `mender-artifact write rootfs ...` (not signed)
2. Then signing it with `mender-artifact modify -k ...`

Is that correct? That workflow is not how mender-artifact is meant to be used. And it fails the same way for me in v2.3.0 and v3.0.0b1

Are you doing something else?

Thanks!

---

<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:** [April 24, 2019, 2:41pm UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/8 "2019-04-24T14:41:04Z")

</div>

@jostor, some further investigation from our side and it seems that the error you reported (or similar) has been present for a long time and last time this worked was in `2.2.0` version of `mender-artifact`.

Would be really helpful if you can share the exact commands you used and version when it worked, and when it did not.

I have added some additional information to the [ticket](https://tracker.mender.io/browse/MEN-2486) and would like to see that we get comparable results to eliminate that it would be something environment specific.

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://hub.mender.io/u/jostor)\
**Post date:** [April 30, 2019, 9:22am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/9 "2019-04-30T09:22:29Z")

</div>

Hi,  
Sorry for replying so late. I have been busy with other stuff the last week, and had not checked this thread until today.  
I have been building mender artifact with yocto.  
After this I have been using the command found here: [https://docs.mender.io/2.0/artifacts/signing-and-verification#an-existing-mender-artifact](https://docs.mender.io/2.0/artifacts/signing-and-verification#an-existing-mender-artifact)  
`mender-artifact modify artifact-signed.mender -k private.key`  
This was working fine before upgrading meta-mender, mender and mender-artifact.  
The version I had of mender-artifact before was 2.3.0. Now I have 3.0.0b1

What is the correct way to sign the artifact after building it with bitbake?

Please let me know if you need additional information.

---

<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:** [April 30, 2019, 9:55am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/10 "2019-04-30T09:55:05Z")

</div>

You can use the following command to sign artifacts:

```auto
mender-artifact sign -k private.key artifact-signed.mender

```

Doing this trough the `modify` command seemed to have some limitations and we have actually dropped the support of signing using `modify` completely in the upcoming `3.0.0` release.

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://hub.mender.io/u/jostor)\
**Post date:** [April 30, 2019, 10:19am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/11 "2019-04-30T10:19:58Z")

</div>

Thanks! I switched to the sign command last week, and it looks like it is working ok.

Another thing: Are there any documentation describing how to upgrade to the newest versions (mender 2 and mender-artifact 3)? When I have built a version 3 mender artifact, this isn’t compatible with Mender 1.6.x / mender-artifact 2.3.x (which is on my device right now), so I cannot upload this to my device. I guess I have to build a version 2 artifact which is including mender 2 and mender-artifact 3, and after uploading this, I can upload version 3 artifacts. Is this correct?

---

<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:** [April 30, 2019, 10:58am UTC](https://hub.mender.io/t/mender-2-0-beta-mender-artifact-3-0-0b1-error-selecting-images-for-modification-error-validating-signature/497/12 "2019-04-30T10:58:43Z")

</div>

That is correct. You first must update to the 2.0 client, before you can utilize the Mender Artifact V3.
