0
votes

I made a localDB in chrome with pouchdb(v 6.2.0). It was created in IndexedDB.

var localdb = new PouchDB('localDB');

And I made a new couchdb(v3.1.0) in Ubuntu 18.04. And I make a public database with no user in permissions. And the couchdb changed settings to enable the Cross-origion resource sharing (CORS). And it works well with curl operation in local connection.

I create new remote db in chrome with pouchdb. But the remote db's replication failed with 'message: "getCheckpoint rejected with "'.

var remotedb = new PouchDB('http://admin:[email protected]:5984/remoteDB');

localdb.replicate.to(remotedb).on('complete', function () {
   console.log('Done');
}).on('error', function (err) {
   console.log('Error', err);
});

remotedb.info() failed with 'name: "unknown"' message.

try {
  ret = await remotedb.info();
} catch (err) {
  console.log('error', err);
}

I am guessing that the remoteDB of pouchdb in chrome have problem. However, I am not sure what is the exact cause.

1

1 Answers

1
votes

I found the answer to the above question. It was a simple novice mistake. The answer was CORS and HTTPS issues. Below is a workaround.

Chrome's CORS solved it by turning off web security.

chrome --disable-web-security --user-data-dir

https://medium.com/@baphemot/understanding-cors-18ad6b478e2b

And HTTPS is a Self Signed Certificates, which was a problem that Chrome rejected.

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=48203146

Looking for two answers, database replication worked fine.