### The problem
Hi, my new automatic backup configuration doesn't work someti…mes and manual backups do not work anymore.

The problem is that my manual backups also do not work anymore. I have a local NAS with sleeping HDDs. Manual backups always worked as expected in the past, until I updated to 2025.1.
### What version of Home Assistant Core has the issue?
core-2025.1.2
### What was the last working version of Home Assistant Core?
core-2024.12.5
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
backup functionality of Home Assistant
### Link to integration documentation on our website
_No response_
### Diagnostics information
_No response_
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
This is what I see in the HA core logs, when I backup automatically:
```
2025-01-10 05:37:08.205 ERROR (MainThread) [homeassistant.components.backup] Error creating backup: Error creating backup: An error occurred while making backup, check job 'eafe387d6e6f4ceda2c165ff01470d90' or supervisor logs for details
```
----------------------------------------------------------------------------------
This is what the supervisor log shows, when I backup automatically:
```
2025-01-10 05:35:49.010 INFO (MainThread) [supervisor.backups.manager] Backup de37575a starting stage addon_repositories
2025-01-10 05:35:49.011 INFO (MainThread) [supervisor.backups.manager] Backup de37575a starting stage docker_config
2025-01-10 05:35:49.011 INFO (MainThread) [supervisor.backups.manager] Creating new partial backup with slug de37575a
2025-01-10 05:37:08.093 INFO (MainThread) [supervisor.backups.manager] Backup de37575a starting stage home_assistant
2025-01-10 05:37:08.116 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 278, in async_send_command
return await self._client.async_send_command(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 351, in begin_backup
resp = await self.websocket.async_send_command(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 280, in async_send_command
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2025-01-10 05:37:08.133 ERROR (MainThread) [supervisor.backups.manager] Backup de37575a error
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 278, in async_send_command
return await self._client.async_send_command(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 351, in begin_backup
resp = await self.websocket.async_send_command(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 280, in async_send_command
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/backups/manager.py", line 413, in _do_backup
await backup.store_homeassistant(
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
raise err
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/backups/backup.py", line 767, in store_homeassistant
await self.sys_homeassistant.backup(homeassistant_file, exclude_database)
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
raise err
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 389, in backup
await self.begin_backup()
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 317, in wrapper
raise JobException() from err
supervisor.exceptions.JobException
2025-01-10 05:37:08.166 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-429639' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
await self._client.async_send_command(message)
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
await self.async_send_message(
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2025-01-10 05:37:08.168 WARNING (MainThread) [supervisor.homeassistant.websocket] Connection is closed
2025-01-10 05:37:08.229 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot write to closing transport
2025-01-10 05:37:08.242 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for 491eb00d_hamh closed
2025-01-10 05:37:08.279 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2025-01-10 05:37:08.295 INFO (MainThread) [supervisor.api.proxy] WebSocket access from 491eb00d_hamh
2025-01-10 05:37:08.307 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2025-01-10 05:55:00.623 ERROR (MainThread) [asyncio] Future exception was never retrieved
future: <Future finished exception=HomeAssistantWSConnectionError('Connection was closed')>
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
2025-01-10 05:55:00.624 ERROR (MainThread) [asyncio] Future exception was never retrieved
future: <Future finished exception=HomeAssistantWSConnectionError('Connection was closed')>
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
2025-01-10 05:57:08.456 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
```
----------------------------------------------------------------------------------
Here is what I see in the HA core log, when I try to backup manually:
```
2025-01-10 12:15:54.850 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546304044208] Error handling message: Error creating backup: An error occurred while making backup, check job '08f6cc10928f47fbbfa7be6b82fbe89f' or supervisor logs for details (home_assistant_error) Michael from xxxx:xxxx:xxxx:101:6d74:2e75:c240:3ff1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36)
```
----------------------------------------------------------------------------------
Here is what I see in the supervisor log, when I try to backup manually:
```
2025-01-10 12:14:33.664 INFO (MainThread) [supervisor.backups.manager] Backup e001c26f starting stage addon_repositories
2025-01-10 12:14:33.665 INFO (MainThread) [supervisor.backups.manager] Backup e001c26f starting stage docker_config
2025-01-10 12:14:33.665 INFO (MainThread) [supervisor.backups.manager] Creating new partial backup with slug e001c26f
2025-01-10 12:15:54.377 INFO (MainThread) [supervisor.backups.manager] Backup e001c26f starting stage home_assistant
2025-01-10 12:15:54.396 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 278, in async_send_command
return await self._client.async_send_command(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 351, in begin_backup
resp = await self.websocket.async_send_command(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 280, in async_send_command
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2025-01-10 12:15:54.771 ERROR (MainThread) [supervisor.backups.manager] Backup e001c26f error
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 278, in async_send_command
return await self._client.async_send_command(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 351, in begin_backup
resp = await self.websocket.async_send_command(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 280, in async_send_command
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/backups/manager.py", line 413, in _do_backup
await backup.store_homeassistant(
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
raise err
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/backups/backup.py", line 767, in store_homeassistant
await self.sys_homeassistant.backup(homeassistant_file, exclude_database)
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
raise err
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
return await self._method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 389, in backup
await self.begin_backup()
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 317, in wrapper
raise JobException() from err
supervisor.exceptions.JobException
2025-01-10 12:15:54.804 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-448773' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
await self._client.async_send_command(message)
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
return await self._futures[message["id"]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
await self.async_send_message(
File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
await self._client.close()
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2025-01-10 12:15:54.806 WARNING (MainThread) [supervisor.homeassistant.websocket] Connection is closed
```
```
### Additional information
_No response_