vrtmrz / obsidian-livesync

MIT License
4.5k stars 146 forks source link

Couldn't parse or decrypt configuration uri #163

Open Moaness opened 1 year ago

Moaness commented 1 year ago

Hi,

Thanks for your efforts with this plugin. I'm very impressed by it's features but I still find it very buggy and caused me some trouble by wrongly deleting important notes. I had a recent issue with renaming folders which caused data loss and duplications but saw your last update so I decided to give it another try.

When I try copying the config link from laptop to tablet, the error messages as in the title show up after selecting to setup my tablet as a second device. Sync log says:

Old database is not exist Database closed for reset Database Couldn't parse or decrypt configuration uri

The password is definitely correct as if I try to write a wrong one it doesn't allow me to proceed to config selection. Please help.

To add: I tried restarting the couchDB on flyio, tried fetching the db on tablet even with log error, but nothing works.

Moaness commented 1 year ago

I tried manually putting server details, it connects to the server but refuses to sync or fetch. Pressing on fetch doesn’t show any notifications but log says β€œDatabase closed for reset Database” with no further details.

Moaness commented 1 year ago

Here is the Hatch report

`----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 --- 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: true suspendFileWatching: false trashInsteadDelete: true periodicReplication: false periodicReplicationInterval: 60 syncOnFileOpen: false encrypt: false passphrase: "𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷" doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: true deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: false usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: false checkIntegrityOnSave: false batch_size: 250 batches_limit: 40 useHistory: true disableRequestURI: true skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false syncInternalFiles: false syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/.git\/, \/obsidian-livesync\/ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: "" ignoreVersionCheck: false lastReadUpdates: 17 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 `

vrtmrz commented 1 year ago

Thank you for using this plugin!

If you have noticed that some of your notes have been lost, please try Pick a file to show history. It is also able to show and recover deleted notes. Possibly, almost changes that this plug-in made is retrievable if the database would not rebuilt.

However, I can think of a few things about this issue. Did you remember which version of LiveSync made the URI? Perhaps we lost the compatibility with the URI at v0.17.15. I will investigate it later. Maybe the previous version can restore the settings and upgrade.

I tried manually putting server details, it connects to the server but refuses to sync or fetch. Pressing on fetch doesn’t show any notifications but log says β€œDatabase closed for reset Database” with no further details.

Has verbose log been enabled? (it is in the General Setting pane). And, we may have a more detailed log in DevTools. May I ask what is being displayed? DevTools can be opened by pressing Ctrl+shift+i if you are not on Android or iOS.

Moaness commented 1 year ago

Thanks for the prompt reply.

I was using the exact same plugin versions with no hope. I noticed an email earlier this morning from Fly.io that my server crashed because of RAM shortage. I tried reinstalling Livesync and the same old link surprisingly just worked! Not sure if it's because of server issue? or because I disabled/uninstalled livesync from all other devices (Laptop, phone) then tried installing it again on my iPad? Not sure. But definitely wasn't related to the plugin version as I kept checking more than once.

Now the setup of files on my iPad is the one I want to be the base. I clicked Send to make it the base on remote DB. Replication completed successfully, Now on my laptop when I click Fetch nothing happens. Below is the verbose messages

Neurology:1/22/2023, 2:27:25 PM->Database closed for reset Database. plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Database info plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->{ "doc_count": 0, "update_seq": 0, "idb_attachment_format": "binary", "db_name": "Neurology-livesync-v2", "auto_compaction": false, "adapter": "idb" } plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Open Database... plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Checking old database plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->{ "doc_count": 0, "update_seq": 0, "idb_attachment_format": "binary", "db_name": "Neurology-livesync", "auto_compaction": false, "adapter": "idb" } plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Old database is empty, proceed to next step plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Database Info plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->{ "doc_count": 0, "update_seq": 0, "idb_attachment_format": "binary", "db_name": "Neurology-livesync-v2", "auto_compaction": false, "adapter": "idb" } plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Database is now ready. plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Local Database Reset plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->{ "doc_count": 0, "update_seq": 0, "idb_attachment_format": "binary", "db_name": "Neurology-livesync", "auto_compaction": false, "adapter": "idb" } plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:25 PM->Deleted! plugin:obsidian-livesync:19760 Neurology:1/22/2023, 2:27:26 PM->Mark this device as 'resolved'.

Moaness commented 1 year ago

Ok I tried to discard my DB on the laptop and fetched it again from the remote. Sadly it restored old deleted folders/files and re-deleted some of my new ones. When I login to couch DB and try to verify installesion it gives an error on replication step. Error says Error: {session_request_failed,"http://any:5984/_session","USERNAME", {conn_failed,{error,nxdomain}}} could it be related?

vrtmrz commented 1 year ago

Thank you for your confirmation! I feel sorry that my idea could not help you.

I tried some cases, but I realised that Set it up as secondary or subsequent device could not run in automatically in some cases. I will investigate it later.

I tried reinstalling Livesync and the same old link surprisingly just worked! Not sure if it's because of server issue? or because I disabled/uninstalled livesync from all other devices (Laptop, phone) then tried installing it again on my iPad? Not sure. But definitely wasn't related to the plugin version as I kept checking more than once.

Wow! when importing the configuration, the plug-in tries synchronising once. at this point, the plug-in possibly raises an error if the remote things could not be decrypted by the passphrase. If the error had been detected, this plug-in shows that every error into one importing error. Circumstances are getting clear! Thank you for your patience!

Now the setup of files on my iPad is the one I want to be the base. I clicked Send to make it the base on remote DB. Replication completed successfully, Now on my laptop when I click Fetch nothing happens. Below is the verbose messages

Yes, it probably so. iPad's local database is empty. it is indicated in the log. (owning on suspending the setup procedure? but not sure...). However, in this case, if you want to rebuild from iPad's vault. You have to perform Rebuild everything.

bfahrenfort commented 1 year ago

I'm experiencing a similar issue. I have LiveSync set up to use a CouchDB server, and it is pushing my notes to the server from my Linux Obsidian client. I'm unable to set up my iPhone as a subsequent device.

Both are running LiveSync 0.19.0 with the database created by the same version.

CouchDB running through Docker is behind an SSL certificate at https://obsidian.my-domain.com. End-To-End encryption is enabled, with a passphrase set.

When I try and set up an iOS client with the configuration URI (Used KDE Connect to copy the link from pc to iOS, so definitely no errors in the link), I tap 'yes' and then tap 'set it up as a secondary or subsequent device.' It displays a few notifications and ends in "couldn't parse or decrypt configuration uri". If I enter the wrong password, it goes straight to "couldn't parse or decrypt configuration uri" without letting me tap the setup options.

My vault on iOS is named the same as the Linux vault, and the iOS vault is currently completely empty. I've also tried with a different named vault to no success.

Is there a way to see verbose logs on the iOS app? Thanks!

EDIT: My issue was caused by me, I have now created a database called 'notes' in the CouchDB Utils panel and pointed the plugin to that database. Everything is working perfectly now when the plugin sends requests to https://obsidian.my-domain.com/notes.