2017-11-28 4 views
1

Ich versuche eine lokale PouchDB-Instanz mit einer Remote-CouchDB-Instanz in Google App Engine zu synchronisieren.CouchDB Sync-Fehler net :: ERR_CONNECTION_RESET

Ich habe successfully logged in to the remote instance, aber ich erhalte die folgende Fehlermeldung, wenn ich zu synchronisieren versuchen:

replication paused (e.g. user went offline) 
pouchdb-6.3.4.min.js:9 GET https://<ipaddress>:6984/pouchnotes/ net::ERR_CONNECTION_RESET 

Sync-Funktion

PouchNotesObj.prototype.syncnoteset = function (start, end) { 
    var start = new Date().getTime(); 
    document.getElementById("syncbutton").innerHTML = "Syncing..."; 

    var i, 
    that = this, 

    options = { 
    doc_ids:['1450853987668'] 
    }; 

    if(start){ options.startkey = start; } 
    if(end){ options.endkey = end; } 

    PouchDB.sync(this.dbname, this.remote, { retry: true }) 
    .on('change', function (info) { 
     console.log('change'); 
     document.getElementById("syncbutton").innerHTML = "Sync Notes"; 
    }).on('paused', function() { 
     console.log('replication paused (e.g. user went offline)'); 
     document.getElementById("syncbutton").innerHTML = "Sync Notes"; 
    }).on('active', function() { 
     console.log('replicate resumed (e.g. user went back online)'); 
     document.getElementById("syncbutton").innerHTML = "Sync Notes"; 
    }).on('denied', function (info) { 
     console.log('a document failed to replicate, e.g. due to permissions'); 
     document.getElementById("syncbutton").innerHTML = "Sync Notes"; 
    }).on('complete', function (info) { 
     console.log("Sync Complete"); 
     document.getElementById("syncbutton").innerHTML = "Sync Notes"; 
     that.viewnoteset(); 
     that.formobject.reset();  
     that.show(that.formobject.dataset.show); 
     that.hide(that.formobject.dataset.hide); 
     var end = new Date().getTime(); 
     console.log("Time Taken - " + (end - start) + " ms"); 
    }).on('error', function (error) { 
     console.log("Sync Error:" + JSON.stringify(error)); 
     alert("Sync Error:" + error); 
     that.showerror(error); 
    }); 

} 

Edited hinzufügen: ich festlegen müssen das hoch? replication job config on Fauxton

Antwort

1

Es stellte sich heraus, dass I had not configured the firewall correctly.

Für alle anderen, die über dieses Problem stolpern: Sie brauchen nur SSH-Tunneling, um Fauxton auf localhost zuzugreifen. Sie benötigen es nicht, um auf die API zuzugreifen.

Wenn Sie access the API via https, the port is 6984 (nicht 5984) und für einen nicht Google App Engine-Server möchten, benötigen Sie etwas wie Nginx set up to provide a SSL certificate. In Google App Engine werden SSL-Zertifikate bereitgestellt.

Aber Sie müssen immer noch configure CouchDB to enable SSL.

Thanks to the guys at the CouchDB user mailing list for their input.

Verwandte Themen