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

backup completes but uploads to nextcloud with 0 bytes #135

Closed
ret1 opened this issue May 3, 2022 · 11 comments
Closed

backup completes but uploads to nextcloud with 0 bytes #135

ret1 opened this issue May 3, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@ret1
Copy link

ret1 commented May 3, 2022

Describe the bug
backup completes but when uploaded to nextcloud it has 0 bytes filesize

To Reproduce
trigger a backup in the "Nextcloud Backup" ha addon using the "Backup Now" button (or just wait for an time triggered automatic update)

Expected behavior
backup uploaded to nextcloud should have != 0 bytes filesize

System information

  • Home Assistant Version : 2022.4.7 (core)
  • Home Assistant Supervisor Version : 2022.04.0
  • Nextcloud Version : Nextcloud Hub II (23.0.4)
  • Addon version : 0.17.2
  • Webserver: apache2 2.4.41-4ubuntu3.10; php8.0-fpm 8.0.18-1+ubuntu20.04.1+deb.sury.org+1

Additional Information

  • deinstall/reinstall "Nextcloud Backup"-addon didn't help
  • using "App password" (machine account) didn't work
  • manually uploading files using the nextcloud webinterface does work, but using the same usercredentials for "Nextcloud Backup"-addon doesn't.

Logs
*** Nextcloud logs ***
no nextcloud logs

*** Nextcloud Backup logs ***

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-run: applying... 
[fix-attrs.d] 10-run: exited 1.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
Add-on: Nextcloud Backup
Easily upload your Home Assistant backups to Nextcloud
-----------------------------------------------------------
Add-on version: 0.17.2
You are running the latest version of this add-on.
System: Home Assistant OS 7.6  (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.4.7
Home Assistant Supervisor: 2022.04.0
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to DEBUG
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[14:33:07] INFO: Starting Node...
[2022-05-03 14:33:11] [info]: 	Log level: debug
[2022-05-03 14:33:11] [info]: 	Backup timeout: 5400000
[2022-05-03 14:33:11] [info]: 	Satus : Go !
[2022-05-03 14:33:11] [info]: 	Initializing and checking webdav client...
[2022-05-03 14:33:12] [info]: 	Starting auto clean cron...
[2022-05-03 14:33:12] [info]: 	Starting Cron...
[2022-05-03 14:33:12] [info]: 	Hassio API : Go !
[2022-05-03 14:33:12] [debug]: 	Nextcloud connection:  Success !
[2022-05-03 14:33:12] [debug]: 	Path /backup/ already exist.
[2022-05-03 14:33:12] [debug]: 	Path /backup/homeassistant/ already exist.
[2022-05-03 14:33:12] [info]: 	Nextcloud connection : Go !
[2022-05-03 14:36:25] [info]: 	Stopping addons...
[2022-05-03 14:36:25] [info]: 	... Ok
[2022-05-03 14:36:25] [info]: 	Creating new snapshot...
[2022-05-03 14:36:25] [debug]: 	Addon to backup:
[2022-05-03 14:36:25] [debug]: 	core_mosquitto,229cc4d7_nextcloud_backup,a0d7b954_nodered,core_samba,a0d7b954_spotify,a0d7b954_vscode,core_ssh,a0d7b954_wireguard
[2022-05-03 14:36:25] [debug]: 	Folders to backup:
[2022-05-03 14:36:25] [debug]: 	homeassistant,ssl,share,media,addons/local
[2022-05-03 14:36:25] [debug]: 	Is password protected ? false
[2022-05-03 14:37:03] [info]: 	Snapshot created with id a2c565ce
[2022-05-03 14:37:03] [info]: 	Downloading snapshot a2c565ce...
[2022-05-03 14:37:03] [debug]: 	Snapshot size: 26.7
[2022-05-03 14:37:04] [info]: 	Download success !
[2022-05-03 14:37:04] [debug]: 	Snapshot dl size : 26.69921875
[2022-05-03 14:37:04] [info]: 	Uploading snap...
[2022-05-03 14:37:04] [debug]: 	...URI: https://host.hiden/remote.php/webdav/backup/homeassistant/Manual/Manual-2022.4.7-2022-05-03_1436.tar
[2022-05-03 14:37:04] [debug]: 	...rejectUnauthorized: true
[2022-05-03 14:37:08] [info]: 	Upload done...
[2022-05-03 14:37:08] [info]: 	...Upload finish ! (status: 201)
[2022-05-03 14:37:08] [info]: 	Starting addons...
[2022-05-03 14:37:08] [info]: 	... Ok
[2022-05-03 14:37:08] [debug]: 	Snapshot size: 26.69
[2022-05-03 14:37:08] [info]: 	Local clean done.

*** apache2 logs ***

62.178.91.83 - - [03/May/2022:14:37:04 +0200] "PUT /remote.php/webdav/backup/homeassistant/Manual/Manual-2022.4.7-2022-05-03_1436.tar HTTP/1.1" 201 7194 "-" "got (https://github.com/sindresorhus/got)"
@ret1 ret1 added the bug Something isn't working label May 3, 2022
@ersate
Copy link

ersate commented May 3, 2022

I have the same issue with the following configuration.

System information

Home Assistant Version : 2022.4.7 (core)
Home Assistant Supervisor Version : 2022.04.0
Addon version : 0.17.2
Nextcloud Version : Nextcloud Hub II ((23.0.3)  
System : Ubuntu 20.10 (on MS Server 2022 - HyperV)
Database :  mysql 8.0.28
Webserver: apache 8.0.16

*** Nextcloud Backup logs ***

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-run: applying... 
[fix-attrs.d] 10-run: exited 1.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Nextcloud Backup
 Easily upload your Home Assistant backups to Nextcloud
-----------------------------------------------------------
 Add-on version: 0.17.2
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (amd64 / qemux86-64)
 Home Assistant Core: 2022.4.7
 Home Assistant Supervisor: 2022.04.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[17:37:19] INFO: Starting Node...
[2022-05-03 17:37:21] [info]: 	Log level: info
[2022-05-03 17:37:21] [info]: 	Backup timeout: 5400000
[2022-05-03 17:37:21] [info]: 	Satus : Go !
[2022-05-03 17:37:22] [info]: 	Initializing and checking webdav client...
[2022-05-03 17:37:22] [info]: 	Starting auto clean cron...
[2022-05-03 17:37:22] [info]: 	Starting Cron...
[2022-05-03 17:37:22] [info]: 	Hassio API : Go !
[2022-05-03 17:37:22] [info]: 	Nextcloud connection : Go !
[2022-05-03 17:37:52] [info]: 	Stopping addons...
[2022-05-03 17:37:52] [info]: 	... Ok
[2022-05-03 17:37:52] [info]: 	Creating new snapshot...
[2022-05-03 17:39:09] [info]: 	Snapshot created with id 7a71695d
[2022-05-03 17:39:09] [info]: 	Downloading snapshot 7a71695d...
[2022-05-03 17:39:10] [info]: 	Download success !
[2022-05-03 17:39:10] [info]: 	Uploading snap...
[2022-05-03 17:39:13] [info]: 	Upload done...
[2022-05-03 17:39:13] [info]: 	...Upload finish ! (status: 201)
[2022-05-03 17:39:13] [info]: 	Starting addons...
[2022-05-03 17:39:13] [info]: 	... Ok

@Sebclem
Copy link
Owner

Sebclem commented May 3, 2022

Did you have this issue before the upgrade or is it new ?

@ret1
Copy link
Author

ret1 commented May 3, 2022

im pretty sure an update is the reason for the problem, but can't tell which one. i did an upgrade on nextcloud (from 21 i think) AND an HA upgrade at approx. the same time. after that, the problem appeared.

@ersate
Copy link

ersate commented May 3, 2022

In my case, i just found out this add-on and installed for the first time.
As a side note, after this add-on creates a snapshot, google backup integration uploads the file to google drive successfully.

@Sebclem
Copy link
Owner

Sebclem commented May 3, 2022

Ok, I was digging into the got documentation and I think I have found something:

Since Got 12, the content-length header is not automatically set when body is an instance of fs.createReadStream().

With the last addon upgrade I have upgraded form got 11 to 12, so this can be the issue, i'm preparing a fix. 🤞

@Sebclem
Copy link
Owner

Sebclem commented May 3, 2022

Fix released with 0.17.3, please upgrade and tell me if this fix the issue

@Johnyboy1984
Copy link

I'm testing right now, I'll let you know the result in a few minutes.

@Johnyboy1984
Copy link

Thanks so much. I just completed the test and I can report that the update fixed the bug. Thanks a lot for this.

@ret1
Copy link
Author

ret1 commented May 4, 2022

0.17.3 fixed my problem. many thanks. coffee for you!

@ersate
Copy link

ersate commented May 4, 2022

Fix released with 0.17.3, please upgrade and tell me if this fix the issue

I do confirm as well that the new version fixed the problem, thanx again.

@Sebclem
Copy link
Owner

Sebclem commented May 4, 2022

Perfect ! This issue can be close. And @ret1, thank so much you for the coffee ! 👍

@Sebclem Sebclem closed this as completed May 4, 2022
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

4 participants