vrtmrz / obsidian-livesync

MIT License
3.96k stars 134 forks source link

Won't sync after v2 migration #331

Closed Daedren closed 7 months ago

Daedren commented 7 months ago

Abstract

After migrating to the new Selfhosted Livesync v2 model, all devices are now unable to sync. The remote database isn't locked, any changes in any devices won't reflect in any other.

I've tried overwriting the remote DB on one device and reinstalling Obsidian on all others to just fetch from scratch, but to no avail. They'll get the updated files once, but anything after the first fetch will no longer sync.

This was all working across all devices prior to the v2 migration. All 4 devices involved (Windows, Mac, iOS, Android) have up to date Obsidian installations and Selfhosted Livesync plugins.

Expected behaviour

Actually happened

Reproducing procedure

  1. One device chose "update to v2" when updating Selfhosting Livesync.
  2. After that one was updated, I did the same on my other 3 devices.

Report from the LiveSync

For more information, please refer to Making the report.

Report from hatch ``` ----remote config---- cors: credentials: "true" origins: app://obsidian.md,capacitor://localhost,http://localhost chttpd: bind_address: any max_http_request_size: "4294967296" port: "5984" require_valid_user: "true" admins: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 vendor: name: The Apache Software Foundation feature_flags: partitioned||*: "true" chttpd_auth: hash_algorithms: sha256, sha require_valid_user: "true" indexers: couch_mrview: "true" prometheus: additional_port: "false" bind_address: 127.0.0.1 port: "17986" httpd: WWW-Authenticate: Basic realm="couchdb" bind_address: 127.0.0.1 enable_cors: "true" port: "5986" smoosh: state_dir: ./data couch_httpd_auth: authentication_db: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 secret: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 authentication_redirect: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchdb_engines: couch: couch_bt_engine couchdb: database_dir: ./data max_document_size: "50000000" uuid: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 view_index_dir: ./data ---- Plug-in config --- version:0.20.7 couchDB_URI: self-hosted couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 liveSync: false syncOnSave: false syncOnStart: false savingDelay: 200 lessInformationInLog: false gcDelay: 0 versionUpFlash: "" minimumChunkSize: 20 longLineThreshold: 250 showVerboseLog: false suspendFileWatching: false trashInsteadDelete: true periodicReplication: false periodicReplicationInterval: 60 syncOnFileOpen: false encrypt: false passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 usePathObfuscation: false doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: false deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: true usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: true checkIntegrityOnSave: false batch_size: 50 batches_limit: 40 useHistory: true disableRequestURI: true skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false syncInternalFiles: true syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: "" ignoreVersionCheck: false lastReadUpdates: 20 deleteMetadataOfDeletedFiles: false syncIgnoreRegEx: "" syncOnlyRegEx: "" customChunkSize: 100 readChunksOnline: true watchInternalFileChanges: true automaticallyDeleteMetadataOfDeletedFiles: 0 disableMarkdownAutoMerge: false writeDocumentsIfConflicted: false useDynamicIterationCount: false syncAfterMerge: false configPassphraseStore: "" encryptedPassphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 encryptedCouchDBConnection: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 permitEmptyPassphrase: false useIndexedDBAdapter: true useTimeouts: false writeLogToTheFile: false doNotPaceReplication: false hashCacheMaxCount: 300 hashCacheMaxAmount: 50 concurrencyOfReadChunksOnline: 100 minimumIntervalOfReadChunksOnline: 333 hashAlg: xxhash64 suspendParseReplicationResult: false doNotSuspendOnFetching: false useIgnoreFiles: false ignoreFiles: .gitignore syncOnEditorSave: false pluginSyncExtendedSetting: {} useV1: false ```

Obsidian debug info

Debug info Windows ``` SYSTEM INFO: Obsidian version: v1.4.16 Installer version: v1.4.16 Operating system: Windows 10 Education 10.0.22000 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 6 Plugins enabled: 5 1: Self-hosted LiveSync v0.20.7 2: Excalidraw v2.0.2 3: Periodic Notes v0.0.17 4: Mermaid Tools v1.0.0 5: Templater v1.18.1 RECOMMENDATIONS: 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 Sandbox Vault or disable community plugins. ``` Mac ``` SYSTEM INFO: Obsidian version: v1.4.16 Installer version: v1.4.16 Operating system: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 22.5.0 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 1 Restricted mode: off Plugins installed: 6 Plugins enabled: 5 1: Self-hosted LiveSync v0.20.7 2: Periodic Notes v0.0.17 3: Excalidraw v2.0.2 4: Templater v1.18.1 5: Sortable v0.3.1 RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox 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 Sandbox Vault or disable community plugins. ```

Plug-in log

We can see the log by tapping the Document box icon. If you noticed something suspicious, please let me know. Note: Please enable Verbose Log. For detail, refer to Logging, please.

Plug-in log Device 1 - edits file ``` 11/20/2023, 1:53:17 PM->Content saved:sdaisd.md ,chunks: 1 (new:1, skip:0, cache:0) 11/20/2023, 1:53:17 PM->DB <- STORAGE (plain) sdaisd.md 11/20/2023, 1:53:22 PM->Scanning hidden files. 11/20/2023, 1:53:22 PM->Hidden files scanned: 2 files had been modified ``` Device 2 - Just after opening obsidian, waiting to see the updated file ``` 11/20/2023, 1:53:17 PM->Content saved:sdaisd.md ,chunks: 1 (new:1, skip:0, cache:0) 11/20/2023, 1:53:17 PM->DB <- STORAGE (plain) sdaisd.md 11/20/2023, 1:53:22 PM->Scanning hidden files. 11/20/2023, 1:53:22 PM->Hidden files scanned: 2 files had been modified ```

Other information, insights and intuition.

Devices include iOS, Android, Mac and Windows. I chose to disable customization and hidden file sync on that pop-up that showed up after that force overwrite I mentioned above, just to see if they were the issue. I answered the same to the popups on all devices. The customization option was initially on back when I was on v1. I have yet to try to rollback to the old format, I'll probably try to do that next to at least get a working plugin.

dlphnkck commented 7 months ago

Hi. I just had a quick look at the log, and I'm afraid it's not an essential point, but a very detailed point that I'm trying to make.

Plug-in log Plug-in log shows that sdaisd.md is DB <- STORAGE at 1:53:17 for both Device 1 and Device 2. If I edit anything on Device 1, should I see DB -> STORAGE in the log to ensure that the edit is saved on Device 2 according to the correct procedure?

Make report

That is all. I apologize that this is not at all essential advice, but it is for your information. I wish you good luck

Daedren commented 7 months ago

Turning LiveSync on did fix it. I hadn't touched that pane at all in any device, which is why I didn't want to touch it. But it is indeed fixed.