Looks like this has been an issue for folks in the past and it's fixed with an update the optimizes things, but I'm having an issue where syncing files fails with "504 Gateway Timeout" in two situations:
Situation 1:
On the first sync of a new device, in this case on MacOS, only some of the files sync and there is a ton of spam of this gateway timeout.
Situation 2:
With large files, over 30MB or so, it never uploads them to the server and instead fails with this message.
I cant find any settings in the client or on the Joplin Server that allows me to increase this timeout. Any workarounds?
There's no timeout on Joplin Server side. You probably need to tweak your reverse proxy configuration, and also makes sure it allows uploading large files
I overode my reverse proxy to have a 1hr connection, download, and upload timeout. Still, I see this message in the logs when I try and upload an 89MB file:
2025-04-16 09:07:10: Synchronizer: Sync: updateRemote: local has changes: Note: (Local 194bda463ea24d97a43d975b60b460d7): (Remote 194bda463ea24d97a43d975b60b460d7.md)
2025-04-16 09:07:10: Synchronizer: Sync: createRemote: remote does not exist, and local is new and has never been synced: Resource: (Local c1ee5adb2d37430bb165a3b1ea9e220b)
2025-04-16 09:07:18: SearchEngine: Updating FTS table...
2025-04-16 09:07:18: Updating items_normalized from {"updated_time":0,"id":""}
2025-04-16 09:07:18: SearchEngine: Updated FTS table in 40ms. Inserted: 1. Deleted: 0
2025-04-16 09:07:38: Synchronizer: [warn] Uploading a large resource (resourceId: c1ee5adb2d37430bb165a3b1ea9e220b, size:99943928 bytes) which may tie up the sync process.
2025-04-16 09:09:38: JoplinServerApi: [warn] curl -v -X PUT -H "Content-Type: application/octet-stream" -H "X-API-AUTH: ******" -H "X-API-MIN-VERSION: 2.6.0" -H "Content-Length: 180818639" 'https://joplin.mydomain.com/api/items/root:/.resource/c1ee5adb2d37430bb165a3b1ea9e220b:/content?share_id=rZJjkAQUMD9Pc7'
2025-04-16 09:09:38: JoplinServerApi: [warn] Code: <undefined>
2025-04-16 09:09:38: JoplinServerApi: [warn] FetchError: network timeout at: https://jopln.mydomain.comt/api/items/root:/.resource/c1ee5adb2d37430bb165a3b1ea9e220b:/content?share_id=ZJjkAQUMD9Pc7
FetchError: network timeout at: https://joplin.mydomain.com/api/items/root:/.resource/c1ee5adb2d37430bb165a3b1ea9e220b:/content?share_id=ZJjkAQUMD9Pc7
at C:\Users\ldell\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\node_modules\node-fetch\lib\index.js:1484:13
2025-04-16 09:10:21: RepositoryApi: findWorkingMirror: Using: https://raw.githubusercontent.com/joplin/plugins/master
2025-04-16 09:10:26: useFormNote: Sync has finished and note has never been changed - reloading it
Then it hangs and just has the scrolling syncing wheel until I restart Joplin. Even cancelling doesn't work...
I wouldn't consider 89MB large by any means. Large for a note, sure, but it'd be nice to store data files, programs, etc within the notes from time to time. That's a pretty small program. Additionally, some clients just time out on all connections and can only sync really tiny notes. Something weird is going on here.
I use this reverse proxy and server for dozens of applications with uploads and downloads, none have had a timeout error before.
I can manually issue a connection via telnet and am not kicked until an hour after issuing no data.
No other services have this timeout issue. All I can tell you is this is definitely either joplin server or the joplin client. I have no timeout set on purpose on my proxy, and even when I do set one it ignores it and always disconnects at 120 seconds out of the box.
Even if it is the proxy, and for some reason doesn't listen to the timeout settings, Joplin is the only app that handles it in a way where the proxy thinks the connection is hanging out.
I can also add that my connection speed to my server is approximately 48Mb/s (speed I can upload to the server)