# "Why Mender Enables Deployment with the Same Artifacts?"

**URL:** <https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701>\
**Category:** General Discussions\
**Created:** [March 21, 2023, 8:02pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701 "2023-03-21T20:02:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 21, 2023, 8:02pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/1 "2023-03-21T20:02:12Z")

</div>

Hello. I would like to understand why Mender allows me to deploy with the same artifacts. Let me explain better with an example:  
Suppose we have two modules which I will call mod\_a and mod\_b, and 2 artifacts, one for mod\_a called depl\_a and one for mod\_b called depl\_b.

Mender allows me to perform the following operations:

1. Deploy depl\_a
2. Deploy depl\_b
3. Repeat operation 1

---

<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:** [March 21, 2023, 8:06pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/2 "2023-03-21T20:06:17Z")

</div>

Hi @PinoRinaudo,

I would love to answer, but some essential pieces of information are missing. Are we talking about two different update modules? Two different kinds of devices? Generally a deployment:artifact is a 0…n:1 relation, an artifact can be used in an arbitrary number of deployments. A common use case is rolling out to different fleet parts, for example.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 22, 2023, 9:53am UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/3 "2023-03-22T09:53:53Z")

</div>

First of all, thank you for your prompt response.  
The device is the same. There are two different modules, both of which are in the same device.

---

<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:** [March 22, 2023, 10:21am UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/4 "2023-03-22T10:21:15Z")

</div>

@PinoRinaudo

Ok, and what do you mean exactly by “module”? An update module as described in the [documentation](https://docs.mender.io/artifact-creation/create-a-custom-update-module)?

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 22, 2023, 2:45pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/5 "2023-03-22T14:45:17Z")

</div>

By module, I mean a custom script that is executed when I perform a deployment

---

<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:** [March 22, 2023, 3:12pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/6 "2023-03-22T15:12:19Z")

</div>

Hi @PinoRinaudo

so one of these? [Create a custom Update Module | Mender documentation](https://docs.mender.io/artifact-creation/create-a-custom-update-module)

Ok, so I think I understood the setup. What is the actual problem then? Unless you add the force installation flag, the artifact won’t be reinstalled. Just because something is in a deployment, it does not necessarily mean that it is always installed on all matching devices: the usual dependency and state checks still apply.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 22, 2023, 3:55pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/7 "2023-03-22T15:55:53Z")

</div>

The issue is that I can reinstall the same artifact twice on the same device. After installing artifact x\_v1 (module A) and then y\_v1 (module B), I can reinstall artifact x\_v1. This could be a big problem. Mender should, and perhaps does, keep track of the last installed artifact but for each module.

---

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 28, 2023, 2:27pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/8 "2023-03-28T14:27:51Z")

</div>

In practice, I can deploy the same artifact multiple times on the same device.

---

<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:** [March 28, 2023, 2:36pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/9 "2023-03-28T14:36:54Z")

</div>

@PinoRinaudo no, the client will not accept the artifact unless “force install” is selected. Just being able to have the same device/artifact combination in two deployments die not necessarily mean that the artifact is installed twice.

Beyond that, there are valid use cases for installing an artifact twice. That’s what the “force installation” flag in a deployment is for.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![PinoRinaudo](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PinoRinaudo](https://hub.mender.io/u/PinoRinaudo)\
**Post date:** [March 30, 2023, 10:09am UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/10 "2023-03-30T10:09:27Z")

</div>

The following examples refer to the same device, therefore the same IP, MAC, etc…  
If I create a deployment twice with the same artifact, the second deployment is skipped, with the message “already installed”. For example:

1. Deploying artifact example\_v1.0
2. Deploying artifact example\_v1.0 ← this is skipped

Note that the artifact example\_1.0 is taken care of by script s1. So far, everything is normal.

The problem arises when I create two deployments of identical artifacts but there is another deployment of an artifact in between that is taken care of by another script/module. For example:

1. Deploying artifact example\_v1.0
2. Deploying artifact example\_2\_v1.0
3. Deploying artifact example\_v1.0 ← this is NOT skipped

the “forced install” flag is not set.

---

<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:** [April 2, 2023, 6:51pm UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/11 "2023-04-02T18:51:42Z")

</div>

Hi @PinoRinaudo,

After talking to the devs, it seems that this is a side effect of [this ticket](https://northerntech.atlassian.net/browse/MEN-6096), and it should be rolled out soon with the 3.5.2 release.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![AlanAtIOOOTA](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@AlanAtIOOOTA](https://hub.mender.io/u/AlanAtIOOOTA)\
**Post date:** [September 12, 2023, 9:01am UTC](https://hub.mender.io/t/why-mender-enables-deployment-with-the-same-artifacts/5701/12 "2023-09-12T09:01:44Z")

</div>

Hello @TheYoctoJester,

has this been included in the 3.6 release cycle? I did look at the release notes for mender 3.6+ but could not find any mention to it…
