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

2025.2.0b2 One Drive Automatic backup fails #136959

Open
def1149 opened this issue Jan 30, 2025 · 4 comments · May be fixed by #136980
Open

2025.2.0b2 One Drive Automatic backup fails #136959

def1149 opened this issue Jan 30, 2025 · 4 comments · May be fixed by #136980

Comments

@def1149
Copy link

def1149 commented Jan 30, 2025

The problem

Initiated an automatic backup One Drive failed. Local, local network and Google Drive succeeded
Repeated 10 minutes later same failure. I'm able to access One Drive directly on my PC

Image

What version of Home Assistant Core has the issue?

2025.2.0b2

What was the last working version of Home Assistant Core?

2025.2.0b1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Backup

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.components.backup
Source: components/backup/manager.py:512
integration: Backup ([documentation](https://rc.home-assistant.io/integrations/backup), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+backup%22))
First occurred: 2:32:18 PM (1 occurrences)
Last logged: 2:32:18 PM

Unexpected error for onedrive.D378A3F5743D8717:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
    resp = await self._pool.handle_async_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
    raise exc from None
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
    response = await connection.handle_async_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        pool_request.request
        ^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/connection.py", line 103, in handle_async_request
    return await self._connection.handle_async_request(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 136, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 106, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 177, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 217, in _receive_event
    data = await self._network_stream.read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.READ_NUM_BYTES, timeout=timeout
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_backends/anyio.py", line 32, in read
    with map_exceptions(exc_map):
         ~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ReadTimeout

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 512, in upload_backup_to_agent
    await self.backup_agents[agent_id].async_upload_backup(
    ...<2 lines>...
    )
  File "/usr/src/homeassistant/homeassistant/components/onedrive/backup.py", line 87, in wrapper
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/onedrive/backup.py", line 172, in async_upload_backup
    await self._upload_file(
        upload_session.upload_url, await open_stream(), backup.size
    )
  File "/usr/src/homeassistant/homeassistant/components/onedrive/backup.py", line 282, in _upload_file
    await async_upload(
    ...<3 lines>...
    )
  File "/usr/src/homeassistant/homeassistant/components/onedrive/backup.py", line 264, in async_upload
    result = await adapter.send_async(info, LargeFileUploadSession, {})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/kiota_http/httpx_request_adapter.py", line 186, in send_async
    response = await self.get_http_response_message(request_info, parent_span)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/kiota_http/httpx_request_adapter.py", line 602, in get_http_response_message
    resp = await self._http_client.send(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1629, in send
    response = await self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
    response = await self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
    response = await self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1730, in _send_single_request
    response = await transport.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
    with map_httpcore_exceptions():
         ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

@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)

@danielpetrovic
Copy link

danielpetrovic commented Jan 30, 2025

Just want to chime in that I get the same error. With 2025.2.0b1 I could not connect to OneDrive. With b2 it is possible to link it.

Logger: homeassistant.components.onedrive.backup
Source: components/onedrive/backup.py:91
integration: OneDrive (documentation, issues)
First occurred: 22:08:57 (1 occurrences)
Last logged: 22:08:57

Error during backup in async_upload_backup: Status 400, message None

And

Logger: homeassistant.components.backup
Source: components/backup/manager.py:531
integration: Backup (documentation, issues)
First occurred: 22:08:57 (1 occurrences)
Last logged: 22:08:57

Upload failed for onedrive.ea093e654287a17c: Backup operation failed

Hmm, just checked my OneDrive and the Folders /Apps/Home Assistant/backups_slug/ are created and I even see a .tar file in the folder.

The state inside Home Assistant still says the upload failed though.

Tried an encrypted and unencrypted OneDrive backup. Both give the same error, and both upload the file just fine.

@def1149
Copy link
Author

def1149 commented Jan 30, 2025

Just tried the same thing again; Initiated an automated backup and the upload to One Drive succeeded.
Appears to be an intermittent problem

@home-assistant
Copy link

Hey there @zweckj, mind taking a look at this issue as it has been labeled with an integration (onedrive) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of onedrive 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 onedrive 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)


onedrive documentation
onedrive source
(message by IssueLinks)

@zweckj zweckj linked a pull request Jan 31, 2025 that will close this issue
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants