vrtmrz / obsidian-livesync

MIT License
3.92k stars 132 forks source link

Compilation of the map function in the 'collectDangling' view failed #423

Closed z0diaq closed 4 weeks ago

z0diaq commented 1 month ago

Abstract

AM->compilation_error visible in sync log though synchronization passes

Expected behavior

Actually happened

Reproducing procedure

  1. might be specific to my configuration -> self-hosted on RPI machine, using CouchDB snap

Note: If you do not catch the reproducing procedure, please let me know the frequency and signs. happens each time after Obsidian starts

Report from the LiveSync

Report from hatch ``` ---- Obsidian info ---- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.4.16 Chrome/114.0.5735.289 Electron/25.8.1 Safari/537.36 ---- remote config ---- uuids: algorithm: sequential max_count: "1000" cluster: n: "1" q: "8" cors: credentials: "true" headers: accept, authorization, content-type, origin, referer methods: GET, PUT, POST, HEAD, DELETE origins: "*" chttpd: backlog: "512" bind_address: 0.0.0.0 docroot: ./share/www max_db_number_for_dbs_info_req: "100" max_http_request_size: "4294967296" port: "5984" prefer_minimal: Cache-Control, Content-Length, Content-Range, Content-Type, ETag, Server, Transfer-Encoding, Vary require_valid_user: "true" server_options: "[{recbuf, undefined}]" socket_options: "[{sndbuf, 262144}, {nodelay, true}]" attachments: compressible_types: text/*, application/javascript, application/json, application/xml compression_level: "8" admins: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 query_server_config: os_process_limit: "100" reduce_limit: "true" vendor: name: The Apache Software Foundation chttpd_auth: require_valid_user: "true" replicator: connection_timeout: "30000" http_connections: "20" interval: "60000" max_churn: "20" max_jobs: "500" retries_per_request: "5" socket_options: "[{keepalive, true}, {nodelay, false}]" ssl_certificate_max_depth: "3" startup_jitter: "5000" verify_ssl_certificates: "false" worker_batch_size: "500" worker_processes: "4" ssl: cert_file: /etc/cert.pem enable: "true" key_file: /etc/privkey.pem port: "6984" log: level: info writer: stderr indexers: couch_mrview: "true" view_compaction: keyvalue_buffer_size: "2097152" features: pluggable-storage-engines: "true" scheduler: "true" couch_peruser: database_prefix: userdb- delete_dbs: "false" enable: "false" httpd: WWW-Authenticate: Basic realm="couchdb" allow_jsonp: "false" authentication_handlers: "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}" bind_address: 127.0.0.1 enable_cors: "true" enable_xframe_options: "false" max_http_request_size: "4294967296" port: "5986" secure_rewrites: "true" socket_options: "[{sndbuf, 262144}]" database_compaction: checkpoint_after: "5242880" doc_buffer_size: "524288" csp: enable: "true" couch_httpd_auth: allow_persistent_cookies: "true" auth_cache_size: "50" authentication_db: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 authentication_redirect: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 iterations: "10" require_valid_user: "false" secret: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 timeout: "600" couchdb_engines: couch: couch_bt_engine couchdb: attachment_stream_buffer_size: "4096" changes_doc_ids_optimization_threshold: "100" database_dir: /var/snap/couchdb-ryanjyoder/common/data default_engine: couch default_security: admin_local delayed_commits: "false" file_compression: snappy max_dbs_open: "500" max_document_size: "50000000" os_process_timeout: "5000" uuid: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 view_index_dir: /var/snap/couchdb-ryanjyoder/common/data compactions: _default: '[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}]' compaction_daemon: check_interval: "3600" min_file_size: "131072" ---- Plug-in config --- version:0.23.6 remoteType: "" useCustomRequestHandler: false couchDB_URI: self-hosted(HTTPS) couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 liveSync: false syncOnSave: false syncOnStart: true savingDelay: 200 lessInformationInLog: false gcDelay: 0 versionUpFlash: "" minimumChunkSize: 20 longLineThreshold: 250 showVerboseLog: true suspendFileWatching: false trashInsteadDelete: true periodicReplication: true periodicReplicationInterval: 300 syncOnFileOpen: true encrypt: false passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 usePathObfuscation: false doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: true deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: true showStatusOnStatusbar: true showOnlyIconsOnEditor: true usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: false checkIntegrityOnSave: false batch_size: 50 batches_limit: 40 useHistory: true disableRequestURI: true skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false showMergeDialogOnlyOnActive: false syncInternalFiles: true syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/,\/workspace$ ,\/workspace.json$ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: 8c763f3baea4d9e5 ignoreVersionCheck: false lastReadUpdates: 23 deleteMetadataOfDeletedFiles: false syncIgnoreRegEx: "" syncOnlyRegEx: "" customChunkSize: 0 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 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 ```

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 ``` 5/9/2024, 8:35:35 AM->Replication activated 5/9/2024, 8:35:36 AM->Replication error 5/9/2024, 8:35:36 AM->compilation_error:Compilation of the map function in the 'collectDangling' view failed: Expression does not eval to a function. (function(_) { if (_._id.startsWith("h:")) emit([ _._id ], 0); else if ("children" in _) _.children.forEach((_ => emit([ _ ], 1))); }) 5/9/2024, 8:35:36 AM->Replication stopped. ```

Network log

connection ok

Screenshots

not applicable

Other information, insights and intuition.

I think it started to appear recently - any code changes in this area ?

z0diaq commented 4 weeks ago

nvm, due to frequent merge conflicts and invalid chunks (was using CouchDB) downloaded decided to change to other Obsidian plugin for now - overall livesync is great and will check it again in future