(Solved) Only userinterface within safe mode

Half into my holiday I could not get the Companion app to connect to HA. It showed a Loading Message but it never loaded. Also when I got home I have the same behaviour when logging in locally (browser). Only in safe mode I have an UI.
All UI’s are showing the same behaviour:

  • Companion app (local and remote)
  • Webbrowsers (Chrome, Safari and Firefox) before and after clearing cache
  • Casts to Google Nests

No clou how to troubleshoot this (two week old backup shows the same behaviour)
I already deleted some integrations to see if they were causing this behaviour, but that did not help.

In the logs I see the following:

2024-10-19 23:45:44.363 ERROR (MainThread) [homeassistant.core] Error running job: <Job listen * HassJobType.Callback functools.partial(<function _forward_events_unconditional at 0x7ff059868860>, <bound method WebSocketHandler._send_message of <WebSocketHandler closing=False authenticated=True description=Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2024.10.2 aiohttp/3.10.10 Python/3.12)>>, b'655')>
OverflowError: int too big to convert

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/json.py", line 75, in json_encoder_default
    if hasattr(obj, "json_fragment"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in json_fragment
    return json_fragment(self.as_dict_json)
                         ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1884, in as_dict_json
    return json_bytes(self._as_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Integer exceeds 64-bit range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1562, in async_fire_internal
    self._hass.async_run_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 937, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in _forward_events_unconditional
    send_message(messages.cached_event_message(message_id_as_bytes, event))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/messages.py", line 123, in cached_event_message
    _partial_cached_event_message(event)[:-1],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/messages.py", line 139, in _partial_cached_event_message
    _message_to_json_bytes_or_none({"type": "event", "event": event.json_fragment})
                                                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1386, in json_fragment
    return json_fragment(json_bytes(self._as_dict))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: State
2024-10-19 23:45:44.654 ERROR (MainThread) [aiohttp.server] Error handling request
OverflowError: int too big to convert

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 75, in handle
    result = handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/api/__init__.py", line 228, in get
    body=b"".join((b"[", b",".join(states), b"]")),
                         ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/api/__init__.py", line 219, in <genexpr>
    states = (state.as_dict_json for state in hass.states.async_all())
              ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1884, in as_dict_json
    return json_bytes(self._as_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Integer exceeds 64-bit range

Hi, that’s a PITA!

Has anything changed on your system in between; i.e. updates of some kind?
What kind of system are you running HA on?

Running HAOS on Proxmox. And nothing changed. I know for sure I did not have a problem when going on holiday, but now when I restore the backup before leaving I still have the same problem :exploding_head:

Strange…
What does the console from the VM in Proxmox say?

nothing out of the ordinairy. Supervisor logs does not show anything related as far as i can see

Did you install any custom component for your frontend?

Not really a solution but you could try this: disable the configured devices/entities in the integrations in safe mode and see if your system starts this time in normal mode.

Yes, I have custom components installed. But how do I disable any custom stuff in safe mode as HACS is not available…

You do not need to disable any custom, HASS does not run anything from HACS when in safe mode, not even HACS itself

Seems like something in your setup is attempting to claim that a string variable is an integer number, but when it tries to store it as a number, that number representation is greater than python (json decoding) can understand as a number.

I was talking about customizations (integrations) in HA’s ‘Devices & services’, in case one of those was preventing HA to start properly.
Those can be disabled in safe mode.

For whatever reason one browser window kept working and so I was able to remove all custom stuff in HACS. After adding one by one it showed that custom solaredge integration was causing this problem. Removed this integration and will open bugreport with the owner of the repository.

Did you reboot your system shortly before this problem occurred?

The reason I’m asking this is because I installed SolarEdge Modbus Multi v2.4.15 for a friend through HACS.

Not that I can recall, sorry

You seem to have installed another version of the integration.

1 Like

Yup, mine was GitHub - erikarenhill/solaredge-modbus-hass: A custom platform component/sensor for reading SolarEdge Modbus TCP into Home Assistant https://home-assistant.io/

I’ll have a look at the one you mentioned

In the end it was all caused by a “wonky” custom integration for SolarEdge. After I removed the integration there were no problems anymore. @Nick4 you steered me to this integration so thx for the help :pray:

1 Like