Obsidian Sync: Stuck at Uploading xxx with no log update, new changes not pushed

Obsidian Sync went into a somewhat stuck state, constantly showing the “busy” icon without updating anything. Seems like it’s trying to upload an old file which has already been synced a long time ago, and wouldn’t go on to sync updates for other recently changed files unless it finishes the current one.

When hovering over the Sync icon, the tooltip shows that it’s trying to upload a jpg file but that file hasn’t changed recently. Meanwhile, the Sync stops for all other files, including the one I’m working on (the daily note 2022-03-05). There’s no Sync log for anything either, not even for the jpg file shown in the hover tooltip.

  • I’ve waited for nearly half an hour for Sync to un-stuck itself, which should be plenty of time to upload a 10KB JPEG file.
  • I’ve tried to Pause / Resume the sync, but other than adding two lines to the log (paused, resumed), it’s still stuck.
  • I’ve also tried restart / force quit Obsidian multiple times with no luck.
  • I’ve made several updates to other files, but the changes are not being synced to other devices.

Steps to reproduce

There’s probably some weird condition leading to this state for Sync, but I don’t know how to reproduce on other machines. And this indeed only happens on one of the machines, all the update from this one doesn’t sync to others, but the rest of my devices syncs fine with each other.

Expected result

It should resolve itself from this stuck state, and continue syncing other files, or at least log what it’s trying to do.

The ability to reset the Sync state in the rare circumstance where it gets stuck would be nice. I believe Drafts 5 offers “Reset Sync State” and log persistence, which would help a lot in situations like this.

Actual result

Screenshot above.

Sync log keeps circling between “Connecting to server” and “Detecting changes”, there’s definitely new changes, but it’s not picking them up.

2022-03-05 01:18 - Connecting to server
2022-03-05 01:18 - Connection successful. Detecting changes...
2022-03-05 01:29 - Connecting to server
2022-03-05 01:29 - Connection successful. Detecting changes...
2022-03-05 01:32 - Connecting to server
2022-03-05 01:32 - Connection successful. Detecting changes...
2022-03-05 01:35 - Connecting to server
2022-03-05 01:35 - Connection successful. Detecting changes...
2022-03-05 01:38 - Connecting to server
2022-03-05 01:38 - Connection successful. Detecting changes...

Environment

  • Operating system: macOS latest, with Obsidian 0.13.28
  • Debug info: below
SYSTEM INFO:
	Obsidian version: v0.13.28
	Installer version: v0.13.24
	Operating system: Darwin Kernel Version 21.4.0: Tue Jan 18 13:02:08 PST 2022; root:xnu-8020.100.406.0.1~18/RELEASE_ARM64_T8101 21.4.0
	Login status: logged in
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: Minimal
	Snippets enabled: 1
	Safe mode: off
	Plugins installed: 26
	Plugins enabled: 17
		1: Advanced Tables
		2: Calendar
		3: Quick Switcher++
		4: Natural Language Dates
		5: Custom window title
		6: QuickAdd
		7: Admonition
		8: Excalidraw
		9: Minimal Theme Settings
		10: Advanced URI
		11: Dataview
		12: Diagrams
		13: Style Settings
		14: Open vault in VSCode
		15: Local images
		16: Global Hotkeys
		17: Templater

RECOMMENDATIONS:
	Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the help vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the help vault or disable community plugins.


Additional information

what happens if you enter in safe mode and restart?

do you get errors in console cmd-opt-i?

Hi @WhiteNoise, turning on safe mode and restarting Obsidian doesn’t seem to make a difference to Sync. And the developer console has 0 error message even in verbose level.

Here’s the console output for non-safe mode

And for safe mode:

Does this file exist?if so move it out of your vault.

cd ~/LifeOS/writing/notes/ucsd/cse258/regression-printout
mv regression-106-marked.jpg /tmp

Moving the file out seems to do the trick. Sync started to work again and uploaded the recent file updates. All devices are synced into the latest version.

mv /tmp/regression-106-marked.jpg .

I then moved the file back in to the original folder, Obsidian Sync also pushed the file to server just fine. I still don’t know what exactly caused the Sync to stuck in the first place and how to prevent that in the future. Should I leave this report open so that the Dev can take a look and track the issue?

I don’t know perhaps this file was locked by another process or there was a file permission problem.

That would be highly unlikely. I haven’t touched anything in that folder for a long time (last modified October 2021), and since I’m able to preview and move that picture, file permission shouldn’t be a problem for Obsidian (which only requires Read permission to sync).