[solved] Nexcloud: communication failure

Started by qinohe, June 24, 2018, 04:58:16 PM

Previous topic - Next topic
Hello,

I also have trouble creating backups on Nextcloud. Maybe it's due to 14.x version?

×Close
The following input errors were detected:

communication failure


Relevant log files:

Oct 7 21:26:45 config[4588]: {"url":"https:\/\/blabla.blabla.com\/remote.php\/dav\/files\/blabla\/","content_type":"application\/xml; charset=utf-8","http_code":404,"header_size":1229,"request_size":192,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":0.638179,"namelookup_time":3.8e-5,"connect_time":0.002203,"pretransfer_time":0.019544,"size_upload":0,"size_download":228,"speed_download":357,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0.638121,"redirect_time":0,"redirect_url":"","primary_ip":"<removed IP>","certinfo":[],"primary_port":443,"local_ip":"<removed ip>","local_port":45690}
Oct 7 21:26:45 config[4588]: Error while fetching filelist from Nextcloud

No, I've just upgraded mine to v14 and it still works. From your log I think your path is wrong (maybe a subdirectory instead of root?)

Quote from: fabian on October 07, 2018, 10:09:40 PM
No, I've just upgraded mine to v14 and it still works. From your log I think your path is wrong (maybe a subdirectory instead of root?)

Yes I have to specify a subdirectory, which I've created on my user space.


Hi Alwaysin, what do mean with 'have to specify a sub-directory'?

In my guide you don't, just the name and path to server.

Greetings mark

Hi Qinohe, sorry for the wrong terminology, I meant what is called the "Backup Directory", which is a subdirectory of the main directory that is the name of the user.

I've followed exactly the steps as described here https://github.com/opnsense/docs/blob/master/source/manual/how-tos/cloud_backup.rst#setup-nextcloud-api-usage but I'm still facing this communication failure :(

Does it matter if the user already exists and is used not only for OPNsense backup? Or it the user is an LDAP account?

Quote from: Alwaysin on October 09, 2018, 10:19:53 PM
Does it matter if the user already exists and is used not only for OPNsense backup? Or it the user is an LDAP account?

The authentication mechanism is probably not relevant but the user must exist and can be used for other things as well (you may generate an application token for any app you are using, but I recommend a separate backup user with the directory read only shared for users who need it)

Well, the backup directory is only a name in the form and points to nowhere, at least for you and me, this is done by OPNsense, only set a name like opnsense-backup

Than suppose the nextcloud server is at https://some.domain/nextcloud, than that's what you use as URL address

the form would be:

URL                      https://some.domain/nextcloud
User Name           the user created on nextcloud to do the backup
Password              app password created in users backup account
Directory Name    opnsense-backup

Hope that helps, it should work at least here it does and @fabian already said his was working  ;)

But the same username itself can be used on various machines on the network, however, I would choose a single used user for that purpose btw. like @fabian says or did you mean something different?

Greetings, mark

October 10, 2018, 09:32:07 AM #22 Last Edit: October 10, 2018, 09:35:51 AM by Alwaysin
Thank you all for for putting so much efforts into helping me, much appreciated :)

So I retried everything to make sure:

- created a dedicated local user "opnsense-backup" on my nextcloud
- logged in as said user, created an app password

- went to OPNsense, checked "enable", user name as previously created user, password as given to me by nextcloud, directory name opnsense-backup

And it works!

But I retried again with my LDAP account and it does not work. I think it is because Nextcloud gives the user a random set of character when you bind it to LDAP such as "A1F54823-801A-4R3D-A2C3-B93657CE5310", which appears in the username column but still you have to login with the login of LDAP. And the folder that has to be accessed with webdav is the random-characters string, not the LDAP fancy username.

Hi Alwaysin, glad it works, now how to deal with LDAP I don't know, I understand it's working but I never used it.

https://wiki.opnsense.org/manual/how-tos/user-ldap.html

You probably already went trough that page, but this is as far as my help can stretch  :P

Greetings, mark

I meant LDAP on Nextcloud side !
The backup feature of OPNsense to Nextcloud doesn't know how to deal with LDAP accounts on Nextcloud, but this is not a problem, I've created a local user on Nextcloud.

There are no other processes involved I think it's the best and maybe even the most secure way to set it up like you did now.

Btw. in post #20 @fabian says the mechanism is probably not relevant, so I guess there should be a way to get the LDAP working!?  :D
Maybe someone with more knowledge about this should answer that.

Greetings, mark