Backup Nexcloud Error:could not upload file

Hi, I’m getting Backup upload error
The Nextcloud (in accounts) seems to have no error when Sync, sharing to Nexcloud works fine too. Running 3.4

As far as I remember you must define a path/folder during setup of your Nextcloud account. And this path/folder must exists in your Nextcloud.

So if you named a specific folder for your backups during account setup you will have manually create this folder in your Nextcloud, it’s not done by backup process. If the folder doesn’t exit backup will fail.

Same problem here. I have deleted the Nextcloud account and after that I set it up once more. Then it works and older backups are recognized

I have the same issue. I also deleted Nextcloud account but still I get the same errors. The path for Backups in the Nextcloud account is: /nextcloud/remote.php/dav/files/MyUser/SailfishOS/Backups/ . And yes, I created the folders SailfishOS/Backups in the Nextcloud. I’ve tried also with path: /nextcloud/remote.php/webdav/files/MyUser/SailfishOS/Backups/ . Unfortunately without success. Even though I am able to upload pictures or files into nextcloud account, in the Backup menu of Sailfish OS I still get the error : “Cannot connect to cloud service”. Has someone an idea? Thank you!

Logs:
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status: UploadingBackup”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status text: Uploading backup”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM nextcloud-backup-client[26361]: [W] unknown:0 - Nextcloud “nextcloud-backup” sync for account 30 finished with error: “Remote directory listing failed (http status=0)”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM nextcloud-backup-client[26361]: [C] unknown:0 - Nextcloud Backup sync failed: 401 “”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Cloud operation backupToCloud for profile nextcloud.Backup-30 sync status changed: 4”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status: Error”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status text: Error: could not upload file”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Error! error=CloudUploadError errorString=, details:\u0091”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status text: Idle”
Jan 03 14:34:09 XperiaXA2Plus-DualSIM p[24724]: [W] unknown:0 - [sailfish-backup] “Status: Idle”

I just fixed this using :
/remote.php/dav/files//SailfishOS/Backups
and restart backup
If you try to add another nextcloud account, you can see in advanced setting default path

It didn’t helped in my case :frowning:
What is concerning me is following error message: [W] unknown:0 - Nextcloud “nextcloud-backup” sync for account 30 finished with error: “Remote directory listing failed (http status=0)
I am sure that the path of the backup folder is ok.

This error during backup is almost certainly caused by a wrong SSL certificate: either correct but expired one, or a self-signed one, or belonging to a different domain. You can always check it by downgrading your Nextcloud instance to HTTP and re-adding the Nextcloud account again. If it works with http://… then you know where to look. As a bonus it’s also very easy to capture unencrypted http traffic with tcpdump to see what DAV commands exactly are being issued and what the server responses are.
Do have in mind that this setup should only be used for testing purposes, as you’re going to be sending your password unencrypted over the net. After the testing is done, change your Nextcloud password that is used for Sailfish backups.

Yes, it looks like it is from SSL certificate. But how could I add to my Sailfish Phone my own self-signed certificate or at least to ignore the SSL errors? I remember it was somewhere a topic for this, but I am not able to find it anymore. Thank you!

Wow… i had discounted this as a solution, because other nextcloud uploads work, and i have “Ignore SSL errors” ticked in the account settings. But switching over to plain http indeed fixes it for backups.

So something fails to apply the “Ignore SSL errors” setting, but only for backups… weird.
Wonder who to poke to get that looked at.

1 Like

Not possible to make it work with broken certificates for now. I informed Jolla about this problem and they took note. If they do get to testing it and fixing it, the fix should appear in the next release. It’s this “ignore ssl errors” option that is broken.
Right now the only options are either to go the unencrypted route (http instead of https, not recommended) or get a valid cheap certificate such as PositiveSSL.

I’d rather suggest https://letsencrypt.org

But even with a valid cetificate (letsencrypt with correct intermediate certificates), nextcloud backup is a crapshoot…
Sometimes it works, but most of the time the upload fails.
According to the log, authentification failed (HTTP/401), but credentials are correct (the backup page does list the last backup on the server and caldav/carddav works).

Sep 07 13:36:21 xa2 buteo-oopp-runner[27814]: [W] unknown:0 - Nextcloud "nextcloud-backup" sync for account 69 finished with error: "Upload failed (http status=0)"
Sep 07 13:36:21 xa2 buteo-oopp-runner[27814]: [C] unknown:0 - Nextcloud Backup sync failed: 401 ""
Sep 07 13:36:21 xa2 p[22901]: [W] unknown:0 - [sailfish-backup] "Cloud operation backupToCloud for profile nextcloud.Backup-69 sync status changed: 4"
Sep 07 13:36:21 xa2 p[22901]: [W] unknown:0 - [sailfish-backup] "Status: Error"
Sep 07 13:36:21 xa2 p[22901]: [W] unknown:0 - [sailfish-backup] "Status text: Error: could not upload file"

Server log:

233.252.13.37 - - [07/Sep/2021:13:35:09 +0200] "PROPFIND /nextcloud/remote.php/dav/files/myuser/Sailfish%20OS/Backups/Xperia-XA2---Dual-SIM_XXXXXXXXXXXX HTTP/1.1" 207 1599 "-" "Mozilla/5.0"
233.252.13.37 - - [07/Sep/2021:13:35:45 +0200] "PROPFIND /nextcloud/remote.php/dav/files/myuser/Sailfish%20OS/Backups/Xperia-XA2---Dual-SIM_XXXXXXXXXXXX HTTP/1.1" 401 557 "-" "Mozilla/5.0"
233.252.13.37 - - [07/Sep/2021:13:35:45 +0200] "PROPFIND /nextcloud/remote.php/dav/files/myuser/Sailfish%20OS/Backups/Xperia-XA2---Dual-SIM_XXXXXXXXXXXX HTTP/1.1" 207 1599 "-" "Mozilla/5.0"

Same on my end, even though it’s a certificate problem, the issue being reported is authentication failed (401). It could be triggered by something in the certificate chain, although it’s pretty bare in the case of letsencrypt. Could you try testing with a “regular” certificate?

I got this upload failure since some weeks and looking into the reason it is because http status 413.
In nextcloud log i found this error:
“Token is not valid: Token does not exist: token does not exist”.

I havent noticed issues with Calendar sync and just tested sharing functionality for file using the same Nextcloud account.

The strange thing is: it connects and sees the files which are candidates for restore in same Settings screen.
I would say it’s a bug.

1 Like

I get the same error, but only when the backup is set to automatic (i.e. set to take place at a particular day and time). If I backup manually to Nextcloud it always works. Not sure why there should be a difference here.