PouchDB remote replicate to 404 not found

864 views Asked by At

I am getting 404 error from pouchDB when creating and replicating to remote couchDB, running from a cordova app. Not sure next step for testing.

I have found a number of references with this error when creating a local instance, however my local instance is working great this is occurring when trying to replicate to remote server.

    var readingTime = new PouchDB('reading_time');
    var readingTimeServer = new PouchDB(serverHost + 'reading_time');
    initReadingTimeStats();

    function initReadingTimeStats(){        
      var replicateReadingTimeToServer = readingTime.replicate.to(readingTimeServer, {live: true});     

      replicateReadingTimeToServer.on("error", function(err){
      console.log("!!!!!!!!Reading time replication error: " + err);
    });
}

In chrome console I see:

Failed to load resource: the server responded with a status of 404 (Not Found)
....:5984/reading_time/?_nonce=3j0jadvieUjp9xtb 

when creating pouchDB instance, the web link does work from PC and the android 4.4 device testing on. And every minute (60000 timeout) I see:

Reading time replication error: {"status":404,"name":"not_found"}

When adding entry into the local readingTime, I get success:

Object {ok: true, id: "F42D5BEB-513F-E8EE-878C-861E69C770B7", rev: "1-7933e17d149aa8786382de64284f58f6"}

This is then followed with another attempt to sync which gives same 404 error. Following the link to the remote instance number of docs stays at 0 so its definitely not syncing

0

There are 0 answers