# Mender-convert and mender-configure artifact interference

**URL:** <https://hub.mender.io/t/mender-convert-and-mender-configure-artifact-interference/6343>\
**Category:** General Discussions\
**Tags:** raspberry-pi-3, mender-convert, mender-artifact, mender-configure\
**Created:** [November 16, 2023, 11:22am UTC](https://hub.mender.io/t/mender-convert-and-mender-configure-artifact-interference/6343 "2023-11-16T11:22:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitrijsan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dmitrijsan/32/1942_2.png) [@dmitrijsan](https://hub.mender.io/u/dmitrijsan)\
**Post date:** [November 16, 2023, 11:22am UTC](https://hub.mender.io/t/mender-convert-and-mender-configure-artifact-interference/6343/1 "2023-11-16T11:22:18Z")

</div>

Hey guys,

Its me again. I have encountered an expected behaviour which I am unsure how to tailor to my scenario. Let me elaborate.

I am using `mender-convert` with an `mender_create_artifact` hook. This results in 2 important files in my case:

- a flashable `*.img` file to commission new devices (this is the approach I have taken)
- `*.mender` artifact, which is to be deployed to the current fleet to bring devices in the field up to date

After flashing `*.img` file I am receiving from mender convert, I am using `mender-configure` to setup hostname and timezone. After all that, I am deploying `*.mender` artifact, generated via mender-convert to the entire fleet.

The fleet receive the artifact update and follows the usual routine. However, the newly commissioned device does receive the artifact too.

Below is step-by-step scenario I am following:

1. Use mender-convert to generate `*.img` and `*.mender` artifact
2. Flash `*.img` to a device
3. Accept newly commisioned device on a dashboard
4. _Deploy mender-configure artifact to finalise setting the device up_
5. Deploy `*.mender` artifact generated via mender-convert

In this case, a newly comissioned device **accepts** the update and proceeds to download and install it.

Additionally, I have tested another scenario without using `mender-configure`. In this case I am getting a desired behaviour:

1. Use mender-convert to generate `*.img` and `*.mender` artifact
2. Flash `*.img` to a device
3. Accept newly commissioned device on a dashboard
4. Deploy `*.mender` artifact generated via mender-convert

In this case, a newly commissioned device **rejects** the update as it is already installed.

Since `mender-configure` follows a usual artifact flow, it seem to overwrite the latest installed artifact meta data. This makes the client think that mender-convert artifact is not installed, so it proceeds downloading and installing it. However, in my case, I want client to reject this update as it is already installed.

How can I ensure that A/B artifact is not applied after using `mender-configure`? Can I achieve so via usage of depends/provides? Or do I need to change my deployment strategy?

Looking forward for your responses.

---

<div class="post-metadata">

**Author:** ![dmitrijsan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dmitrijsan/32/1942_2.png) [@dmitrijsan](https://hub.mender.io/u/dmitrijsan)\
**Post date:** [November 16, 2023, 4:15pm UTC](https://hub.mender.io/t/mender-convert-and-mender-configure-artifact-interference/6343/2 "2023-11-16T16:15:44Z")

</div>

After RTFM and testing out deployments, I have figured out the exact deployment strategy I have to follow:

1. Use mender-convert to generate `*.img` and `*.mender` artifact
2. Flash `*.img` to a device
3. Deploy `*.mender` artifact generated via mender-convert
4. Accept newly commisioned device on a dashboard
5. Deploy mender-configure artifact to finalise setting newly comissioned device up

I realised, I am using static groups. Hence, start of a deployment will deploy only to the devices **already existing within the targeted deployment group**. Hence, I have to deploy artifact _before_ I accept device authorisation on a dashboard (aka comission device via the dashboard). `*.mender` artifact deployment will start without having new device targeted for the deployment because device is simply not comissioned yet. And when device is comissioned - deployment group is not having newly comissioned device in it, so update will not be applied to newly comissioned device.
