Friday, October 24, 2014

Couchdb Filter Replication Error: "changes_reader_died" Debugged

Couchdb replication allows for filtering. It produces a nondescript error of "changes_reader_died" with endless attempts at replication. The error is a result of a poorly named query key (parameter).

This can be seen when a document in the _replicator database contains the following. The query key is set to "key".

"query_params": {
    "key": "user"
  }
}

You may have to delete your _replicator database to stop the replication loop even with "continuous": false.


The solution was to change the key from "key" to another label. In the example below it is changed to "mailbox".


"query_params": {
    "mailbox": "user"
  }
}

With this change the dreaded "error" :"changes_reader_died" was debugged and I could relax.

1 comment:

Kxepal® said...

CouchDB requires to have valid JSON value for "key", "keys", "startkey" and "endkey" query parameters.

You don't have to delete whole replicator database to stop it. Just a replication document.

But it's true that the error should be more friendly.