# Mender setup at ECS

**URL:** <https://hub.mender.io/t/mender-setup-at-ecs/1847>\
**Category:** General Discussions\
**Tags:** mender-server\
**Created:** [April 27, 2020, 12:30pm UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847 "2020-04-27T12:30:59Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 27, 2021, 9:44am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/21 "2021-04-27T09:44:57Z")

</div>

@imort to be fully honest, I have no idea why you are facing these issues, but ECS is not a deployment set up we officially support. I would suggest you to try 2.7, and if Traefik is the issue, you can still use the old nginx-based API gateway with minor modifications to the configuration file to expose the new micro services available in 2.7

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 27, 2021, 10:11am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/22 "2021-04-27T10:11:08Z")

</div>

Sorry if it looks like I blaming anyone or expecting some free support in my specific case 🙂  
It’s not, I was really surprized by strange issue, while v2.3 deployment was relatively smooth, that’s all.

Working on bringing v2.7 running on ECS right now, I’ll update that thread later if you don’t mind.

Thank you for all your kind help!

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 27, 2021, 10:12am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/23 "2021-04-27T10:12:45Z")

</div>

@imort sure, let me know how it goes. 🙂

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 28, 2021, 12:07pm UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/24 "2021-04-28T12:07:45Z")

</div>

Well, 2.7 works as expected, just finished basic tests.

I’ll add a few pull requests, mostly updating config.yaml docs for services. There are services which using a default inventory address, and no sign of that in config.yaml. Has to look to the config.go to make it rolling in the end.

Thank you for all your help here! 🙂

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 28, 2021, 12:09pm UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/25 "2021-04-28T12:09:27Z")

</div>

@imort glad to read Mender 2.7 worked fined, ping me in the PRs so I can prioritize them. 🙂

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 30, 2021, 5:16am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/26 "2021-04-30T05:16:51Z")

</div>

Migrated from v2.3 to v2.7.

Find the cause of my workflow duplicate record ID issue btw: the race condition between create-artifact-worker and workflow-worker.  
Solution: add --excluded-workflows=\<all\_workflow\_queues\> for create-artifact-worker.

Have issues after the migration though: no existing devices found after migration.  
Tried,

> $ deviceauth propagate-inventory  
> $ deviceauth propagate-inventory-statuses  
> $ deviceauth propagate-inventory-id-data

Now I can see rejected devices, that’s all.  
A new device was accepted successfully: pending → accepted, all good.

I can see that old and new devices have different documents scheme in inventory.devices:

Old device: [Mender old device record - Pastebin.com](https://pastebin.com/PzDpx98k)  
New device: [Mender new device inventory record - Pastebin.com](https://pastebin.com/KbGKTKDM)

Can you please advice?

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 30, 2021, 5:41am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/27 "2021-04-30T05:41:47Z")

</div>

@imort the old devices should have been migrated by the inventory service when running migrations. Are you running the services in automigrate mode? If not, can you please run “inventory migrate” in the inventory container?

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 30, 2021, 5:54am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/28 "2021-04-30T05:54:13Z")

</div>

It’s on, and I can see it in the inventory container logs:

> time=“2021-04-30T05:52:04Z” level=info msg=“migration to version 0.2.0 skipped” db=inventory file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
> time=“2021-04-30T05:52:04Z” level=info msg=“migration to version 1.0.0 skipped” db=inventory file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
> time=“2021-04-30T05:52:04Z” level=info msg=“migration to version 1.0.1 skipped” db=inventory file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
> time=“2021-04-30T05:52:04Z” level=info msg=“migration to version 1.0.2 skipped” db=inventory file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
> time=“2021-04-30T05:52:04Z” level=info msg= **“DB migrated to version 1.0.2”** db=inventory file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=140  
> time=“2021-04-30T05:52:04Z” level=info msg=“Inventory Service, version unknown starting up”  
> time=“2021-04-30T05:52:04Z” level=info msg=“setting up prod middleware” file=middleware.go func=main.SetupMiddleware line=130  
> time=“2021-04-30T05:52:04Z” level=info msg=“listening on :8080”  
> time=“2021-04-30T05:52:04Z” level=info msg= **“automigrate is ON, will apply migrations”** file=migrations.go func=“mongo.(\*DataStoreMongo).Migrate” line=100  
> time=“2021-04-30T05:52:04Z” level=info msg=“migrating inventory” file=migrations.go func=“mongo.(\*DataStoreMongo).Migrate” line=106  
> time=“2021-04-30T05:52:04Z” level=info msg=“migrating inventory” file=migrations.go func=“mongo.(\*DataStoreMongo).MigrateTenant” line=43

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 30, 2021, 6:03am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/29 "2021-04-30T06:03:00Z")

</div>

@imort were those “old device” records in the mongodb when the migrations ran the first time? Mender runs migration script only once, when it detects the migration has not been applied. If you restore/add records after the migration was executed, those records won’t be automatically migrated.

The migration responsible for updating the schema is 1.0.0, you could try removing the corresponding document in `migration_info` and run migrations again, but this could lead to undesired effects if you are mixing old-style and new-style documents in the devices collection.

See: [inventory/migration\_1\_0\_0.go at master · mendersoftware/inventory · GitHub](https://github.com/mendersoftware/inventory/blob/master/store/mongo/migration_1_0_0.go)

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 30, 2021, 6:38am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/30 "2021-04-30T06:38:03Z")

</div>

Rolled back to the MongoDB backup before migration, restarted all services:

> time=“2021-04-30T06:28:52Z” level=info msg=“ **Set revision to 0 for 93 devices** ” file=migration\_1\_0\_2.go func=“mongo.(\*migration\_1\_0\_2).Up” line=44

All documents in `inventory.devices` now have revision=0, can it be the problem?

Checked a device before and after, scheme was changed: `attributes` now have `inventory-*` and `system-*` keys inside.

Still no old devices in the UI (

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 30, 2021, 7:35am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/31 "2021-04-30T07:35:52Z")

</div>

Devices migrated from v2.3 to v2.7 didn’t have a few fields in the `inventory.devices`:

![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/1/1236530685bbaa30ebcfa5e2c4faeba8723a3214.png)

Added manually, device appears in the inventory.  
Last check-in was before the migration, so looks like I’ll have to deal with `deviceauth` too.

---

<div class="post-metadata">

**Author:** ![imort](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/imort/32/678_2.png) [@imort](https://hub.mender.io/u/imort)\
**Post date:** [April 30, 2021, 10:53am UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/32 "2021-04-30T10:53:03Z")

</div>

Confirming: adding two keys above works.  
Device appears in the inventory, Mender receiving updates, deployment works.

Thank you very much @tranchitella for all your help and patience here!

I hope this thread will help someone else later to save some time 🙂

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [April 30, 2021, 6:29pm UTC](https://hub.mender.io/t/mender-setup-at-ecs/1847/33 "2021-04-30T18:29:36Z")

</div>

@imort glad to know you solved your issues!

[Previous page](https://hub.mender.io/t/mender-setup-at-ecs/1847.md?page=1)
