Home assistant log increased

I did not check the logs for somewhile, and today I noticed that the disk is full. I have “home_assistant_xxxx.log” which is almost 22gb. I can not even connect with Terminal SSH, because disck is full. How can I clear or delete the log file? and how can I put filter on log such that only last 7 days are backed there?

The log is a text file. 22 GB of text is enormous. You have a major issue.

Do you have the SAMBA Share addon installed?

If so, use a PC to navigate to the config share and download config/home_assistant.log. then delete it from the system. Do download it first so you can see what happened.

What sort of install hardware are you using?

I do not have Samba share, checking the log. Running un raspberry pi with 32gb sd card

Shutdown.

Take the card out of the Pi.

Put in in a PC card reader.

If it is a Linux PC you are all set to find the file, cut and paste it somewhere else.

If it is a Windows PC you can use DiskInternals Linux Reader (free) to read the file to see what is going on. You can’t write / delete the file.

Restarting Home Assistant twice should delete the file. First time it renames the file to home_assistant.log.1 and starts a new home_assistant.log file. Second time it does that again overwriting the huge home_assistant.log.1 file.

i restarted and is not restarting any more. going to connect directly and delete it. Lets see.

Move the file off the system rather than deleting it. We need to know what happened to prevent it happening again.

I think I turned on “DEBUG” and forget to turn it off. Do not know where I did this.

1 Like

I am connected directly to rasberry, I am not able to find the log with 25gb file. I searched for config, nothing found.

As mentioned above by Tom, search for “home-assistant.log” and “home-assistant.log.1”

If You mean you are in the CLI, it’s located in /mnt/data/supervisor/homeassistant

I end up resetting everything from backup and installing new os. After restarting it messed up everything. I deleted some journel file to clear some spaces then it messed up.

I’m having the same issue. The .log file was over 22 GB and the .log.1 was also 18GB. Using Studio Code Server I was able to remove the files and I rebooted afterwards. After the reboot the .log file was direct over 50MB :open_mouth: So I openend up the log file, and it turns out MQTT that is causing the many errors. In this case it is correct as I’m deploying a new MQTT server, and I did not disabled the MQTT integration, but I didn’t expect this :expressionless:

2024-09-10 09:02:27.981 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback MQTT._async_reader_callback(<homeassistan...x7ff4f847a5a0>)() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 499, in _async_reader_callback
    if (status := client.loop_read(MAX_PACKETS_TO_READ)) != 0:
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1556, in loop_read
    rc = self._packet_read()
         ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
    rc = self._packet_handle()
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3029, in _packet_handle
    return self._handle_pubackcomp("PUBACK")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 3519, in _handle_pubackcomp
    reasonCode.unpack(self._in_packet['packet'][2:])
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/reasoncodes.py", line 167, in unpack
    name = self.__getName__(self.packetType, c)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/reasoncodes.py", line 138, in __getName__
    assert identifier in self.names.keys(), identifier
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 47
ogger: homeassistant
Source: components/mqtt/client.py:499
First occurred: 9:01:35 AM (239060 occurrences)
Last logged: 9:10:01 AM

Error doing job: Exception in callback MQTT._async_reader_callback(<homeassistan...x7ff4f847a5a0>)() (None)