vrtmrz / obsidian-livesync

MIT License
5.16k stars 168 forks source link

Typeerror: failed to fetch on all devices #477

Closed phirestalker closed 3 months ago

phirestalker commented 3 months ago

Abstract

None of my devices are syncing. They all give the error in the title.

Expected behaviour

Actually happened

Reproducing procedure

  1. Configure LiveSync as in the attached material.
  2. Click the replication button on the ribbon.
  3. Synchronising has begun.
  4. About two or three seconds later, we got the error TypeError ....
  5. Replication has been stopped. No files synchronised.

Report materials

?

Report from the LiveSync

For more information, please refer to Making the report.

Report from hatch ``` ---- Obsidian info ---- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.6.5 Chrome/124.0.6367.243 Electron/30.1.2 Safari/537.36 ---- remote config ---- Requesting information from the remote CouchDB has failed. If you are using IBM Cloudant, this is normal behaviour. ---- Plug-in config --- version:0.23.20 remoteType: "" useCustomRequestHandler: false couchDB_URI: self-hosted(HTTPS) couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 liveSync: true 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: true passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 usePathObfuscation: true doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: false batchSaveMinimumDelay: 5 batchSaveMaximumDelay: 60 deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: true showStatusOnStatusbar: true showOnlyIconsOnEditor: false usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: false checkIntegrityOnSave: false batch_size: 25 batches_limit: 25 useHistory: true disableRequestURI: true skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false showMergeDialogOnlyOnActive: false syncInternalFiles: false syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: 82daa56d2de6f105 ignoreVersionCheck: false lastReadUpdates: 23 deleteMetadataOfDeletedFiles: false syncIgnoreRegEx: "" syncOnlyRegEx: "" customChunkSize: 50 readChunksOnline: true watchInternalFileChanges: true automaticallyDeleteMetadataOfDeletedFiles: 0 disableMarkdownAutoMerge: false writeDocumentsIfConflicted: true useDynamicIterationCount: false syncAfterMerge: false configPassphraseStore: "" encryptedPassphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 encryptedCouchDBConnection: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 permitEmptyPassphrase: false useIndexedDBAdapter: true useTimeouts: false writeLogToTheFile: false doNotPaceReplication: false hashCacheMaxCount: 300 hashCacheMaxAmount: 50 concurrencyOfReadChunksOnline: 30 minimumIntervalOfReadChunksOnline: 25 hashAlg: xxhash64 suspendParseReplicationResult: false doNotSuspendOnFetching: false useIgnoreFiles: false ignoreFiles: .gitignore syncOnEditorSave: false pluginSyncExtendedSetting: {} syncMaxSizeInMB: 50 settingSyncFile: "" writeCredentialsForSettingSync: false notifyAllSettingSyncFile: false isConfigured: true settingVersion: 0 enableCompression: false accessKey: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 bucket: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷(0 letters) endpoint: Not configured or AWS region: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷(4 letters) secretKey: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 useEden: false maxChunksInEden: 10 maxTotalLengthInEden: 1024 maxAgeInEden: 10 disableCheckingConfigMismatch: false displayLanguage: "" enableChunkSplitterV2: false disableWorkerForGeneratingChunks: false processSmallFilesInUIThread: false notifyThresholdOfRemoteStorageSize: 2000 usePluginSyncV2: false usePluginEtc: false configPassphrase: "" preset: "" syncMode: LIVESYNC dummy: 0 ```

Obsidian debug info

Debug info ``` ```

Plug-in log

Plug-in log ``` 8/5/2024, 4:54:42 AM->OneShot Sync begin... (sync) 8/5/2024, 4:54:42 AM->HTTP:GET to:/ -> failed 8/5/2024, 4:54:42 AM->TypeError:Failed to fetch 8/5/2024, 4:54:42 AM->TypeError:Failed to fetch 8/5/2024, 4:54:42 AM->Could not connect to https://couchdb.fakedomain.com/phire-obsidian: TypeError:Failed to fetch **Note** This error caused by many reasons. The only sure thing is you didn't touch the server. To check details, open inspector. 8/5/2024, 4:54:42 AM->Could not connect to server. 8/5/2024, 4:55:15 AM->Before LiveSync, start OneShot once... 8/5/2024, 4:55:15 AM->OneShot Sync begin... (pullOnly)```

Network log

Request URL:
https://couchdb/phire-obsidian/
Request Method:
OPTIONS
Status Code:
401 Unauthorized
Remote Address:
192.168.0.138:443
Referrer Policy:
strict-origin-when-cross-origin
Cache-Control:
must-revalidate
Content-Length:
78
Content-Type:
application/json
Date:
Mon, 05 Aug 2024 12:00:42 GMT
Server:
CouchDB/3.3.3 (Erlang OTP/24)
X-Couch-Request-Id:
f67353563b
X-Couchdb-Body-Time:
0
:authority:
couchdb
:method:
OPTIONS
:path:
/phire-obsidian/
:scheme:
https
Accept:
*/*
Accept-Encoding:
gzip, deflate, br
Accept-Language:
en-US
Access-Control-Request-Headers:
authorization,content-type
Access-Control-Request-Method:
GET
Origin:
app://obsidian.md
Priority:
u=1, i
Sec-Fetch-Mode:
cors
Sec-Fetch-Site:
cross-site
User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.6.5 Chrome/124.0.6367.243 Electron/30.1.2 Safari/537.36

Other information, insights and intuition.

There were updates to couchdb, obsidian, and this livesync plugin recently. I am unsure which one changed things. I also have some relevant logs from the couchdb server.

[notice] 2024-08-05T11:58:28.264249Z nonode@nohost <0.20817.13> f1acf3f9f8 couchd 192.168.0.176 undefined OPTIONS /phire-obsidian/ 401 ok 2
[error] 2024-08-05T12:00:43.530624Z nonode@nohost <0.22415.13> f67353563b rexi_server: from: nonode@nohost(<0.22401.13>) mfa: fabric_rpc:open_shard/2 throw:{unauthorized,<<"You are not authorized to access this db.">>} [{couch_db,open,2,[{file,"src/couch_db.erl"},{line,177}]},{mem3_util,get_or_create_db,2,[{file,"src/mem3_util.erl"},{line,602}]},{fabric_rpc,open_shard,2,[{file,"src/fabric_rpc.erl"},{line,332}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,146}]}]

These repeat over and over

phirestalker commented 3 months ago

I added other details, but I don't see them on the above post. Are they hidden. I also see them when I edit the post.

Oh, forgot to mention. I have not changed the password or the setting on either obsidian-livesync or the couchdb server. Also, I am able to log-in to the couchdb server's interface. I can see the database and my entry in the _users database that I created a while ago.

phirestalker commented 3 months ago

ok, it seems like the update to the couchdb docker image cleared all the settings. Is there a way to just add the correct settings with a script and not recreate (or delte) the existing database

EDIT: nvm, I figured it out, just used check and fix in the plugin settings. Great plugin! It is now conflicting a LOT of files. I hope it can sort it all out. I did not edit many files while the sync was down. i mostly added new files, so I am not sure why all the conflicts. If i run into trouble with the conflicts, should I open a new issue for help?