# Another client connected with the same client id

**URL:** <https://community.hivemq.com/t/another-client-connected-with-the-same-client-id/3236>\
**Category:** Uncategorized\
**Created:** [September 23, 2024, 5:46pm UTC](https://community.hivemq.com/t/another-client-connected-with-the-same-client-id/3236 "2024-09-23T17:46:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![engineerOne](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@engineerOne](https://community.hivemq.com/u/engineerOne)\
**Post date:** [September 23, 2024, 5:46pm UTC](https://community.hivemq.com/t/another-client-connected-with-the-same-client-id/3236/1 "2024-09-23T17:46:20Z")

</div>

Hi, my client when it is trying to reconnect, The broker does not let my client to reconnect

```auto
2024-09-16 11:41:35,392 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller, IP: 127.0.0.6 was disconnected. reason: Another client connected with the same client id..
2024-09-16 11:41:35,396 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller session has expired at 2024-09-16T11:41:35.392Z. All persistent data for this client has been removed.
2024-09-16 11:41:35,398 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller, IP: 127.0.0.6, Clean Start: false, Session Expiry: 0 connected.
2024-09-16 11:42:37,120 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller, IP: 127.0.0.6 was disconnected. reason: Another client connected with the same client id..
2024-09-16 11:42:37,124 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller session has expired at 2024-09-16T11:42:37.120Z. All persistent data for this client has been removed.
2024-09-16 11:42:37,125 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller, IP: 127.0.0.6, Clean Start: false, Session Expiry: 0 connected.
2024-09-16 11:43:38,934 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller, IP: 127.0.0.6 was disconnected. reason: Another client connected with the same client id..
2024-09-16 11:43:38,937 - Client ID: 55af683e08ae41b999a5f9263e7c55a4-caller session has expired at 2024-09-16T11:43:38.934Z. All persistent data for this client has been removed.

```

According to this document the broker need to let client take over [What Is MQTT Keep Alive and Client Take-Over? – MQTT Essentials Part 10](https://www.hivemq.com/blog/mqtt-essentials-part-10-alive-client-take-over/)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@cymplecy](https://community.hivemq.com/u/cymplecy)\
**Post date:** [September 30, 2024, 6:06pm UTC](https://community.hivemq.com/t/another-client-connected-with-the-same-client-id/3236/2 "2024-09-30T18:06:17Z")

</div>

Looking at your logs - it is saying that there is another client using the same client\_id.

If a client is connected and another client comes along with the same id, then the MQTT spec says that the 1st one will be disconnected.

If you don’t supply a client id, the broker will just assign a random one and then you won’t get this behaviour

The alternative is to make sure your client picks a random id
