# Mender Authentication Error

**URL:** <https://hub.mender.io/t/mender-authentication-error/3062>\
**Category:** General Discussions\
**Tags:** yocto, hosted-mender, zeus, imx8mq\
**Created:** [January 12, 2021, 1:25pm UTC](https://hub.mender.io/t/mender-authentication-error/3062 "2021-01-12T13:25:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [January 12, 2021, 1:25pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/1 "2021-01-12T13:25:51Z")

</div>

Hi,

I ran into following error when I try to onboard a new device.

**Authorize failed: transient error: authorization request failed: (request\_id: ): authentication request rejected server error message: dev auth: unauthorized**

```auto
Jan 12 13:20:42 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:42Z" level=error msg="Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized"
Jan 12 13:20:42 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:42Z" level=error msg="Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized"
Jan 12 13:20:42 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:42Z" level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]"
Jan 12 13:20:47 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:47Z" level=info msg="State transition: authorize-wait [Idle] -> authorize [Sync]"
Jan 12 13:20:47 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:47Z" level=error msg="Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized"
Jan 12 13:20:47 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:47Z" level=error msg="Authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: dev auth: unauthorized"
Jan 12 13:20:47 imx8mq-itx-p-c444 mender[491]: time="2021-01-12T13:20:47Z" level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]"

```

Also I referred the Hub and output of `/usr/share/mender/identity/mender-device-identity` is,

```auto
using interface /sys/class/net/eth0
mac=00:01:45:09:ca:7c

```

and my `mender.conf` is:

```auto
{
    "InventoryPollIntervalSeconds": 5,
    "RetryPollIntervalSeconds": 5,
    "ServerURL": "https://hosted.mender.io",
    "TenantToken": "MENDER_TENET_TOKEN",
    "UpdatePollIntervalSeconds": 5
}

```

Any help would be much appreciated.

### UPDATE 1:

When I try using other account ([hosted.mender.io](http://hosted.mender.io)) it is working fine. Is it something related to Mender accounts?

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:06pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/2 "2021-01-12T14:06:04Z")

</div>

last time i checked the output of mender-device-identity should only be key-value pairs,  
Have you pre-authorized/accepted the new device you are trying to connect in the server UI ?

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [January 12, 2021, 2:08pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/3 "2021-01-12T14:08:36Z")

</div>

No, nothing of that sort.

I’m still getting the same output for the `mender-device-identty` but it is working fine in other account.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:14pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/4 "2021-01-12T14:14:31Z")

</div>

so the output of your mender-device-identity is:

```auto
mac=00:01:45:09:ca:7c

```

and not

```auto
using interface /sys/class/net/eth0
mac=00:01:45:09:ca:7c

```

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [January 12, 2021, 2:15pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/5 "2021-01-12T14:15:30Z")

</div>

```auto
root@imx8mq-itx-p-c444:~# /usr/share/mender/identity/mender-device-identity 
using interface /sys/class/net/eth0
mac=00:01:45:09:ca:7c
root@imx8mq-itx-p-c444:~# 

```

But when I execute that command I receive the above output. What does that mean?

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:20pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/6 "2021-01-12T14:20:53Z")

</div>

the output of mender-device-identity should only contain key value/pairs or comments, so i don’t know how the mender client parser will handle what you have as output. You need to remove the following line from your mender-device-identity script

```auto
using interface /sys/class/net/eth0

```

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:22pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/7 "2021-01-12T14:22:47Z")

</div>

if you didnt write the mender-device-identity script you are using then its probably an upstream bug

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:26pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/8 "2021-01-12T14:26:56Z")

</div>

ignore that, i’m wrong, i have just checked the upstream script and the line i suggested you remove is going to stderr not stdout so thats why you are seeing both on the terminal. The mender client will almost certainly only parse from stdout

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [January 12, 2021, 2:39pm UTC](https://hub.mender.io/t/mender-authentication-error/3062/9 "2021-01-12T14:39:13Z")

</div>

just to recap, you should always get an unauthorized 401 from the server for a new device the first time you connect it unless you have already pre-authorized it some how. Double check the new device is not in the pending devices section of the server.

apart from that i don’t use [hosted.mender.io](http://hosted.mender.io) so I’m, not sure what you mean by “accounts” but I would expect your TenantToken to be different to what you have in your config file, but as i said I’m not familar with this setup sorry.
