CustomPouchError
Asked Answered
S

1

6

I'm trying to sync my local DB to remote one like this:

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

Local DB is working fine, but when try to replicate/sync to remote, always get error above

I am using

  • React Native 0.50.0
  • pouchdb-react-native: 6.3.4
  • Remote DB is CouchDB 2.1.1
Sapor answered 18/12, 2017 at 13:26 Comment(8)
Remote is CouchDB 2.1.1Sapor
Did CouchDB has been built from source? Do you have a proxy or firewall that could cause any issues?Therapeutic
@AlexisCôté yes i have Firewall. It's Azure Ubuntu VM, but i added :5984 port to Firewall. And also I added bind_address=0.0.0.0 to configuration.Sapor
Have you built Couchdb from sources?Therapeutic
Nope, with apt-get, why?Sapor
Someone had issues with checkpoint since CouchDB was compiled with a wrong erlang version.Therapeutic
How can you be sure that's the problem? What's the fastest way to fix this?Sapor
@AlexisCôté, it wasn't a problem, issu is fixedSapor
B
3

To sync your CouchDB databases follow these steps:

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

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

Boothe answered 27/12, 2017 at 4:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.