I am trying to replicate a remote CouchDB database with PouchDB. Here is the replication call
try {
await PouchDB.replicate(sourceDB, targetDB);
console.log(`Replication complete!`);
} catch (err) {
console.error(`Replication failed with error ${err}`);
throw err;
}
The database (sourceDB
) is quite large (around 8.2k docs and 28k deleted docs, for a total of 16.6MB).
When calling the above, the replication always fails after around 10.4MB of data have been copied to targetDB
.
The exception says:
Replication failed with error {"name":"Error","message":"invalid json response body at http://my-db-url/_bulk_docs reason: Unexpected token < in JSON at position 0"}
I am using PouchDB 7.2.2 and CouchDB 3.1.0