joplin icon indicating copy to clipboard operation
joplin copied to clipboard

iOS and Dropbox synchronisation not working

Open akhiar opened this issue 2 years ago • 87 comments

Environment

Joplin version: 12.7.1 (iOS App) Platform: iOS OS specifics: iOS 15.4.1

Steps to reproduce

  1. Install the app
  2. Configuration > Sync target = Dropbox
  3. Link with Dropbox account
  4. Synchronise (ISSUE: No errors but notes are not synced. Log message "Network request failed")

Describe what you expected to happen

PC app works just fine. Only happens in iOS app.

Logfile

20220407_041606346_iOS

akhiar avatar Apr 07 '22 04:04 akhiar

I am also affected by this bug.

I note that this has started to happen within the last 48-72 hours, having worked fine previously.

jl6 avatar Apr 08 '22 15:04 jl6

I also am recently seeing this. I have no firm evidence, but it seems to have started after I updated the Dropbox app on my iOS devices.

bellrichm avatar Apr 08 '22 17:04 bellrichm

Seeing this as well. I didn't do anything different except perhaps a power outage the night before. I will note that it works for one of my iOS device.

sif avatar Apr 08 '22 17:04 sif

Chiming in, iOS app, Monterey desktop. Desktop to desktop on different machines works fine, it's just iOS. Deleted Joplin app and reinstalled from app store, still having the issue.

cspenn avatar Apr 08 '22 18:04 cspenn

I made a quick check on Dropbox's status page (https://status.dropbox.com/) and for the days Joplin was out for me, Dropbox was up.

I was able to intercept the calls made by my Joplin (thank you roman_r_m) and was seeing this error: "Certificate verify failed: self signed certificate"

I was also seeing this repeated: "Client TLS handshake failed. The client disconnected during the handshake. If this happens consistently for [service], this may indicate that the client does not trust the proxy's certificate."

The part where it says [service] includes joplinapp.org, *.googleapis.com, content.dropboxapi.com, etc.

I'm going to assume I setup mitmproxy incorrectly and welcome additional investigation into this.

sif avatar Apr 08 '22 18:04 sif

I have also tested OneDrive and sync works. Switching back to Dropbox on the same device did not fix this issue.

sif avatar Apr 08 '22 18:04 sif

Dropbox sync appears to be broken for me on iOS too. It works perfectly from my MacOS desktop to my MacOS desktop using Dropbox Sync.

seanieb avatar Apr 08 '22 19:04 seanieb

@sif The "Certificate verify failed: self signed certificate" was probably due to the local cert you were using to intercept the traffic. I haven't seen any issues with the cert. You can see the cert here: https://www.ssllabs.com/ssltest/analyze.html?d=content.dropboxapi.com

seanieb avatar Apr 08 '22 20:04 seanieb

I was using the cert from here: https://mitm.it

sif avatar Apr 08 '22 20:04 sif

I was using the cert from here: https://mitm.it

FWIW When I open the link in Firefox I'm getting this:

Firefox does not trust this site because it uses a certificate that is not valid for mitm.it. The certificate is only valid for the following names: cloudfront.net, *.cloudfront.net

Though not sure if it's the same cert you have installed.

UPD Probably a different certificate, ignore me.

roman-r-m avatar Apr 08 '22 20:04 roman-r-m

My Dropbox sync is also broken since updating the Dropbox app two days ago on my iPad Pro (15.4.1). It's syncing fine in Windows and Android.

I uninstalled Joplin and reinstalled it, including re-authorizing it in Dropbox. Everything syncs and then a bit later it stops. The app looks like it's syncing, syncs for 23s, and doesn't actually sync. The error from the log is attached. F3600757-5FA4-489A-80F8-DD31C6FB865F

csilker avatar Apr 08 '22 20:04 csilker

On iOS, I don't think updating Dropbox should affect Joplin. It's my understanding that Apple sandboxes third party apps: Security of runtime process in iOS and iPadOS

"All third-party apps are “sandboxed,” so they are restricted from accessing files stored by other apps or from making changes to the device."

sif avatar Apr 08 '22 20:04 sif

@sif Could this be from updating to 15.4.1? That happened slightly before the Dropbox update.

csilker avatar Apr 08 '22 20:04 csilker

The main content of iOS 15.4.1 is "AppleAVD." It was released at the end of March. This is Apple's audio and video decoder framework. Part of what makes it a powerful exploit is that it runs in kernel space.

Dropbox's latest version is 274.2 and was released on April 5th. The previous version (272.2) was released on March 22nd. Dropbox puts this in their changelog for the latest:

• You can now easily share and star your photos and files with one click in the preview screen. • We fixed an issue that was causing the Dropbox app to consume a lot of battery. The app will now use significantly less battery and run much more efficiently!

I doubt Joplin is affected by either changes. However, the timing of user reports makes me suspect Dropbox more than Apple. That is, Dropbox may have done something to their APIs and that affects how Joplin makes the calls.

sif avatar Apr 08 '22 21:04 sif

I'm getting this error as well on my iPhone, which is on iOS 15.3.1, and my iPad, which is on iOS 15.1, so I don't think the error is related to iOS 15.4.1. Also, I don't have the Dropbox app installed on either device, although I am syncing to Dropbox.

natecrow avatar Apr 09 '22 00:04 natecrow

I am also affected by this bug.

I can confirm that I can reproduce synchronization problem on two of my iOS devices (15.3.1, 15.3). First observation of the bug occurred ~ 24-36 hours ago.

A Windows 10 based Joplin installation works with Dropbox.

rtoip avatar Apr 09 '22 08:04 rtoip

Anyone managed to trace the requests the app is making (with Wireshark or similar) to see what call specifically is failing? Also can someone replicate this by building the app and running it in the iOS simulator?

laurent22 avatar Apr 09 '22 13:04 laurent22

I am getting the Network request failed error, can't do the build and sim at test at this time, but at some point prior to those errors, I see:

“remote does not exist, local is new and has never been synced”

image

Not sure if that is related to the issue or not.

I've tried deleting the iOS app and syncing it from scratch and it will do the initial sync, and I am certain it does work for a very short amount of time afterwards (ie. update and sync on desktop connected via filesystem to the Dropbox folder then manually trigger sync on iOS). But after a time, it just stops again. Says sync is complete with no changes, and the logs show the network error.

The remote DNE message popped up at some point after the reinstall but I cannot confirm if that directly coincided with when it stopped working.

solace avatar Apr 10 '22 07:04 solace

Could this error have something to do with iOS' strict requirements for SSL connections?

I remember seeing a similar error when I was using Nextcloud with a Let's Encrypt cert as a sync target. I gave up and moved to Dropbox. Now I am seeing this error as well.

cjdaniel avatar Apr 10 '22 17:04 cjdaniel

Could this error have something to do with iOS' strict requirements for SSL connections?

If I remember correctly, Apple has required SSL since 2017. Joplin has been providing that for as long as I remember and when I traced it with Wireshark yesterday, I did see evidence of SSL activities. So I doubt this is the issue.

sif avatar Apr 10 '22 17:04 sif

Could this error have something to do with iOS' strict requirements for SSL connections?

Or maybe Dropbox TLS certificate is somehow special. Anyone tried to file a report on their forum?

laurent22 avatar Apr 10 '22 17:04 laurent22

Their cert is not new, been there for a few months. Dropbox SSL cert

What else could have changed a few days ago?

seanieb avatar Apr 10 '22 17:04 seanieb

Available/required ciphers could have changed, perhaps. That is a web server/proxy configuration.

cjdaniel avatar Apr 10 '22 17:04 cjdaniel

"Reminder: The Dropbox API will no longer accept TLS 1.0 or 1.1 " However, the deadline for this isn't for two days. I'll ask and see if they made the change earlier.

https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Reminder-The-Dropbox-API-will-no-longer-accept-TLS-1-0-or-1-1/td-p/582785

seanieb avatar Apr 10 '22 17:04 seanieb

"Reminder: The Dropbox API will no longer accept TLS 1.0 or 1.1 " However, the deadline for this isn't for two days. I'll ask and see if they made the change earlier.

I am not sure if this is the hostname being connected to, but a link to an SSL test was shared earlier. This host supports TLS 1.0 and 1.1.

cjdaniel avatar Apr 10 '22 17:04 cjdaniel

I am not sure if this is the hostname being connected to, but a link to an SSL test was shared earlier. This host supports TLS 1.0 and 1.1.

Same for api.dropbox.com https://www.ssllabs.com/ssltest/analyze.html?d=api.dropboxapi.com&s=162.125.1.19&latest

Very odd. What else could change?

seanieb avatar Apr 10 '22 18:04 seanieb

Very odd. What else could change?

Maybe a root certificate they use and that has expired recently? That's what happened with Let's Encrypt.

laurent22 avatar Apr 10 '22 18:04 laurent22

Maybe a root certificate they use and that has expired recently? That's what happened with Let's Encrypt.

The Root cert is DigiCert, and it looks good. A bad root cert would impact a lot more apps that use their API, not just the joplin-ios app.

seanieb avatar Apr 10 '22 18:04 seanieb

Maybe a root certificate they use and that has expired recently? That's what happened with Let's Encrypt.

This would affect all platforms, yet the issue seems to be limited to iOS only.

roman-r-m avatar Apr 10 '22 19:04 roman-r-m

If all platforms have an up-to-date certificate but not the iOS version for some reason it could happen.

For Let's Encrypt all platforms now have the right certificate expect old versions of Android. But I agree it would weird if that's what it was, but the whole problem is weird anyway.

laurent22 avatar Apr 10 '22 20:04 laurent22