V2.32.5: deconz.service: Main process exited, code=killed, status=11/SEGV

I make a diagnostic with Claude (AI) in case of he find something he delivery me this diagnostic not sure is correct but can be a first investigation:

Diagnosis

The restart chain involves two separate bugs across two different repos:

Bug 1 — websocket_server.cpp (the REST plugin)

The onSocketDisconnected() function has an iterator corruption bug. After doing a swap-and-pop removal, the for loop increments i, silently skipping the moved element. In the worst case (with multiple clients or rapid reconnects), this leaves a dangling pointer in the clients vector:

// Current (buggy) code
void WebSocketServer::onSocketDisconnected()
{
    for (size_t i = 0; i < clients.size(); i++)
    {
        QWebSocket *sock = qobject_cast<QWebSocket*>(sender());
        if (sock && clients[i] == sock)
        {
            sock->deleteLater();
            clients[i] = clients.back(); // ← moves last element to slot i
            clients.pop_back();          // ← removes the duplicate at the back
            // ❌ NO break/i-- here: the loop increments i, skipping slot i
        }
    }
}

The same bug exists in onSocketError() . The fix is simple — add a break since a disconnected signal maps to exactly one socket:

// Fixed
void WebSocketServer::onSocketDisconnected()
{
    QWebSocket *sock = qobject_cast<QWebSocket*>(sender());
    DBG_Assert(sock);
    for (size_t i = 0; i < clients.size(); i++)
    {
        if (clients[i] == sock)
        {
            sock->deleteLater();
            clients[i] = clients.back();
            clients.pop_back();
            break; // ✅ exit immediately — one signal = one socket
        }
    }
}

Apply the same fix to onSocketError()

Bug 2 — HTTP server timeout (the deconz core, v2.32.2+)

The commit a2a8e2c in the deconz core repo rewrote the HTTP server and introduced a timeout condition that incorrectly fires on idle connections (not just timed-out ones). When HA restarts and closes its HTTP connection, the server hits this condition and triggers a full process restart via restartAppTimerFired(). This was partially fixed in v2.32.4 (de2c3f: “Fix Websockets being closed after timeout due wrong condition”), but the crash path through the HTTP layer remains in v2.32.5.

Hello everyone,

I hope the informations gathered are sufficient to find a solution. The problem has been known for almost three months.

It’s very annoying; I have almost 80 Zigbee devices, and after a crash, I have to manually re-register some of them (not re-pair them).

My setup: Home Assistant 2026.4.3/17.2 on Proxmox 9.1.9/NUC; on a Raspberry Pi 4 8GB, Phoscon Image Bookworm 64-bit V2.32.5

Thank you very much for your efforts!

Best regards, Herbi

Same here, I am getting mad now, random devices has to be added again and again if HA restarts.
Please someone from support team comfirm that it will be fixed soon!

Many thanks!

But this issue is about a deconz crash
Nothing about devices lost, if you close and restart deconz (without crash) it’s happen the same thing ?
They disapear from deconz or are still here but not working ?

The issue with the lost device only occurred once; I briefly disconnected the relay from power, and then it was detected again.
The deconz reboot occurs every time Homeassistant is restarted.

Version 2026.5.3 might already help, as it addressed several issues with HA and the apps. Additionally, there have already been positive reports regarding the v2.33-beta.

I have HA version 2026.5.4 and each time I must restart HA after 4min deconz crash and restart so please find a fix.

I really hope that v2.33 stable will fix this annoying problem and will come soon…

I figured out, if I disable HTTPS, the issue goes away. Since than i do not have any crash!

Make a try to load it:

/usr/bin/deCONZ --http-port=80 --https-port=0 --ws-port=443 --auto-connect=1

“C:\Program Files (x86)\deCONZ\bin\deCONZ.exe” --http-port=80 --https-port=0 --ws-port=443 --auto-connect=1

:wink: