iOS sync broke due to network request failing with Dropbox

Operating system

iOS

Joplin version

12.14.6

Sync target

Dropbox

What issue do you have?

Today the synchronization on iOS stopped working. Looking at the logs it looks like the network request fails.
I deleted the App and resynced the target. The synching works as it should be until the Desktop app make its first update. Once that happens the network errors start showing up.

05-02T21:16:07: Synchronizer: "TypeError: Network request failed
TypeError: Network request failed
    at anonymous (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:11103:33)
    at apply (native)
    at anonymous (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:8734:26)
    at _callTimer (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:8682:17)
    at callTimers (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:8829:19)
    at apply (native)
    at __callFunction (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:1827:36)
    at anonymous (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:1666:31)
    at __guard (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:1778:15)
    at callFunctionReturnFlushedQueue (/Users/laurent/Library/Developer/Xcode/DerivedData/Joplin-ewsyxzklwwggmtdeyavpfmrkhqhv/Build/Intermediates.noindex/ArchiveIntermediates/Joplin/BuildProductsPath/Release-iphoneos/main.jsbundle:1665:21)"
05-02T21:16:07: Synchronizer: "Sync: finished: Synchronisation finished [1714677343589]"
4 Likes

I don't have much to add, but I just got hit with this error too. I was having problems syncing from my phone to the desktop app. Joplin was not reporting any errors in the UI and was saying that syncing was complete, but the notes were not updating. I noticed that dropbox had accidentally been uninstalled from my phone, so I reinstalled it. However, it still fails to sync and when I look at the logs I see the same error message.

Same here - been happily using Joplin for several years, but yesterday iPhone sync failed and I can't get it to work any more. Logs show the same "network connection failed" error. Same version of Joplin iOS - I'm guessing an update went through yesterday?

I tried deleting the app and reinstalling, which did not fix it, so now none of my notes are on my phone at all :cry:

I have the same problem.
I'm using joplin in exactly the same environment as worker7.
I got the same log as the one posted by worker7.

Experiencing the same problem

I have the same issue. iPhone and desktop version are syncing, but iPad is not syncing. Started seeing these errors 4/29 08:17:58
iPad is running Joplin 12.14.6
iPod OS version 17.4.1

I tried using MITM proxy to intercept the network calls but didn't see any traffic.
I then put my phone in airplane mode and tried again to sync resulting in the same error. Looks like the request never is made (or at least I would have expected a different error if the network is down)

I'm able to reproduce this on an iOS simulator. For me, the failing fetch is requesting /info.json from Dropbox. If I use the requestToCurl_ debug method to convert the request to a CURL command[1]. If I then run this from a terminal, the request is successful.

The failing request seems to be using React Native's fetch (on this line) (rather than fetchBlob or uploadBlob).

Edit: I've created a GitHub issue for this.
Edit 2: I've reported the issue on the Dropbox forum. (Edit 4: It was marked as spam. Edit 5: It has been unmarked as spam.).
Edit 3: Pull request


  1. The CURL request is similar to (may have typos): curl -X GET -H 'Dropbox-API-Arg: {"path": "/info.json"}' -H 'Authorization: Bearer TOKEN_HERE' -H 'Content-Type: application/octet-stream' https://content.dropboxapi.com/2/files/download ↩︎

2 Likes

Thanks for looking into this so quickly - you don't realise how dependent you've become upon an app until something goes wrong. At least I still have my data on my laptop!

FYI - it's not opening for me:

The message you are trying to access is not available.

It looks like it was marked as spam. I suspect this is because my account is new and I included links to this forum post and Joplin's GitHub.

I've clicked the "abuse report" link and filled out the form. I've also tried re-posting without links.

Content of the support request with links removed.

Hi,

The Joplin note taking app uses Dropbox's HTTP API to upload and download files. Since a few days ago, some of our its requests are failing with "The network connection was lost".

The failing request downloads files from Dropbox using a GET request to content.dropboxapi.com/2/files/download:

fetch(
	"https://content.dropboxapi.com/2/files/download", 
	{
		"headers": {
			"Dropbox-API-Arg": "{\"path\":\"/info.json\"}",
			"Authorization": "Bearer " + API_TOKEN, 
		 	"Content-Type": "application/octet-stream" 
		},
		"method":"GET"
	}
)

Sometimes, the above fetch does work. However, I can reproduce the failure consistently by sending the above request twice, but only in some environments:

  • Running code from the Safari development tools, inspecting a WebView embedded in Joplin.
  • Running code from the Chrome development tools, connected to React Native Hermes.

I can't reproduce this when using the same code in a NodeJS REPL or the Firefox JavaScript console.

The examples in the Dropbox documentation send POST rather than GET requests to files/download. Switching to a POST request does seem to fix the issue on Android. However, it still fails on iOS.

Another post on this forum suggests that fetch on iOS doesn't support sending POST requests with an empty body. Dropbox doesn't seem to allow a non-empty body for this request.

Is this forum the correct place to be asking for help with this issue? Is there a way to continue using a GET request to /files/download to download files?

Notes:

  • The original version of this post was marked as spam, perhaps due to links to Joplin's source code and issue tracker. These links have been removed and can be provided on request.
  • Joplin uses React Native 0.71. The issue still happens after upgrading to React Native 0.73.8.

However, I've also received an email with the subject "Dropbox support chat" that states

Your question has been received by our support team. We’ll get in touch soon with a solution or if we need more details.

Thank you for putting my thoughts into words!
I have the same issue. Didnt notice it at first, but after trying everything including a reinstall of the app, the problem persists. Now im getting nervous since my whole workflow is based on multiple devices working together

I got a few correct syncs again. I am uncertain whether that is a fluke or if Dropbox fixed whatever they broke :crossed_fingers:
Just wanted to report some updates on the current status.

1 Like

I'm still able to reproduce the issue locally. (Thank you for checking!)

Status update:

  • I've created a workaround for this issue that we plan to publish soon.
  • The Dropbox forum post is no longer marked as spam. At least one other React Native app is also experiencing this issue.

Sync started working on iOS again for me in the past hour

1 Like

Hello all, thanks for all the work, I've been using Joplin for past couple of months without any issues until this started happening. Sending my first message here to suggest an improvement.

I haven't looked at upcoming code changes to handle this API request better, but the app for me says sync "Completed" after about 24s in this case when it's actually not working. Can it also be updated to actually fail the sync in this case? I was kind of confused until I checked synchronization logs and saw the errors.

Still not working for me, alas :cry:

Working for me now on Windows and Android, but not on iPad - pretends to sync and shows completed with a duration of 18296s, but not actually synchronized.

Same issue here. Dropbox sync broken.

iOS 17.4.1 - Joplin 12.14.6

A workaround has been merged. On iOS, it should be available on the App Store as version 12.14.7.

2 Likes