Backup: Nextcloud configuration

Started by baqwas, July 31, 2020, 10:09:02 PM

Previous topic - Next topic
Hello!

At System --> Configuration --> Backups, Download and Restore are working for me but the others fail after saving the settings.

Google Drive, Mailer and Nextcloud didn't work. For Mailer, I used telnet to confirm that the the LAN connectivity to the SMTP server is open (incidentially, the receiving mail server is the same instance and is working with other mail traffic). For Nextcloud, I used the same credentials to logon to Nextcloud server and to confirm that the Directory Name folder exists under the home folder. Don't know how to check Google Drive independently (but that come later).  :)

The important one for me right now is backup to Nextcloud. What else can I check (or set) to enable this functionality, please? Thanks.

Kind regards.

If the Nextcloud integration fails, it loggs the error to Syslog. You find it in the system section.

Thx, @Fabian.

The error message on the page is:

The following input errors were detected:

    Saved settings, but remote backup failed.


There are two (I think,  :) entries related to the attempt to setup the backup to Nextcloud:

  • Settings in JSON format

  • "Cannot get real username"

In my ignorance, I used an active Nextcloud username at the first attempt and then after some reading used an OAuth id generated by Nextcloud for access by apps. Both attempts resulted in the same status message. In response to the prompt for the username field "The name you use for logging into your Nextcloud account" I did confirm that I can logon to Nextcloud using this username and the specified folder exists in the Nextcloud instance under that user's home folder. Obviously, this is some user authentication issue owing to my inability to understand the backup credential requirement since not a single Nextcloud username (even one with elevated privileges) seems to work for this setup.

I am presently on OPNsense 20.7 and Nextcloud 19.0.1. How can I meet the requirement for username to backup the configuration, please? Thanks.

Kind regards.[/list][/list]

August 01, 2020, 11:04:45 PM #3 Last Edit: August 01, 2020, 11:09:21 PM by fabian
The plugin works with the LDAP users as well as native users so the translation to uuids should work however I do not know the authentication backend you are using. It might be incompatible.

OK. Thx.

Not LDAP & didn't use uuid (via Nextcloud issued OAuth) until the three Nextcloud account usernames failed to work. I'll keep on tinkering to see where I entered incorrect data. Obviously some disconnect at my end.

Kind regards.

Hi,

Did you ever figure this out? I'm having the exact same issue and have tried all the things you mentioned.

Hi,

Don't forget to enable the backup before you test, if you don't and than test, it would be a reason to get that message you see ;)

Greetings, mark

Thanks Mark, I did that (screenshot attached). This is frustrating because there's nothing in the error message to indicate where it's failing. Earlier post suggested checking syslog under the System menu but mine only shows Backend, General and Web GUI and scrolling through those I don't see anything referencing an error. Fwiw, backup worked fine before I upgraded to 20.7.

Okay, so you didn't make any changes and it suddenly stopped working after updating?
Have you tried to recreate the whole setup without touching your backup dir. on NC?
Like create a new app PW etc.?
Do you have a user setup on NC solely for OPNsense backups, if not try and recreate that setup...

I didn't have any problems updating, though, both my OPNsense and NC are running on Proxmox, so the situation is different but the purpose is the same ;D

Greetings. mark

That's correct, was working fine and then one day I noticed it hadn't updated in a while. Last backup was 6/21 which was before 20.7 so I was mistaken about that. Installing and using my OPNsense router was a Corona project so I'm still fairly new at this :) I tried your suggestion, created a dedicated NC user, new app password and fresh backup dir but still get the same error. I wish there was a terminal available in the GUI, there must be a error message logged somewhere that would tell me what's failing.

Hmmm, things usually don't suddenly stop working, unless there was something off in the first place or changed in such a manner they demolish your working solution in a later stadium.
See, in basics it's actually a very simple construct, OPNsense makes a backup and uploads the file to an online filesystem, almost similar to a NAS - I know it's not the same but that's beside the point... ;D
Okay, are you able to address the backup account you created with some client on Linux, Android or whatever client and are you able to see the content of the backup dir.(OPNsense) on NC, can you send a file to it?
BTW. are you sure the URL is correct?, and not that it should be 'https://192.168.1.100/nextcloud'; or 'https://nextcloud.subdomain.tld'??

Yes, I can sync to the NC server from my various devices no problem and that plain address worked before. I don't know what method of access OPNsense uses behind the scenes so from your suggestion I tried the WebDAV URL https://192.168.1.100/remote.php/dav/files/indie/ and a direct folder address https://192.168.1.100/apps/files/ with no luck. It's fine to just manually save backups now and then, just frustrating when things should work :) When I saw the original post I was hoping maybe @baqwas had found a solution. Thanks for all your help!

You don't need the WebDav URL, though, if your server would be mine, the address I would need would be 'https://192.168.1.100/nextcloud'
BTW. you're not the only one having issues with logging there should be a fix in 20.7.2, lets hope it works for everyone..

October 16, 2020, 11:24:24 AM #13 Last Edit: October 16, 2020, 11:27:52 AM by ReDaLeRt
Quote from: baqwas on August 01, 2020, 08:33:44 PM
Thx, @Fabian.

The error message on the page is:

The following input errors were detected:

    Saved settings, but remote backup failed.


There are two (I think,  :) entries related to the attempt to setup the backup to Nextcloud:

  • Settings in JSON format

  • "Cannot get real username"

(...)


This is still an issue for me on OPNsense 20.7.3 and Nextcloud 19.0.4.



2020-10-16T10:15:55 config[31428] {"url":"https:\/\/192.168.10.67:443\/ocs\/v1.php\/cloud\/user","content_type":null,"http_code":0,"header_size":0,"request_size":0,"filetime":-1,"ssl_verify_result":1,"redirect_count":0,"total_time":0.022022,"namelookup_time":6.4e-5,"connect_time":0.000381,"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"192.168.10.67","certinfo":[],"primary_port":443,"local_ip":"192.168.10.1","local_port":33230,"http_version":0,"protocol":2,"ssl_verifyresult":0,"scheme":"HTTPS","appconnect_time_us":0,"connect_time_us":381,"namelookup_time_us":64,"pretransfer_time_us":0,"redirect_time_us":0,"starttransfer_time_us":0,"total_time_us":22022}
2020-10-16T10:15:55 config[31428] Cannot get real username


... same issue here.
Some news avaliable?