Android Sync Issue

Operating system

Android

Joplin mobile version

Joplin Mobile 3.2.7 (prod, android)

Client ID: 308fa3966d8140e2925cee3e30418e6b
Sync Version: 3
Profile Version: 47
Keychain Supported: No

Revision: 2fba10133 (dev)

Android API level: 35
WebView version: 135.0.7049.111
WebView package: com.google.android.webview
FTS enabled: 1
Hermes enabled: 1

Desktop version info

Joplin 3.2.13 (prod, linux)

Client ID: 04ae04c990ec46bcbd46c7854fd13f9f
Sync Version: 3
Profile Version: 47
Keychain Supported: No

Revision: a898e17

Backup: 1.4.2
Freehand Drawing: 2.14.0

Sync target

Nextcloud

What issue do you have?

I can't seem to get Joplin oon Android to sync with Nextcloud/WebDAV whatever I try. I can sync successfully to Onedrive though. I have no issues syncing with my Desktop App to the same Nextcloud account, so I don't think that is the issue, but for completness sake my Nextcloud instance is running via docker using the nextcloud:production image (Nextcloud Hub 10 - 31.0.4) and it sits behind a pfSense haproxy.

When I look at the logs on my nextcloud when I try and sync, this is what I see:

192.168.1.100 - terry [28/Apr/2025:02:06:47 +0000] "GET /remote.php/webdav/joplin/info.json HTTP/1.1" 200 3670 "-" "Joplin/1.0"
192.168.1.100 - terry [28/Apr/2025:02:06:48 +0000] "PUT /remote.php/webdav/joplin/5023206f478e4132928ade68ac0cdf5d.md HTTP/1.1" 204 0 "-" "Joplin/1.0"
192.168.1.100 - terry [28/Apr/2025:02:06:52 +0000] "PUT /remote.php/webdav/joplin/5023206f478e4132928ade68ac0cdf5d.md HTTP/1.1" 204 0 "-" "Joplin/1.0"
192.168.1.100 - terry [28/Apr/2025:02:06:59 +0000] "PUT /remote.php/webdav/joplin/5023206f478e4132928ade68ac0cdf5d.md HTTP/1.1" 204 0 "-" "Joplin/1.0"
192.168.1.100 - terry [28/Apr/2025:02:07:09 +0000] "PUT /remote.php/webdav/joplin/5023206f478e4132928ade68ac0cdf5d.md HTTP/1.1" 204 0 "-" "Joplin/1.0"

I have no idea where these 500 Internal Server Error logs are coming from, as I don't see them either in my haproxy, or in my nginx/nextcloud logs.
I initially tried with End to End encryption (worked fine from my desktop), but when I couldn't get Android --> Nextcloud sync working I disabled it to ensure that wasn't the issue. The same issue occurs if I try with a new/empty sync folder on my Nextcloud too.

Screenshots

Log file

mobile-log.log (784 KB)

I went and setup Joplin Server and funnily enough I get the same issue.
The desktop version both on Windows and Linux works fine, the Android app has the same error.
I'm starting to think now that it is something specifically with the Android app/version I'm using, or the haproxy config on my pfSense router which is specifically only causing the issue on Android.

I'm clutching at straws here... any further assistance would be helpful!

Here are the relevant logs from the joplin server container when I try to sync:

04:31:22 0|app  | 2025-04-29 04:31:22: App: GET /api/items/root:/info.json:/content (200) (8ms)
04:31:43 0|app  | 2025-04-29 04:31:43: [error] App: 192.168.1.100 FormidableError: Could not parse form: Request aborted
04:31:43 0|app  |     at IncomingMessage.<anonymous> (/home/joplin/packages/server/node_modules/formidable/src/Formidable.js:197:21)
04:31:43 0|app  |     at IncomingMessage.emit (node:events:517:28)
04:31:43 0|app  |     at IncomingMessage._destroy (node:_http_incoming:224:10)
04:31:43 0|app  |     at _destroy (node:internal/streams/destroy:109:10)
04:31:43 0|app  |     at IncomingMessage.destroy (node:internal/streams/destroy:71:5)
04:31:43 0|app  |     at abortIncoming (node:_http_server:781:9)
04:31:43 0|app  |     at socketOnClose (node:_http_server:775:3)
04:31:43 0|app  |     at Socket.emit (node:events:529:35)
04:31:43 0|app  |     at TCP.<anonymous> (node:net:350:12) {
04:31:43 0|app  |   code: 1002,
04:31:43 0|app  |   httpCode: 500
04:31:43 0|app  | }
04:31:43 0|app  | 2025-04-29 04:31:43: App: PUT /api/items/root:/info.json:/content (500) (14ms)
04:31:43 0|app  | 2025-04-29 04:31:43: App: POST /api/sessions (200) (157ms)
04:31:43 0|app  | 2025-04-29 04:31:43: App: POST /api/sessions (200) (75ms)

The fact that the log for your Nexcloud shows that you got HTTP 200 and 204 responses emitted, I think it is highly likely the problem is something to do with haproxy. If it's only happening with the Android app, it may be some kind of incompatability between the http client used by the Joplin Android app and haproxy

I figured it might be, how do I go about bypassing haproxy?
From what I can tell, when I try and sync against either my nextcloud or joplin server directly from my local network, I can't get it working.
I'm assuming the android app requires tls for all network sync operations maybe?

Don't know the answer to that, sorry

It's strange that it's something specific to do with the haproxy and android combination, considering it works for other clients and I've never encountered anything like this before.I guess I'll wait and see if someone else has any ideas because I'm out of them :grin:

As a test you could try setting up a free hosted Nextcloud account, setup sync to that and see if you have any problems syncing the Android app with that (if you're in the UK you can use https://thegood.cloud/).

If it works fine then that would confirm an issue with the proxy / network config. If it doesn't work then it would point to an issue with your local network configuration or some rare client and network incompatibility.

Alternatively, if your nextcloud / joplin server instance is publicly accessible, you could try using mobile internet on your Android device instead of wifi, and that would bypass the proxy as you say it's on your router?

This wouldn't help as the haproxy is a reverse proxy doing SSL/TLS offload for my internal (nextcloud/joplin) services.

When I have some time I'll try and confirm separate nextcloud connectivity other than mine, although I'm sure that will work as no-one else (to my knowledge) is having this issue...

Another thing, the nextcloud app on the same Android works for uploading files through the same path, Android --> haproxy --> nextcloud. So there is definitely something specific in the Android Joplin app that isn't playing nice, just not sure how I would debug this further...

Maybe you could try changing the webdav url you set in Joplin to the following different formats and see if any of them work:

https://<url>/remote.php/webdav/files/<username>/joplin/
https://<url>/remote.php/webdav/files/joplin/
https://<url>/remote.php/webdav/joplin/
https://<url>/remote.php/dav/files/<username>/joplin/
https://<url>/remote.php/dav/files/joplin/
https://<url>/remote.php/dav/joplin/

Also did you try expanding advanced settings on the sync screen and enabling the ignore tls certificate errors option? And did you enter the details for your proxy in the proxy section? You could also try increasing the proxy timeout seconds you can set there, or try reducing the max concurrent connections to 1

Success!

Here are my findings:
I did try the multiple different folders earlier with the same issue.
However, after ignoring TLS cert errors, I don't get the issue anymore. Which is really strange.
As you can see below from the qualys SSL check, everything seems fine and this is the first time I've encountered an issue like this.
It's not great that I'm ignoring TLS errors but it at least unblocks my specific use case. I wonder if the Android only supports a specific procotol/cipher suite or something and that's why??

1 Like