Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic backups on local servers cannot be deleted. #134065

Open
Petro31 opened this issue Dec 26, 2024 · 4 comments
Open

Automatic backups on local servers cannot be deleted. #134065

Petro31 opened this issue Dec 26, 2024 · 4 comments

Comments

@Petro31
Copy link
Contributor

Petro31 commented Dec 26, 2024

The problem

Automatic backups on local servers via smb cannot be deleted from the UI.

What version of Home Assistant Core has the issue?

core-2025.1.0b2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

HA logs

2024-12-26 18:15:11.851 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140713761645632] Error handling message: Unknown error (unknown_error) petro from 192.168.1.141 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/backup/websocket.py", line 103, in handle_delete
    agent_errors = await hass.data[DATA_MANAGER].async_delete_backup(msg["backup_id"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 566, in async_delete_backup
    raise result
  File "/usr/src/homeassistant/homeassistant/components/hassio/backup.py", line 179, in async_delete_backup
    await self._client.backups.remove_backup(
    ...<4 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/aiohasupervisor/backups.py", line 90, in remove_backup
    await self._client.delete(
        f"backups/{backup}", json=options.to_dict() if options else None
    )
  File "/usr/local/lib/python3.13/site-packages/aiohasupervisor/client.py", line 219, in delete
    return await self._request(
           ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohasupervisor/client.py", line 129, in _request
    await self._raise_on_status(response)
  File "/usr/local/lib/python3.13/site-packages/aiohasupervisor/client.py", line 77, in _raise_on_status
    raise exc_type()
aiohasupervisor.exceptions.SupervisorError

Supervisor logs

2024-12-26 18:15:11.295 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/sentry_sdk/integrations/aiohttp.py", line 161, in sentry_app_handle
    reraise(*_capture_exception())
  File "/usr/local/lib/python3.12/site-packages/sentry_sdk/utils.py", line 1795, in reraise
    raise value
  File "/usr/local/lib/python3.12/site-packages/sentry_sdk/integrations/aiohttp.py", line 144, in sentry_app_handle
    response = await old_handle(self, request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 569, 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/supervisor/supervisor/api/middleware/security.py", line 199, in block_bad_requests
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 215, in system_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 285, in token_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 298, in core_proxy
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/utils.py", line 64, in wrap_api
    answer = await method(api, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/backups.py", line 443, in remove
    return self.sys_backups.remove(backup, locations=locations)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 268, in remove
    if location in backup.all_locations
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'CIFSMount'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@frenck frenck added this to the 2025.1.0 milestone Dec 26, 2024
@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (backup) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of backup can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign backup Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


backup documentation
backup source
(message by IssueLinks)

@dcmeglio
Copy link
Contributor

Not just automatic backups, just confirmed this with a manual backup on my NAS as well.

@proffa84
Copy link

I can delete only local(from "system") backup files but not any from NAS(automatic or manual backup).

@rexbron
Copy link

rexbron commented Dec 28, 2024

Not just automatic backups, just confirmed this with a manual backup on my NAS as well.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants