【问题标题】:CouchDB sync error net::ERR_CONNECTION_RESETCouchDB 同步错误 net::ERR_CONNECTION_RESET
【发布时间】:2017-11-30 22:46:44
【问题描述】:

我正在尝试将本地 PouchDB 实例与 Google App Engine 上的远程 CouchDB 实例同步。

我有successfully logged in to the remote instance,但是当我尝试同步时出现以下错误:

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

同步功能

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);
    });   

}

编辑添加:我需要设置吗?

【问题讨论】:

    标签: google-app-engine synchronization couchdb pouchdb


    【解决方案1】:

    原来是I had not configured the firewall correctly

    对于其他偶然发现此问题的人:您只需要 SSH 隧道即可访问 localhost 上的 Fauxton。您不需要它来访问 API。

    如果您想要access the API via https, the port is 6984(而不是 5984),并且对于非 Google App Engine 服务器,您需要类似 Nginx set up to provide a SSL certificate 的内容。在 Google App Engine 上,提供了 SSL 证书。

    但你仍然需要configure CouchDB to enable SSL

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-02
      • 2018-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-05
      • 1970-01-01
      相关资源
      最近更新 更多