Mender 2.5.0 Problems with Filters, Hostnames and More

Hi Mender Folks,

We just upgraded our Mender server from 2.4.0 to 2.5.0 after making the necessary undocumented manual mongodb upgrades. In the web GUI, we’re finding that the filters in All Devices aren’t working for hostname and hostname is not being displayed when it is selected as the Default device identity attribute. Since we use hostname to identify devices in the field, this problem has rendered the mender GUI in 2.5.0 almost useless for our needs. We’re going to have to revert to 2.4.0 so that we can find our devices.

Additionally, we noticed the unassigned group is in static at the very end of the devices list. This seems like an unintuitive location for it.

Hi @ckelloug2,

thanks for using Mender and I’m sorry to hear 2.5.0 is causing issues for you.

Can you please try entering the deviceauth container, e.g. running:

$ docker exec -it <name of your deviceauth container> sh

Then, from the container, you can run:

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

This will sync all inventory, statuses and identity_data attributes from deviceauth to inventory.

Please let us know if it solves your issue.

Regarding the unassigned group, it is only relevant for statically grouped devices, since a device might join a dynamic group any moment. So a list of unassigned devices that takes all groups (static and dynamic) into account might be outdated the second it is sent from the backend. Does this clarify the location a bit? With that in mind, would you consider a different location to be more intuitive?

@mzedel
Sorry for the slow response. We were dealing with some other things.
I have remerged 2.5.0 into our setup and run the commands that you suggested in the deviceauth container.

Default device identity attribute now works in chrome but not firefox 80.0.1. It seems to be some sort of UI bug in the web application.

In Firefox on the devices screen, The default device identity attribute dialog is only showing Device ID and status most of the time and is not showing the option for hostname. I clicked this dialog several times and one time it did show hostname and I selected it. It appeared that hostname was shown as an option after I clicked on one of the devices in the devices menu.

Hostname is showing on the device identity screen only when I click on one of the devices. It then goes away if I click refresh.

With filters on the devices screen, I select a hostname from one of the devices and do filters hostname equals ourhostname and no devices are found even though I selected a hostname that’s known to exist.

Since this works in chrome we’re okay for the moment.

We’ve downgraded back to 2.4.0 after trying the fix from @mzedel Hostnames worked for a while after the fix when using chrome but after a few days they no longer worked. Hopefully this gets fixed soon as we can’t use 2.5.0 if it doesn’t consistently show hostnames.

@mzedel
I’ve tried the upgrade again running commands that you recommended after upgrading from 2.4.0 to 2.7.0 going through all minor releases individually. deviceauth propagate-inventory-statuses gets an error and doesn’t run and this seems to keep us from being able to fix the problem with filters we were seeing.

/ # deviceauth propagate-inventory-statuses
INFO[2021-10-01T22:32:38Z] propagating inventory for all tenants file=commands.go func=cmd.selectDbs line=250
INFO[2021-10-01T22:32:38Z] propagating device statuses to inventory from DB: deviceauth-59dfac7b7d6f0d005800c396 file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=349
ERRO[2021-10-01T22:32:38Z] request POST http://mender-inventory:8080/api/internal/v1/inventory/tenants/59dfac7b7d6f0d005800c396/devices/pending failed with status 409 Conflict, response: {“error”:“write conflict”,“request_id”:“b30d78fa-ba53-4f61-81cc-828801b52db8”} file=client.go func=“inventory.(*client).SetDeviceStatus” line=136
INFO[2021-10-01T22:32:38Z] Done with DB deviceauth-59dfac7b7d6f0d005800c396 status=pending, but there were errors: POST http://mender-inventory:8080/api/internal/v1/inventory/tenants/59dfac7b7d6f0d005800c396/devices/pending request failed with status 409 Conflict. file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=365
INFO[2021-10-01T22:32:38Z] Done with DB deviceauth-59dfac7b7d6f0d005800c396 status=rejected file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=368
INFO[2021-10-01T22:32:38Z] Done with DB deviceauth-59dfac7b7d6f0d005800c396 status=accepted file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=368
INFO[2021-10-01T22:32:38Z] Done with DB deviceauth-59dfac7b7d6f0d005800c396 status=preauthorized file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=368
INFO[2021-10-01T22:32:38Z] Done with DB deviceauth-59dfac7b7d6f0d005800c396 status=noauth file=commands.go func=cmd.tryPropagateStatusesInventoryForDb line=368
ERRO[2021-10-01T22:32:38Z] giving up on DB deviceauth-59dfac7b7d6f0d005800c396 due to fatal error: POST http://mender-inventory:8080/api/internal/v1/inventory/tenants/59dfac7b7d6f0d005800c396/devices/pending request failed with status 409 Conflict file=commands.go func=cmd.PropagateStatusesInventory line=209
INFO[2021-10-01T22:32:38Z] all DBs processed, exiting. file=commands.go func=cmd.PropagateStatusesInventory line=214
POST http://mender-inventory:8080/api/internal/v1/inventory/tenants/59dfac7b7d6f0d005800c396/devices/pending request failed with status 409 Conflict

I looked around in mongodb and found two databases with one item each in them. The databases were inventory-59dfac7b7d6f0d005800c396 and deviceauth-59dfac7b7d6f0d005800c396. On a hunch, I dropped both databases since other records we keep made it obvious that the data was stale. I ran all three of the commands from @mzedel and instead of failing, all three commands ran successfully and we got our search capability back.

Thanks for posting the commands needed to update deviceauth and inventory.