vrtmrz / obsidian-livesync

MIT License
3.96k stars 134 forks source link

"Checking configuration failed", but syncing works fine, afaict #288

Closed thany closed 9 months ago

thany commented 9 months ago

Abstract

When clicking "Check" in the settings dialog, it says "Checking configuration failed". But, syncing appears to be working fine.

It doesn't say why it failed, so I have no clue what I'm expected to do to fix this error. Maybe something is wrong that's not inhibiting syncing, but still wrong. But what then? What is the actual problem???

I've tried to enable verbose log, but nothing indicates where that log actually goes. Nothing in the command palette, there's no mention of it being in some kind of file somewhere on disk, nothing. Complete radio silence. It may as well be logging to my mum and we'd both be none the wiser.

Expected behaviour

Actually happened

Reproducing procedure

  1. Set it up correctly
  2. Make sure you made a mistake. Again, I don't know what my mistake is, as it doesn't tell me.
  3. Check database configuration

Report materials

I'm not sure what you're asking me here.

Report from the LiveSync

For more information, please refer to Making the report.

Report from hatch ``` ----remote config---- Requesting information to the remote CouchDB has been failed. If you are using IBM Cloudant, it is the normal behaviour. ---- Plug-in config --- couchDB_URI: self-hosted couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 liveSync: false syncOnSave: true syncOnStart: true savingDelay: 200 lessInformationInLog: false gcDelay: 300 versionUpFlash: "" minimumChunkSize: 20 longLineThreshold: 250 showVerboseLog: true suspendFileWatching: false trashInsteadDelete: true periodicReplication: true periodicReplicationInterval: 60 syncOnFileOpen: true encrypt: false passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 usePathObfuscation: false doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: true deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: true usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: false checkIntegrityOnSave: false batch_size: 50 batches_limit: 40 useHistory: false disableRequestURI: false skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false syncInternalFiles: false syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: "" ignoreVersionCheck: false lastReadUpdates: 19 deleteMetadataOfDeletedFiles: false syncIgnoreRegEx: "" syncOnlyRegEx: "" customChunkSize: 100 readChunksOnline: true watchInternalFileChanges: true automaticallyDeleteMetadataOfDeletedFiles: 0 disableMarkdownAutoMerge: false writeDocumentsIfConflicted: false useDynamicIterationCount: false syncAfterMerge: true 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 ```

Obsidian debug info

Debug info ``` SYSTEM INFO: Obsidian version: v1.4.13 Installer version: v1.4.5 Operating system: Windows 10 Pro 10.0.19045 Login status: not logged in Insider build toggle: off Live preview: off Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 1 Plugins enabled: 1 1: Self-hosted LiveSync v0.19.19 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. ```

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 ``` 18/09/2023, 16:55:11->Error:Request failed, status 404 18/09/2023, 16:55:11->Error:Request failed, status 404 18/09/2023, 16:55:11->Looking for the point last synchronized point. 18/09/2023, 16:55:11->Error:Request failed, status 404 18/09/2023, 16:55:11->Replication activated 18/09/2023, 16:55:11->↑0 ↓2 (1) 18/09/2023, 16:55:11->↑17 (LIVE) ↓2 (1) 18/09/2023, 16:55:11->Error:Request failed, status 404 18/09/2023, 16:55:11->Replication completed 18/09/2023, 16:55:11->All done! Please set up subsequent devices with 'Copy setup URI' and 'Open setup URI'. 18/09/2023, 16:56:25->Checking configuration failed 18/09/2023, 16:56:25->Error:Request failed, status 401 18/09/2023, 16:56:47->Checking configuration failed 18/09/2023, 16:56:47->Error:Request failed, status 401 18/09/2023, 16:57:42->OneShot Sync begin... (sync) 18/09/2023, 16:57:43->Replication activated 18/09/2023, 16:57:43->Replication completed 18/09/2023, 16:58:00->OneShot Sync begin... (sync) 18/09/2023, 16:58:00->Looking for the point last synchronized point. 18/09/2023, 16:58:00->Replication completed 18/09/2023, 16:58:29->Initializing 18/09/2023, 16:58:29->Initialize and checking database files 18/09/2023, 16:58:29->Checking deleted files 18/09/2023, 16:58:29->Updating database by new files 18/09/2023, 16:58:29->UPDATE DATABASE 18/09/2023, 16:58:29->UPDATE DATABASE: PASS:0, FAILED:0 18/09/2023, 16:58:29->UPDATE STORAGE 18/09/2023, 16:58:29->UPDATE STORAGE: PASS:0, FAILED:0 18/09/2023, 16:58:29->CHECK FILE STATUS:1/1 18/09/2023, 16:58:29->CHECK FILE STATUS:1/1: PASS:8, FAILED:0 18/09/2023, 16:58:29->Initialized, NOW TRACKING! 18/09/2023, 16:58:29->Initialize done! 18/09/2023, 16:58:42->OneShot Sync begin... (sync) 18/09/2023, 16:58:42->Replication completed 18/09/2023, 16:58:44->OneShot Sync begin... (sync) 18/09/2023, 16:58:44->Looking for the point last synchronized point. 18/09/2023, 16:58:44->Replication completed 18/09/2023, 16:59:04->Cache initialized 300 / 50000000 18/09/2023, 16:59:04->OneShot Sync begin... (sync) 18/09/2023, 16:59:05->Looking for the point last synchronized point. 18/09/2023, 16:59:05->Replication paused 18/09/2023, 16:59:05->Replication paused 18/09/2023, 16:59:05->Replication completed 18/09/2023, 16:59:39->Checking configuration failed 18/09/2023, 16:59:39->Error:Request failed, status 401 18/09/2023, 17:00:04->OneShot Sync begin... (sync) 18/09/2023, 17:00:04->Replication paused 18/09/2023, 17:00:04->Replication paused 18/09/2023, 17:00:04->Replication completed 18/09/2023, 17:01:04->OneShot Sync begin... (sync) 18/09/2023, 17:01:04->Replication paused 18/09/2023, 17:01:04->Replication paused 18/09/2023, 17:01:04->Replication completed 18/09/2023, 17:01:11->Checking configuration failed 18/09/2023, 17:01:11->Error:Request failed, status 401 18/09/2023, 17:02:04->OneShot Sync begin... (sync) 18/09/2023, 17:02:04->Replication paused 18/09/2023, 17:02:04->Replication paused 18/09/2023, 17:02:04->Replication completed 18/09/2023, 17:03:04->OneShot Sync begin... (sync) 18/09/2023, 17:03:04->Replication paused 18/09/2023, 17:03:04->Replication paused 18/09/2023, 17:03:04->Replication completed 18/09/2023, 17:04:04->OneShot Sync begin... (sync) 18/09/2023, 17:04:04->Replication paused 18/09/2023, 17:04:04->Replication paused 18/09/2023, 17:04:04->Replication completed 18/09/2023, 17:05:04->OneShot Sync begin... (sync) 18/09/2023, 17:05:04->Replication paused 18/09/2023, 17:05:04->Replication paused 18/09/2023, 17:05:04->Replication completed 18/09/2023, 17:06:04->OneShot Sync begin... (sync) 18/09/2023, 17:06:04->Replication paused 18/09/2023, 17:06:04->Replication paused 18/09/2023, 17:06:04->Replication completed 18/09/2023, 17:07:04->OneShot Sync begin... (sync) 18/09/2023, 17:07:04->Replication paused 18/09/2023, 17:07:04->Replication paused 18/09/2023, 17:07:04->Replication completed 18/09/2023, 17:08:04->OneShot Sync begin... (sync) 18/09/2023, 17:08:04->Replication paused 18/09/2023, 17:08:04->Replication paused 18/09/2023, 17:08:04->Replication completed 18/09/2023, 17:09:04->OneShot Sync begin... (sync) 18/09/2023, 17:09:04->Replication paused 18/09/2023, 17:09:04->Replication paused 18/09/2023, 17:09:04->Replication completed 18/09/2023, 17:09:31->Information has been copied to clipboard 18/09/2023, 17:10:04->OneShot Sync begin... (sync) 18/09/2023, 17:10:04->Replication paused 18/09/2023, 17:10:04->Replication paused 18/09/2023, 17:10:04->Replication completed 18/09/2023, 17:11:04->OneShot Sync begin... (sync) 18/09/2023, 17:11:04->Replication paused 18/09/2023, 17:11:04->Replication paused 18/09/2023, 17:11:04->Replication completed 18/09/2023, 17:12:04->OneShot Sync begin... (sync) 18/09/2023, 17:12:04->Replication paused 18/09/2023, 17:12:04->Replication paused 18/09/2023, 17:12:04->Replication completed ```

PS: Oh, THAT'S where the log goes. Please change this to something less obnoxious. Still doesn't say what's wrong though. Like, "Request failed", what request??

Network log

Network logs remain empty while syncing.

Screenshots

image

vrtmrz commented 9 months ago

Thank you for opening this issue! Your detailed information is very helpful!

PS: Oh, THAT'S where the log goes. Please change this to something less obnoxious.

I think that you are right, a much people could not find this. I had thought that we did not use this so frequently. It will be able to show from the command palette in the next release.

Still doesn't say what's wrong though. Like, "Request failed", what request??

Error:Request failed, status 401

This is the error. Looks like your Obsidian could not get the current configuration due to an authorisation error.

Sorry for your inconvenience. It is a bit excusable but let me explain this, please. This is the designed behaviour: LiveSync always puts the errors after the notified message as verbose messages and will not display them without our explicit operation. This is to avoid exposing unexpected things. Otherwise, we are so vulnerable when some evil person cuts the connection behind us and sneaks the message that should be kept secret. For the same reason, logs would not be stored on the storage without explicit configuration. But you are right that it is very unfriendly, so I hope to document it.

Back to the topic, may I ask you what sort of accounts are you using to connect the database? If it has no server administrator role, checking the database might fail. (To synchronise, just the database administrator role is enough).

thany commented 9 months ago

Yeah if I use a server admin, it works fine.

Perhaps you can make it so that it doesn't display a generic error message, but actually says what the problem is. The fact that you quickly know that this requires a server admin, can presumably be tested for as well, when clicking this Check button.

vrtmrz commented 9 months ago

I was relieved that the hunch was right.

After a bit of contemplation, I thought it was plausible that you have mentioned. We want to check, therefore we should not have to worry about so much, in this situation. Since v0.19.23, Self-hosted LiveSync points out a missing administrator privilege if we do not have one. And, now we can open the log pane also from the command palette.

I apologize for my strong language. Would you mind trying the latest version, please?

thany commented 9 months ago

Looks to be working πŸ‘πŸ»

vrtmrz commented 9 months ago

Thank you so much for testing!