Frontend unresponsive after hitting Delete button in UI

Frontend unresponsive after hitting Delete button in UI

Hi all,

I have an instance of HAOS running in Proxmox as VM. Some time ago (I would say several month, it’s really hard to say when because I regulary update HA and did not use this feature often) I started to experience “Connection lost. Reconnecting…” on the frontend.

Only recently I have tracked down when it happens and I’m able to reproduce this 100% of the time - when I try to delete something e.g. automation, integration, scene - when you use the 3 dot icon and select the red delete action. The action is performed as it can be seen in the frontend (item disappears from the list) but then when you try to navigate somewhere else (or after 10-30 seconds without any action at all) you get “Connection lost. Reconnecting…”

It recovers from this issue itself after several minutes and you can do anything you want until you hit the Delete button and the issue happens again.

I can do whatever I want - open new browser window - no luck, try other browser - no luck, restart the VM - no luck… but the HA itself is running and is responsive, ping to HAOS works, automations work, SMB share is accessible etc.

Now the strangest part (at least to me). When you open the frontend (browser or companion app) on another computer, tablet, mobile whatever it works - until you hit the Delete button on that device, then the issue appears on that device as well and again it recovers itself after few minutes.

I have set the log level to debug but I can’t see anything wrong (attached below, at time 11:12:19.098 the delete action is requested). I have tried different devices (computer, tablet, mobile) different OSes (windows, ios), different browsers (Firefox, Chrome, Edge) still the same. I have set up new VM with fresh install of HAOS and it happens there as well, without any modification and add-on installation - just create automation on clean installation, save it, hit delete and it is there - connection lost.

Would anyone have any suggestion?

2024-10-14 11:12:13.481 DEBUG (MainThread) [homeassistant.components.zeroconf] service_update: type=_airplay._tcp.local. name=lukas-macbook._airplay._tcp.local. state_change=ServiceStateChange.Removed
2024-10-14 11:12:13.481 DEBUG (MainThread) [homeassistant.components.zeroconf] service_update: type=_raop._tcp.local. name=76C85AF3B011@lukas-macbook._raop._tcp.local. state_change=ServiceStateChange.Removed
2024-10-14 11:12:14.608 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140239031681232] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Received {'type': 'ping', 'id': 89}
2024-10-14 11:12:14.608 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140239031681232] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Sending b'{"id":89,"type":"pong"}'
2024-10-14 11:12:14.641 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from ('172.27.5.70', 47738): b'M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\nST: upnp:rootdevice\r\nMX: 5\r\n\r\n'
2024-10-14 11:12:14.641 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from ('172.27.5.70', 47738): b'M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\nST: upnp:rootdevice\r\nMX: 5\r\n\r\n'
2024-10-14 11:12:14.641 DEBUG (MainThread) [async_upnp_client.server] Received M-SEARCH from: ('172.27.5.70', 47738), headers: {'HOST': '239.255.255.250:1900', 'MAN': '"ssdp:discover"', 'ST': 'upnp:rootdevice', 'MX': '5', '_host': '172.27.5.70', '_timestamp': datetime.datetime(2024, 10, 14, 11, 12, 14, 641866), '_remote_addr': ('172.27.5.70', 47738), '_port': 47738, '_local_addr': ('0.0.0.0', 1900)}
2024-10-14 11:12:14.641 DEBUG (MainThread) [async_upnp_client.server] Deferring response for 5 seconds
2024-10-14 11:12:14.642 DEBUG (MainThread) [async_upnp_client.server] Sending SSDP packet, transport: None, socket: <socket.socket fd=58, family=2, type=2, proto=0, laddr=('0.0.0.0', 60152)>, target: ('172.27.5.70', 47738)
2024-10-14 11:12:14.642 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Sending SSDP packets, target: ('172.27.5.70', 47738), data: [b'HTTP/1.1 200 OK\r\nCACHE-CONTROL:max-age=1800\r\nDATE:Mon, 14 Oct 2024 09:12:14 GMT\r\nSERVER:async-upnp-client/0.40.0 UPnP/2.0 Server/1.0\r\nST:upnp:rootdevice\r\nUSN:UUID:9928D21D-19B6-4F9A-B342-FA2EC1FF253E::upnp:rootdevice\r\nEXT:\r\nLOCATION:http://172.27.5.241:40000/device.xml\r\nBOOTID.UPNP.ORG:1728895960\r\nCONFIGID.UPNP.ORG:1\r\n\r\n']
2024-10-14 11:12:14.663 DEBUG (MainThread) [homeassistant.helpers.http] Serving /api/hassio_ingress/6LXUND5TVXxicvF08eO0fAGHSuQ1nA0Ut9YmKnJ5sw8/stable-3542bd157b0ccc8bf732acdb03d4d69d85f48ea9 to 172.27.110.251 (auth: False)
2024-10-14 11:12:17.729 DEBUG (MainThread) [homeassistant.helpers.http] Serving /api/hassio_ingress/6LXUND5TVXxicvF08eO0fAGHSuQ1nA0Ut9YmKnJ5sw8/stable-3542bd157b0ccc8bf732acdb03d4d69d85f48ea9 to 172.27.110.251 (auth: False)
2024-10-14 11:12:18.205 DEBUG (MainThread) [async_upnp_client.server] Sending SSDP packet, transport: None, socket: <socket.socket fd=58, family=2, type=2, proto=0, laddr=('0.0.0.0', 60152)>, target: ('172.27.5.70', 47738)
2024-10-14 11:12:18.205 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Sending SSDP packets, target: ('172.27.5.70', 47738), data: [b'HTTP/1.1 200 OK\r\nCACHE-CONTROL:max-age=1800\r\nDATE:Mon, 14 Oct 2024 09:12:14 GMT\r\nSERVER:async-upnp-client/0.40.0 UPnP/2.0 Server/1.0\r\nST:upnp:rootdevice\r\nUSN:UUID:9928D21D-19B6-4F9A-B342-FA2EC1FF253E::upnp:rootdevice\r\nEXT:\r\nLOCATION:http://172.27.5.241:40000/device.xml\r\nBOOTID.UPNP.ORG:1728895960\r\nCONFIGID.UPNP.ORG:1\r\n\r\n']
2024-10-14 11:12:19.086 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 172.27.110.251 for /api/config/automation/config/1728897110826 using bearer token
2024-10-14 11:12:19.086 DEBUG (MainThread) [homeassistant.helpers.http] Serving /api/config/automation/config/1728897110826 to 172.27.110.251 (auth: True)
2024-10-14 11:12:19.098 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event entity_registry_updated[L]: action=remove, entity_id=automation.tst2>
2024-10-14 11:12:19.099 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=automation.tst2, old_state=<state automation.tst2=on; id=1728897110826, last_triggered=None, mode=single, current=0, friendly_name=TST2 @ 2024-10-14T11:11:53.831000+02:00>, new_state=None>
2024-10-14 11:12:19.099 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event state_changed[L]: entity_id=automation.tst2, old_state=<state automation.tst2=on; id=1728897110826, last_triggered=None, mode=single, current=0, friendly_name=TST2 @ 2024-10-14T11:11:53.831000+02:00>, new_state=None>
2024-10-14 11:12:19.099 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event entity_registry_updated[L]: action=remove, entity_id=automation.tst2>
2024-10-14 11:12:19.100 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f8c0e07c6d0> checked out from pool
2024-10-14 11:12:19.100 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140239031681232] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Sending b'[{"type":"event","event":{"r":["automation.tst2"]},"id":3},{"type":"event","event":{"event_type":"entity_registry_updated","data":{"action":"remove","entity_id":"automation.tst2"},"origin":"LOCAL","time_fired":"2024-10-14T09:12:19.098989+00:00","context":{"id":"01JA54SGCTH2TVCEGRWZEHD52Y","parent_id":null,"user_id":null}},"id":4}]'
2024-10-14 11:12:19.101 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140237825187776] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Sending b'[{"type":"event","event":{"r":["automation.tst2"]},"id":19},{"type":"event","event":{"event_type":"entity_registry_updated","data":{"action":"remove","entity_id":"automation.tst2"},"origin":"LOCAL","time_fired":"2024-10-14T09:12:19.098989+00:00","context":{"id":"01JA54SGCTH2TVCEGRWZEHD52Y","parent_id":null,"user_id":null}},"id":20},{"type":"event","event":{"event_type":"entity_registry_updated","data":{"action":"remove","entity_id":"automation.tst2"},"origin":"LOCAL","time_fired":"2024-10-14T09:12:19.098989+00:00","context":{"id":"01JA54SGCTH2TVCEGRWZEHD52Y","parent_id":null,"user_id":null}},"id":38}]'
2024-10-14 11:12:19.105 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140239031681232] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Received {'type': 'config/entity_registry/list_for_display', 'id': 90}
2024-10-14 11:12:19.105 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140239031681232] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Sending b'{"id":90,"type":"result","success":true,"result":{"entity_categories":{"0":"config","1":"diagnostic"},"entities":[{"ei":"sensor.sun_next_dawn","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_dawn","ec":1,"hn":true,"en":"Next dawn"},{"ei":"sensor.sun_next_dusk","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_dusk","ec":1,"hn":true,"en":"Next dusk"},{"ei":"sensor.sun_next_midnight","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_midnight","ec":1,"hn":true,"en":"Next midnight"},{"ei":"sensor.sun_next_noon","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_noon","ec":1,"hn":true,"en":"Next noon"},{"ei":"sensor.sun_next_rising","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_rising","ec":1,"hn":true,"en":"Next rising"},{"ei":"sensor.sun_next_setting","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_setting","ec":1,"hn":true,"en":"Next setting"},{"ei":"update.home_assistant_supervisor_update","pl":"hassio","lb":[],"di":"d9794fcc73a5f10ee22b75a9b88e7b5e","ec":0,"hn":true,"en":"Update"},{"ei":"update.home_assistant_core_update","pl":"hassio","lb":[],"di":"1612b8e28925b053fb8b18a25e892e4f","ec":0,"hn":true,"en":"Update"},{"ei":"update.home_assistant_operating_system_update","pl":"hassio","lb":[],"di":"b09b8c33e232a3fb586cf924fb1e41dd","ec":0,"hn":true,"en":"Update"},{"ei":"person.lukas","pl":"person","lb":[],"en":"lukas"},{"ei":"todo.shopping_list","pl":"shopping_list","lb":[],"tk":"shopping_list","hn":true,"en":"Shopping List"},{"ei":"tts.google_translate_en_com","pl":"google_translate","lb":[],"en":"Google Translate en com"},{"ei":"update.matter_server_update","pl":"hassio","lb":[],"di":"742c44bea051ef497667f2bf9d18ed56","ec":0,"hn":true,"en":"Update"},{"ei":"update.file_editor_update","pl":"hassio","lb":[],"di":"b674e53bc73632893dedd31ac987800a","ec":0,"hn":true,"en":"Update"},{"ei":"update.studio_code_server_update","pl":"hassio","lb":[],"di":"f40ed35d1ef1781fff5cc5a5fea03dc5","ec":0,"hn":true,"en":"Update"},{"ei":"todo.tst","pl":"local_todo","lb":[],"hn":true,"en":"Tst"},{"ei":"todo.tst2","pl":"local_todo","lb":[],"ic":"mdi:list-status","hn":true,"en":"Tst2"},{"ei":"automation.tst","pl":"automation","lb":[],"en":"TST"}]}}'
2024-10-14 11:12:19.105 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140237825187776] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Received {'type': 'config/entity_registry/list_for_display', 'id': 69}
2024-10-14 11:12:19.106 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140237825187776] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Sending b'{"id":69,"type":"result","success":true,"result":{"entity_categories":{"0":"config","1":"diagnostic"},"entities":[{"ei":"sensor.sun_next_dawn","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_dawn","ec":1,"hn":true,"en":"Next dawn"},{"ei":"sensor.sun_next_dusk","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_dusk","ec":1,"hn":true,"en":"Next dusk"},{"ei":"sensor.sun_next_midnight","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_midnight","ec":1,"hn":true,"en":"Next midnight"},{"ei":"sensor.sun_next_noon","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_noon","ec":1,"hn":true,"en":"Next noon"},{"ei":"sensor.sun_next_rising","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_rising","ec":1,"hn":true,"en":"Next rising"},{"ei":"sensor.sun_next_setting","pl":"sun","lb":[],"di":"4d0f0fb89a1b0b1d3fe9dfe652098e65","tk":"next_setting","ec":1,"hn":true,"en":"Next setting"},{"ei":"update.home_assistant_supervisor_update","pl":"hassio","lb":[],"di":"d9794fcc73a5f10ee22b75a9b88e7b5e","ec":0,"hn":true,"en":"Update"},{"ei":"update.home_assistant_core_update","pl":"hassio","lb":[],"di":"1612b8e28925b053fb8b18a25e892e4f","ec":0,"hn":true,"en":"Update"},{"ei":"update.home_assistant_operating_system_update","pl":"hassio","lb":[],"di":"b09b8c33e232a3fb586cf924fb1e41dd","ec":0,"hn":true,"en":"Update"},{"ei":"person.lukas","pl":"person","lb":[],"en":"lukas"},{"ei":"todo.shopping_list","pl":"shopping_list","lb":[],"tk":"shopping_list","hn":true,"en":"Shopping List"},{"ei":"tts.google_translate_en_com","pl":"google_translate","lb":[],"en":"Google Translate en com"},{"ei":"update.matter_server_update","pl":"hassio","lb":[],"di":"742c44bea051ef497667f2bf9d18ed56","ec":0,"hn":true,"en":"Update"},{"ei":"update.file_editor_update","pl":"hassio","lb":[],"di":"b674e53bc73632893dedd31ac987800a","ec":0,"hn":true,"en":"Update"},{"ei":"update.studio_code_server_update","pl":"hassio","lb":[],"di":"f40ed35d1ef1781fff5cc5a5fea03dc5","ec":0,"hn":true,"en":"Update"},{"ei":"todo.tst","pl":"local_todo","lb":[],"hn":true,"en":"Tst"},{"ei":"todo.tst2","pl":"local_todo","lb":[],"ic":"mdi:list-status","hn":true,"en":"Tst2"},{"ei":"automation.tst","pl":"automation","lb":[],"en":"TST"}]}}'
2024-10-14 11:12:19.106 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140237825187776] lukas from 172.27.110.251 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0): Received {'type': 'config/entity_registry/list', 'id': 70}
  • Core 2024.10.2
  • Supervisor 2024.10.0
  • Operating System 13.1
  • Frontend 20241002.3

Hah! Exactly same for me. Also Proxmox and HAOS as a VM. Also not sure when it started happening, but I think like 1/2/3 months ago :confused:

Sorry and glad to hear that at the same time. It was starting to drive me nuts as I couldn’t find any mention about this anywhere and thought that I’m the only one.

Anyway, going down the rabbit hole I have found something. My LAN uses several VLANs to have more control over it, especially IoT devices and guests. There is a subnet dedicated for Proxmox VMs 172.27.5.0/24 and subnet for wifi consumer devices like laptops which is 172.27.110.0/24. The issue happens only if I access the frontend from a different subnet, which I do all the time. When I temporarily moved my computer to VMs subnet, the same where HAOS is, the issue is gone.

This narrows down the problem a little, but I’m still missing the root cause.

The mDNS is set up between those two subnets, there seems to be no firewall rules which would affect this… Any thoughts?

You should create an issue on github against the frontend with this information.

I will, just wanted to check for any ideas not to spam the issue tracker should it be my configuration, network or whatsoever.

1 Like

I am experiencing the same, but it is only on my test instance, and I never found time to dive deeper trying to understand what is causing it. Like you said, it happens on delete - for me often when I try to delete some device. Exactly same symptoms.

Two more things come to my mind regarding this issue and it’s origin.

@stomko what are the differencies between your production and test instance e.g. hardware, network, version? is your test instance on other subnet than your machine you use for access to HA? do you use proxmox?

Both of you guys @stomko @DvdNwk by any chance isn’t your LAN based on Unifi devices?

It’s not. BUT, my issue is not exactly same as yours, after all.

The symptoms are the same: HA’s WebUI losing connection, refreshing the page sometimes does (not) help, only after a moment it starts working again, BUT it’s not “reproducible” with deleting automations or anything like that. For me it’s more “randomly” I’d say (or, more like: I don’t see the pattern yet).

Mine is also on Unifi. But my both HA instances are in the same subnet behind unifi. Running VM based on Unraid. Differences are cosmetic - clearly not exactly 1:1 copy, less integrations, less entites, less RAM assigned.
But seems that something has changed - previously every time i deleted esphome device (and I did that lot of times, playing with them primarily on my test instance) caused this (for me it took about 5-10 minutes to get back to normal state). Last time, I assigned more RAM (4 instead of 2GB) and tried now, it is not doing it. Assigned back 2GB of RAM, and it is still ok. Perhaps it has to do with uptime - I leave my test instance running continuously.

I had some Raspberry Pi 4GB laying around, so I have just tried to set it up for testing to eliminate problems with Proxmox/VM by uploading HAOS to this Raspberry and I reproduced the issue almost immediately. So neither Proxmox/VM is the cause…

1 Like