NextCloud HowTo Sailfish OS Backup

Hi community and sailors,

is there a step by step description how to install and configure NextCloud for the Sailfish OS backup?

(Sailfish 3.4.0.24, XA2 single sim)

I managed to install NextCloud on my Synology NAS (youtubeguide) and I get a connection witch an android app (even with a two way authenticator), but it does not work with SailfishOS. Creating an account is possible, but it is not working. Are there some tweaks I have to know, or to setup in the createt acount in the account settings, that differ from standard Sailfish settings?

It would be great if someone who knows how to set it up could make a HowTo guide for beginners.

Or is there a bug that is currentliy making this NextCloud-backup thing not usable?

When Jolla introduced Nextcloud integration, there were a few issues which have been discussed at https://together.jolla.com/question/224331/330-issues-with-nextcloud-integration/ and similar threads. For instance, it was necessary to run Nextcloud in the webserver’s root instead of a subdirectory.

Just for clarification: ist it just backup that’s not working or the Nextcloud account in general? Topic title suggests your problem ist just tied to backup, but the text sound like there are general problems.

For just backup problems: as far as I remember you need to set the the backup folder in your Nextcloud first. Sailfish backup doesn’t create that folder, and when you set up the account on sailfish you can’t chance the destination folder. But it might work if you add a folder in your Nextcloud that matches the standard backup path provided by sailfish nextcloud account setup.

Well, if you create a new account for nextcloud at 3.4 the backup path is setup correctly. If you have created the nextcloud account a release earlier, than there won’t be the correct path and you have to set it manually (Nextcloud-backup-client fails to upload). But this assumes a working nextcloud server.

1 Like

Standard path from sailfish default is
/remote.php/dav/files/Username/Sailfish OS/Backups.

As Sailfish doesn’t create folders you’ll need to create a folder
Sailfish OS/Backups
in your Nextcloud files to get it working. That was what I wanted to say.

Nevertheless following your link I discovered that the account settings/path can be changed later from advanced settings… Wasn’t aware of that.

Well, If I remember correctly, the Sailfish is creating the set path at the server correctly…
It worked at least for me.

Hi, sorry for the late reply. Well ich checked all the paths and created some for the backup (the Photo Path was standard).

I checked the WEBdav path settings, and they are simmilar to the ones in the Sailfish acount settings. (or I mede them simmilar :slight_smile:

sample: https://xxx.xxx.xxx.xxx (IP)/nextcloud/remote.php/dav/files/MyCloud/ => created folder=> SailfishOS/backup

in the nexloud android app the syncing works fine. the created sailfish OS folder is shown and usable.

the system-backup of Sailfish does stil not work. Also no photos have been synced. No idea what I am doing wrong. that is why i ask for a step by step ducumentation how to set it up the right way, or how Jolla is thinking it should work…

Syncing ist supposed to work only in my local area network. without wifi even the Android app is not syncing.

1 Like

I had the same problem with nextcloud running on DSM. It is not a sailfish issue, for some reason webDAV does not work on nextcloud on top of DSM if you do not run it in the web root folder. I soved this by using a virtual host. Alternatively you could move your nextcloud instance to the web root. Forwarding via htaccess seems not to work, at least I read that.

Solved my problem with backup file on Nextcloud.
My certificate configuration is:
root-certificate -> ssl certificate
error uploading file was: apache 401 (could not upload file - access denied)
I have to place my root-certificate on the phone directory ‘/usr/share/pki/ca-trust-source/anchors/’ (pem format).
Then i use ‘update-ca-trust’ script to place the certificate to the right destination (verifying on settings -> certificates -> tls).
Now backup works fine :wink:.

It seems not to be possible to import own root certificates on the frontend :thinking:. But maybe this is not desired …

I too am having issues with getting the Nextcloud account to work.
I’m running a fresh NextCloudPi instance, and have ticked the “Ignore SSL-errors” option in the account settings.

The logging in succeeded when creating the account, but it is throwing HTTP 401 left right and center behind the scenes (journalctl).
Both when doing synchronize in the account settings, and when opening the backup page.

e.g.

maj 07 19:55:21 Xperia10-DualSIM nextcloud-backupquery-client[31047]: [W] unknown:0 - Nextcloud "nextcloud-backup" sync for account 10 finished with error: "Remote directory listing failed (http status=0)"
maj 07 19:55:21 Xperia10-DualSIM nextcloud-backupquery-client[31047]: [C] unknown:0 - Nextcloud Backup sync failed: 401 ""

The WebDAV path is (automatically) set to /remote.php/dav/files/ncp which is consistent with what the web GUI tells me to use for files.
The folders “Sailfish OS” and “Backups” beneath it exists and have the same permissions as e.g. Pictures.
I have enabled automatic filesystem sync, so they show up in the web GUI.
The backup path is set to /remote.php/dav/files/ncp/Sailfish OS/Backups
…so it should work?

Any ideas what i might have missed?

Edit: and the nextcloud instance works with my file browser on my desktop, nemo ( :slight_smile: ) so at least there is something right about the setup.

2 Likes

For benefit of others reading this thread; solved here: Backup Nexcloud Error:could not upload file - #7 by buckie

1 Like

On second thought… not solved at all.
Turns out the backup process is lying - no files actually end up on the server, despite the following log.
Does anyone have this working?

nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [Log] "Removing all working files in /home/defaultuser/.local/share/system/privileged/Backups-tmp"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [Log] "Start: rm -rf /home/defaultuser/.local/share/system/privileged/Backups-tmp"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [Log] "Done: rm [OK]"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [Log] "Status = Finished"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Requesting sync profile nextcloud.Backup-2 to upload file /home/defaultuser/.local/share/system/privileged/Backups/nextcloud.Backup-2/sailfish_backup_2021-11-02T17-50-50Z.tar.gz"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status: UploadingBackup"
nov 02 18:51:03 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status text: Laddar upp säkerhetskopia"
nov 02 18:51:03 Xperia10II-DualSIM buteo-oopp-runner[31842]: [D] unknown:0 - Sending request: "PROPFIND" to: "http://ncp:<password_in_plaintext>@odroidxu4/remote.php/webdav/Sailfish OS/Backups/Xperia-10-II---Dual-SIM_XbswWDi6n4C_" data: "<d:propfind xmlns:d=\"DAV:\"><d:prop xmlns:oc=\"http://owncloud.org/ns\"><d:getlastmodified /><d:getcontenttype /><d:resourcetype /><d:getetag /><oc:fileid /><oc:owner-id /><oc:size /></d:prop></d:propfind>"
nov 02 18:51:03 Xperia10II-DualSIM buteo-oopp-runner[31842]: [D] unknown:0 - Sending request: "PUT" to: "http://ncp:<password_in_plaintext>@odroidxu4/remote.php/webdav/Sailfish OS/Backups/Xperia-10-II---Dual-SIM_XbswWDi6n4C_/sailfish_backup_2021-11-02T17-50-50Z.tar.gz" data: "./"
nov 02 18:51:05 Xperia10II-DualSIM kernel: binder: 7000 RLIMIT_NICE not set
nov 02 18:51:08 Xperia10II-DualSIM kernel: binder: 7000 RLIMIT_NICE not set
nov 02 18:51:11 Xperia10II-DualSIM kernel: binder: 7000 RLIMIT_NICE not set
nov 02 18:51:12 Xperia10II-DualSIM kernel: i2c_geni 4a88000.i2c: i2c error :-107
nov 02 18:51:13 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Cloud operation backupToCloud for profile nextcloud.Backup-2 sync status changed: 2"
nov 02 18:51:13 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status: Finished"
nov 02 18:51:13 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status text: Klart"
nov 02 18:51:14 Xperia10II-DualSIM kernel: binder: 7000 RLIMIT_NICE not set
nov 02 18:51:14 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status text: Overksam"
nov 02 18:51:14 Xperia10II-DualSIM p[30093]: [W] unknown:0 - [sailfish-backup] "Status: Idle"
nov 02 18:51:14 Xperia10II-DualSIM invoker[5612]: SailfishKeyProvider_storedKey(): error: no scheme or key found for provider/service
nov 02 18:51:14 Xperia10II-DualSIM invoker[5612]: SailfishKeyProvider_storedKey(): error: no scheme or key found for provider/service
nov 02 18:51:14 Xperia10II-DualSIM invoker[5612]: SailfishKeyProvider_storedKey(): error: no scheme or key found for provider/service
nov 02 18:51:14 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - Sending request: "PROPFIND" to: "http://ncp:<password_in_plaintext>@odroidxu4/remote.php/webdav/Sailfish OS/Backups/Xperia-10-II---Dual-SIM_XbswWDi6n4C_" data: "<d:propfind xmlns:d=\"DAV:\"><d:prop xmlns:oc=\"http://owncloud.org/ns\"><d:getlastmodified /><d:getcontenttype /><d:resourcetype /><d:getetag /><oc:fileid /><oc:owner-id /><oc:size /></d:prop></d:propfind>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "<html><head>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "<title>302 Found</title>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "</head><body>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "<h1>Found</h1>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "<p>The document has moved <a href=\"https://odroidxu4/remote.php/webdav/Sailfish%20OS/Backups/Xperia-10-II---Dual-SIM_XbswWDi6n4C_\">here</a>.</p>"
nov 02 18:51:15 Xperia10II-DualSIM buteo-oopp-runner[32009]: [D] unknown:0 - "</body></html>"

What do you mean by “this”? If you mean backups to NextCloud, then the answer is yes, they do work for me just fine. But of course the server side setup is different, I don’t use NextCloudPi.

On the other hand, quickly looking at the documentation I get the impression that NextCloudPi is using apache as a front end, so it might be not so different after all - I’m using apache as a frontend as well, and nextcloud is running in a separate container. This was not straight forward to get to function perfectly, with the first trials I ended up having issues with directories containing spaces in their names. “Sailfish OS” has a space, so backups were not working for me.

May I suggest that you try removing the space from the backup directory name.

Yes, backups to Nextcloud… because i can’t see how i could have a more “vanilla” setup, and still it is just refusing to work.
I tried removing the Sailfish OS level completely, and created a Backup folder at top level, then changed to that in the Nextcloud account settings - same result, nothing appears on the server.
Both directories are writeable with the same credentials when done from my desktop computer. I have also tried the /remote.php/webdav/ prefix that it uses, as opposed to what the web GUI suggests, but both has the same result. I used to be able to upload pictures, but that too now only fake-succeeds. :confused:

Maybe i should just switch server software…

Necromancy warning!

Backup fails all the time, but error is different from anyone else.

Tried all suggestions for different paths, disabling ssh check, etc. but still have the same error: buteo-oopp-runner[26563]: [W] unknown:0 - bytes empty, aborting

Full log below.

Does anyone know what it means? Other items are synchronized properly, backup directory also has been created (MKCOL succeeds). But no transfer and backup failed.

maj 12 13:13:50 Xperia10III p[25432]: [W] unknown:0 - [sailfish-backup] "Status text: Wysyłanie kopii zapasowej"                                                                                                                                                                                                                                                         
maj 12 13:13:50 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "PROPFIND" to: "https://nextcloud.xxx.yyy/remote.php/dav/files/pc/Backups/Xperia-10-III_uniqueidcomeshere" data: "<d:propfind xmlns:d=\"DAV:\"><d:prop xmlns:oc=\"http://owncloud.org/ns\"><d:getlastmodified /><d:getcontenttype /><d:resourcetype /><d:getetag /><oc:fileid /><oc:owner-id /><oc:size /></d:prop></d:propfind>"                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                          
maj 12 13:13:51 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php" data: ""                                                                                                                                                                                                                     
maj 12 13:13:51 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php/dav" data: ""                                                                                                                                                                                                                 
maj 12 13:13:52 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php/dav/files" data: ""                                                                                                                                                                                                           
maj 12 13:13:53 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php/dav/files/pc" data: ""                                                                                                                                                                                                        
maj 12 13:13:53 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php/dav/files/pc/Backups" data: ""                                                                                                                                                                                                
maj 12 13:13:53 Xperia10III buteo-oopp-runner[26563]: [D] unknown:0 - Sending request: "MKCOL" to: "https://nextcloud.xxx.yyy/remote.php/dav/files/pc/Backups/Xperia-10-III_herecomesuniqueid" data: ""                                                                                                                                                                     
maj 12 13:13:53 Xperia10III buteo-oopp-runner[26563]: [W] unknown:0 - bytes empty, aborting
1 Like