# MQTT connection error: API key not found

**URL:** <https://www.thethingsnetwork.org/forum/t/mqtt-connection-error-api-key-not-found/56286>\
**Category:** Uncategorized\
**Tags:** mqtt\
**Created:** [April 5, 2022, 6:20am UTC](https://www.thethingsnetwork.org/forum/t/mqtt-connection-error-api-key-not-found/56286 "2022-04-05T06:20:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![UtkarshPanara](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/utkarshpanara/32/35697_2.png) [@UtkarshPanara](https://www.thethingsnetwork.org/forum/u/UtkarshPanara)\
**Post date:** [April 5, 2022, 6:20am UTC](https://www.thethingsnetwork.org/forum/t/mqtt-connection-error-api-key-not-found/56286/1 "2022-04-05T06:20:52Z")

</div>

Hello,

I am running TTS v3.18.1 on my server. I am using Node-Red to connect with MQTT to get the sensor data. I created API key for MQTT integration using TTS console. My Node-Red MQTT node shoes `connected` status and I am able to receive the data. However, on the TTS console live data stream it keeps showing `Fail to connect to MQTT` `API key not found`.

```auto
{
  "name": "as.mqtt.connect.fail",
  "time": "2022-04-05T06:18:27.854411667Z",
  "identifiers": [
    {
      "application_ids": {
        "application_id": "temp-hum"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/identityserver",
    "name": "api_key_not_found",
    "message_format": "API key not found",
    "correlation_id": "c94fb3a169aa40fab16b58017a106467",
    "cause": {
      "namespace": "pkg/identityserver/gormstore",
      "name": "api_key_not_found",
      "message_format": "API key not found",
      "correlation_id": "512159a7e9ce48ce93817cd1cd7ef3f9",
      "code": 5
    },
    "code": 16
  },
  "origin": "d4c151774a7e",
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01FZW5ZRMAQ3SVM478V3MQB9EW"
}

```

Please refer the attached screenshots.  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/c/e/ce635d1f4a825e76c086a39cfa769d6fad61b930.png)  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/4/b/4bb1a6cbe35df433f815433e1154c7a309232717.png)

Why the console is logging an error here?

---

<div class="post-metadata">

**Author:** ![Flowgen](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/flowgen/32/43973_2.png) [@Flowgen](https://www.thethingsnetwork.org/forum/u/Flowgen)\
**Post date:** [August 16, 2022, 9:23am UTC](https://www.thethingsnetwork.org/forum/t/mqtt-connection-error-api-key-not-found/56286/2 "2022-08-16T09:23:16Z")

</div>

I am having the same issue with this. Did you find out what the problem was?

---

<div class="post-metadata">

**Author:** ![UtkarshPanara](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/utkarshpanara/32/35697_2.png) [@UtkarshPanara](https://www.thethingsnetwork.org/forum/u/UtkarshPanara)\
**Post date:** [August 16, 2022, 9:58am UTC](https://www.thethingsnetwork.org/forum/t/mqtt-connection-error-api-key-not-found/56286/3 "2022-08-16T09:58:11Z")

</div>

I updated TTS version and it got resolved.
