# Troubles with Management API

**URL:** <https://hub.mender.io/t/troubles-with-management-api/244>\
**Category:** General Discussions\
**Tags:** api\
**Created:** [February 20, 2019, 5:41pm UTC](https://hub.mender.io/t/troubles-with-management-api/244 "2019-02-20T17:41:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbman35](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jbman35](https://hub.mender.io/u/jbman35)\
**Post date:** [February 20, 2019, 5:41pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/1 "2019-02-20T17:41:15Z")

</div>

Hello,

I am facing some troubles while using the management API.

When I am getting a list of devices using the GET “/api/management/v1/inventory/devices” URL by specifying attributes it works properly instead when I am doing it specifying a MAC address.

For instance:

- GET /devices?hostname=myhostname" works properly
- GET /devices?mac=01%3A72%3A47%3A11%3Af0%3A0f does not return any device while it actually exists (the URL is properly encoded)

Do you have any idea of what is wrong? Does the API support the encoded double dots of the MAC address?

Regards,

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [February 20, 2019, 6:18pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/2 "2019-02-20T18:18:41Z")

</div>

The actual key name is going to be something like mac\_eth0. You’ll need to know how your kernel enumerates the devices to filter directly. There was a bug where even using the proper mac\_\* name would not return anything. That is fixed in hosted but has not yet been release in an on-prem version.

---

<div class="post-metadata">

**Author:** ![jbman35](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jbman35](https://hub.mender.io/u/jbman35)\
**Post date:** [February 21, 2019, 7:42am UTC](https://hub.mender.io/t/troubles-with-management-api/244/3 "2019-02-21T07:42:01Z")

</div>

Thanks. I know how my kernel enumerates the MAC addresses, what I wrote above was only an example, in my real case I use mac\_eth0= to retrieve the device ID from the server.

So you confirm that it is not possible to get a device from the server by requesting it using “mac\_something” from the current version?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [February 21, 2019, 8:57pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/4 "2019-02-21T20:57:44Z")

</div>

Yes. The next release should have the bug fix.

---

<div class="post-metadata">

**Author:** ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)\
**Post date:** [August 6, 2019, 1:52am UTC](https://hub.mender.io/t/troubles-with-management-api/244/5 "2019-08-06T01:52:26Z")

</div>

@drewmoseley Was this encoding issue fixed in 1.7.1?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [August 6, 2019, 7:11pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/6 "2019-08-06T19:11:28Z")

</div>

Hello @SuicidalLabRat. Welcome to Mender Hub.  
It does not appear so. I verified that it is functional in 2.0.1.

---

<div class="post-metadata">

**Author:** ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)\
**Post date:** [August 6, 2019, 7:35pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/7 "2019-08-06T19:35:11Z")

</div>

_sigh_ We just finished a three week change control to upgrade to 1.7.1 for this fix. 😕

Thanks for the prompt response Drew!

---

<div class="post-metadata">

**Author:** ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)\
**Post date:** [August 6, 2019, 9:26pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/8 "2019-08-06T21:26:57Z")

</div>

…a couple follow up questions

1. In server 2.0.1, is only api/…/v2 fixed, or does the v1 api also include the fix?
2. Is server 2.0.1 fully backwards compatible with v1.7 clients. i.e. if I have 48,000 clients in the field, am I going to orphan them be deploying this fix via upgrading our server(s) from 1.7.1 -\> 2.0.1?

Thanks!

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [August 6, 2019, 10:48pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/9 "2019-08-06T22:48:33Z")

</div>

The server is definitely backwards compatible. I tested the v1 api and it did include the fix.  
@michaelatmender may know more about the specific fix in case there is a solution that can be appled on the 1.7 branch.

---

<div class="post-metadata">

**Author:** ![eystein](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@eystein](https://hub.mender.io/u/eystein)\
**Post date:** [August 7, 2019, 7:55pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/10 "2019-08-07T19:55:27Z")

</div>

There are no further 1.7 releases planned. It’s probably possible to “cherry-pick” this fix to 1.7.x yourself but I would not recommend that (it has not been tested).

So indeed I’d suggest upgrading to 2.0.1 – or (if you’re tired of upgrading) Hosted Mender 😉

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [August 8, 2019, 7:34am UTC](https://hub.mender.io/t/troubles-with-management-api/244/11 "2019-08-08T07:34:11Z")

</div>

If you need only this fix specifically, you can try upgrading only the inventory micro service. Mender 1.7.1 is using inventory 1.5.0, and Mender 2.0.1 is using inventory 1.6.0, so just make that update in the `docker-compose.yml` file in integration and restart. Like this:

```auto
diff --git a/docker-compose.yml b/docker-compose.yml
index 1ade855..7a9a32d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -63,7 +63,7 @@ services:
     # mender-inventory
     #
     mender-inventory:
- image: mendersoftware/inventory:1.5.0
+ image: mendersoftware/inventory:1.6.0
         extends:
             file: common.yml
             service: mender-base

```

I can’t guarantee that this will solve the problem, but worth a shot without a full upgrade.

---

<div class="post-metadata">

**Author:** ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)\
**Post date:** [August 9, 2019, 6:35pm UTC](https://hub.mender.io/t/troubles-with-management-api/244/12 "2019-08-09T18:35:07Z")

</div>

Awesome. Thanks for the updates guys, much appreciated!
