Hi,
I just changed my Nexcloud server, and now cannot sync anymore. I saw a lot of posts about this error, but I am a bit lost, and it is most probably related to my configuration so here are the details :
Nextcloud 20.0.2 is running on Openmediavault, as well as Swag (formely known as letsencrypt) as reverse proxy.
Certificates have been generated, and SSL Report web site is fine, I got A. It says "RSA 4096 bits (SHA256withRSA)", TLS 1.2 and 1.3 supported, Let's Encrypt Authority X3 issuer.
I have to mention that on the smartphone when wifi is activated, I have my own DNS activated (Pihole actually) because the domain name must be resolved locally (NAT loopback issue). But this setting works fine for the Nextcloud android application (actually, I need it to make it works).
Voilà, is it supposed to work, or is there something wrong I should look at ? And should I use Webdav or Nextcloud method to sync preferably ?
Hello,
Some good news : I installed Joplin 1.4.11, and tried again. Same error.
Then I disabled WIFI on smartphone, to force GSM usage, and sync finally starts (using Nextcloud connector and webdav URL provided by Nextcloud.
-=-
So it appears to be a "NAT hairpinning" issue (or NAT loopback). On smartphone, I have Blokada application running with my own DNS set, pointing to my Pihole local server. On that Pihole server, I have set the 2 DNS records (A & CNAME) for my local machine running OMV, Nextcloud and Swag.
That setting works for Nextcloud client application on the smartphone (I set it up for that purpose).
That setting does not work for Joplin sync, so problem is most probably related to DNS resolution and NAT...
Some more context :
My WIFI connection is set to DHCP, the Livebox from Orange french provider is the server. I guess it provides me with a IPv6 DNS I cannot remove (even modifying WIFI connection to STATIC and setting my own local DNS), this is why at the end I installed Blokada to make Nextcloud App work...
It is not clear to me what happens at this stage, but that may help some people facing the "Network request failed" error.
I hope that helps...
Hi!
I have the same issue since an upgrade of Joplin 1.4.11 on Android, I have a configuration with documents on a pi running NextCloudPi... but unfortunately the trick to disable wifi didn't work for me! I
Actually it does not work anymore for me. It worked once, then no way to sync anymore.
It is really annoying, and for me a big issue being unable to sync from android. I guess (from what I read here) it is related to certificate, but I dont want to enable http access on my nextcloud server, for security reason.
Because Nextcloud Android App is syncing fine on the same smartphone, there is for sure an issue with Joplin client.
I start thinking about looking for another app for my notes because of this.
@JackGruber,
Thanks, you point me to the right direction. It is working now again with wifi disconnected.
Explanations:
What happened is that I set up Pihole as DHCP provider on my LAN, trying to resolve that " NAT hairpinning" issue. This was required to access Nextcloud webUI and complete my setup :
That way, Pihole also works as DNS provider, and I created to records (A & CNAME) to point to my Nextcloud server Iocal IP Address. So far so good.
So now the smartphone also gets IP and DNS from Pihole. But Joplin still fails to sync in such configuration. And my last tries with wifi were failing, thus my last post.
-=-
Your update about Certificate Chain Complete (which is good by the way) makes me realized one thing : my provider changed my IP address !! (French Orange provider does not grant you static IP address, unfortunately). So this is why my sync was not working anymore on GSM. I had to update my DNS records at the domain level, and now Joplin sync is back when wifi is off !
Good news, I can stay with this limitation, it is not a big deal to me.
QUESTION:
But I have a question then (if you know the answer) : does that mean using my local IP address, my certificate does not work (and therefore makes Joplin sync fails) ? What I observe is that the workaround defining local DNS records to bypass the NAT limitation allows me to access the Nextcloud server UI, but I had to validate a "warning" about certificate before accessing (probably linked to that different IP address). Could that be the reason why Joplin sync fails ??
Thank you anyway for your help.
When creating the docker container for Nextcloud, I did use names (URL and SUBDOMAINS). And Swag container created the Let's Encrypt certificate (see first post).
-=-
But I still have to confirm certificate when navigating first time from a browser on my LAN: something about "not secured connection", and details say "This Web site contains identifying information that belongs to a different Web site. The identifying data on this website has not been issued by a trusted organization."
Once you accept to continue, all is fine.
-=-
May this is causing the issue with Joplin on the LAN ?
Is your Certificate OK when you check it with openssl or an online tool? Check SSL Certificate - GeoCerts / openssl s_client -showcerts -servername <HOST> -connect <HOST>:<PORT>
If the certificate is for a.b.com and you browse internally to 10.0.2.3 you will get such an error. Thus you will have to enter in your /etc/hosts file the following entry:
My answers in bold:
From WAN is verything fine? yes
When this is true, then normaly no certificate warning will not be shown.
Therefore I think that something is wrong with the configuration / call.
Your certificate is for: nextcloud.my.domain ? nextcloud.host.my.domain
When i read it corectly you use Let's Encrypt certificate? Issuing CA: Let's Encrypt Authority X3
On your pihole you change the IP for nextcloud.my.domain? one A record for host.my.domain, and one CNAME record for nextcloud.my.domain (as registered at domain level)
You use on LAN the FQDN (nextcloud.my.domain) not only nextcloud? Yes, and no issue there. For Joplin, I use the webdav URL provided by nextcloud
Visiting https://nextcloud.my.domain/remote.php/dav/files/user/ from WAN is OK? Yes, get authentification window then webdav interface message like below.
Visting https://nextcloud.my.domain/remote.php/dav/files/user/ from LAN gives an error? No, I get the default message "This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client."
Is your Certificate OK when you check it with openssl or an online tool? https://www.geocerts.com/ssl-checker / openssl s_client -showcerts -servername -connect :
With openssl you can also check your LAN side. All tests are ok, both gocerts (website) and openssl tool (local command line)*, I guess openssl result is the LAN side as my desktop has the pihole DNS for resolver.
Well I don't really agree with that. This is all about resolution name process (services order), whatever it is done by local hosts file or DNS server. So, if hosts file is read first, then I will fallback to my NAT hairpinning issue.
-=-
To keep things simple:
my desktop on ethernet LAN (Ubuntu) has no problem with Joplin to sync using "Nextcloud" method. DNS is my pihole server and DNS names points to local address.
my smartphone with wifi activated (and pihole as DNS) : Nextcloud app has no problem to sync, Joplin fails systematically (network request failed).
-=-
As I said, I can live with that (sync on GSM).