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

Can't create new snapshot (Response code 400 (Bad Request)) #233

Open
nicknol opened this issue Feb 28, 2024 · 7 comments
Open

Can't create new snapshot (Response code 400 (Bad Request)) #233

nicknol opened this issue Feb 28, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@nicknol
Copy link

nicknol commented Feb 28, 2024

Describe the bug
Error Message:
Can't create new snapshot (Response code 400 (Bad Request))

the tar file is created on my NAS but doesn't get transferred to nextCloud.

To Reproduce
Neither scheduled nor ad-hoc backups are transferred to nextCloud

Expected behavior
Scheduled adn ad-hoc backups are transferred to nextCloud

System information

  • Home Assistant Version : Core 2024.2.2
  • Home Assistant Supervisor Version : 2024.02.0
  • Operating System 12.0
  • Nextcloud Version :28.0.2
  • Frontend 20240207.1
  • Addon version : 0.17.7
  • If any, reverse proxy in fort on Nextcloud : none

Additional context
Please find the log file after a restart of the add-on and executing an ad-hoc aka manual backup.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
fix-attrs: info: applying /etc/fix-attrs.d/10-run
fix-attrs: warning: fix-attrs is deprecated, please fix volume permissions in your container manager instead
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

-----------------------------------------------------------
 Add-on: Nextcloud Backup
 Easily upload your Home Assistant backups to Nextcloud
-----------------------------------------------------------
 Add-on version: 0.17.7
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.0  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.2.2
 Home Assistant Supervisor: 2024.02.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
Log level is set to INFO
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun nextcould_backup (no readiness notification)
s6-rc: info: service legacy-services successfully started
[17:58:40] INFO: Starting Node...
[2024-02-28 17:58:41] [info]: 	Log level: info
[2024-02-28 17:58:41] [info]: 	Backup timeout: 9000000
[2024-02-28 17:58:41] [info]: 	Satus : Go !
[2024-02-28 17:58:41] [info]: 	Initializing and checking webdav client...
[2024-02-28 17:58:41] [info]: 	Starting auto clean cron...
[2024-02-28 17:58:41] [info]: 	Starting Cron...
[2024-02-28 17:58:41] [info]: 	Hassio API : Go !
[2024-02-28 17:58:42] [info]: 	Nextcloud connection : Go !
[2024-02-28 17:59:10] [info]: 	Stopping addons...
[2024-02-28 17:59:10] [info]: 	... Ok
[2024-02-28 17:59:10] [info]: 	Creating new snapshot...
[2024-02-28 18:03:52] [error]: 	Can't create new snapshot (Response code 400 (Bad Request))
@nicknol nicknol added the bug Something isn't working label Feb 28, 2024
@nicknol
Copy link
Author

nicknol commented Feb 28, 2024

it seems to be related to the backup functionality.
The supervisor log shows:

24-02-28 19:29:00 ERROR (MainThread) [supervisor.backups.manager] Backup 25b7e633 error
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 261, in dobackup
    async with backup:
  File "/usr/src/supervisor/supervisor/backups/backup.py", line 363, in __aexit
    self.outersecuretarfile.exit(
  File "/usr/local/lib/python3.12/site-packages/securetar/_init.py", line 140, in __exit
    self._tar.close()
  File "/usr/local/lib/python3.12/tarfile.py", line 1975, in close
    self.fileobj.close()
OSError: [Errno 5] I/O error

@sanchosk
Copy link

Same thing here. @nicknol did you have any luck? I guess the problem is the file for backup is above 2GB...

@sanchosk
Copy link

@nicknol I think I know where the problem is.
I recently moved my backup location from local data disk to remote NFS.
This seems to be the problem - with NFS, the NC backup does not work.
If I switch the default backup back to local device, the NC backup works again.
Can you, plz, check if you also have default backup location switched to some remote drive? (SMB/NFS)

@nicknol
Copy link
Author

nicknol commented Mar 20, 2024

@sanchosk
yes, the backup itself fails if it is supposed to be created on a NAS and is big:

  • a small backup (~500MB) could be created locally and on the NAS
  • a big(ger) backup (~3GB) could be created locally but not on the NAS

I could create big backups on the NAS in 2023, means using HA 2023.12. I can't remember exactly whether it stopped working with 2024.1 or 2024.2
Writing about it, I think I remember a comment about an improvement/change to handling tar in one of the recent releases. ... have to dig for it
Found it, it was about HASS OS 12: https://www.home-assistant.io/blog/2024/02/26/home-assistant-os-12-support-for-raspberry-pi-5/

@Sebclem
Copy link
Owner

Sebclem commented Apr 10, 2024

Can you confirm that this is not related to this addon ?

@sanchosk
Copy link

I am not sure, cannot confirm nor deny. What I can say is that when the backup location is set to local, the addon works as expected, when the backup location is shared drive, it does not.
At the same time, the shared drive has no problem to create backups of 2+GB.
So, can't tell "where is the ball", but I know that the combination of the addon and external drive for backup renders the addon defective.

@Sebclem
Copy link
Owner

Sebclem commented Apr 10, 2024

This could be linked to the location api param, but it's strange because this should fallback to the default setting....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants