CustomPouchError

I am trying to synchronize a local DB with a remote:

const DB_NAME = "my_db"; const REMOTE_DB_URL ="http://<admin>:<password>/<ip-address>:5984/my_db"; const localDB = new PouchDB(DB_NAME); const remoteDB = new PouchDB(REMOTE_DB_URL); localDB.sync(remoteDB) .then(() => { console.log("Sync done"); }) .catch(err => { console.log(err); }); 

This is the error I get:

 message:"getCheckpoint rejected with " name:"unknown" result:{ok: false, start_time: Mon Dec 18 2017 14:14:03 GMT+0100 (CET), docs_read: 0, docs_written: 0, doc_write_failures: 0, ...} status: 0 

The local database is working fine, but when trying to replicate / synchronize on a remote computer always get the error above

I use

  • React Native 0.50.0
  • pouchdb-react-native: 6.3.4
  • Remote DB - CouchDB 2.1.1
+5
source share
1 answer

To synchronize your CouchDB databases, follow these steps:

Step 1: Serve the remote database through https, not http using CouchDB support for native SSL, as indicated here: http://docs.couchdb.org/en/1.3.0/ssl.html

Step 2: Make sure CORS is enabled, as indicated here: http://docs.couchdb.org/en/1.3.0/cors.html

+2
source

Source: https://habr.com/ru/post/1274152/


All Articles