Couchdb: Purge throws "this feature is not yet implemented"

Created on 7 Jun 2018  路  16Comments  路  Source: apache/couchdb

Expected Behavior

Should purge the document as in documentation

Current Behavior

Returns an error message
{
"error": "not_implemented",
"reason": "this feature is not yet implemented"
}

Steps to Reproduce (for bugs)

  1. Triggering a HTTP POST to http://localhost:5984/userdb-61/_purge with ({"id": ["rev"]})
  2. Returns the above error

Context



We are having a db with lots of _deleted docs, that is sync with PouchDB and we need to clean them up because they are getting replicated. So we are getting All Changes and from each change we're using the doc id and rev to trigger a POST to _purge

Your Environment

  • Version used: 2.1.1
  • Browser Name and version: Postman / .Net HttpClient
  • Operating System and version (desktop or mobile): Windows 10
    I have also ran into: https://groups.google.com/forum/#!topic/couchdb-user-archive/yDf965WCTMQ and in Fauxton Setup it says: "Apache CouchDB is configured for production usage as a single node!"

All 16 comments

Clustered Purge is under development. Hopefully it can help solve your problem once it lands.

Duplicate of #1352.

As a workaround, you can do a filtered replication to another database that removes the tombstones.

See https://eclipsesource.com/blogs/2015/04/20/how-to-finally-delete-documents-in-couchdb/ and especially the comment thread posts by @willholley .

@jiangphcn: Thanks, but I thought it would have worked for single node, or am I confusing something? Also when do you think this would be delivered? Thanks again?
@wohali: Thanks but my db is the db of a user created by per user db config, so can't really do that, any other suggestions?

For single node purge, you need to use couch_db:purge_docs(Db1, [{<<"doc1">>, [Rev1]}]). to purge document. However, you need to stop mem3 to avoid unexpected replication. Also anyway this may cause the rebuild of index. If you can accept these side effects, you can have a try with local node purge.

@davisp and myself are working on clustered purge and code was under review process.

@jiangphcn: Thanks again. Great news, this means it might get shipped with next version? Maybe I am pushing too much, but is there a release date?
Also I need to mention we are using this via REST API so not familiar with your suggested solution,

I can't accurately say when it will be released for now because there are multiple factors to decide how long it will take to complete this feature. But it should be available in near future. Also, the clustered purge is also to provide REST API approach for usage.

I'm also a user not not familiar with ERL. So a public api for _purge would be very helpful in complying with GDPR.
Any status update for this?

No sooner than CouchDB 2.3.0.

@jlami Also, remember that a delete followed by a compact will remove all record of a document except for the _id and _rev fields. You only need purge for GDPR if you have sensitive data in the _id field itself.

But for now we are disabling compaction to use the revisions for history. I know, misuse of a feature. But it seemed like a good thing at the time.

Compaction can't really be triggered manually can it?
[edit] Aaaah, sure: /{db}/_compact works

Hello! I am experiencing the same problem on a single-node configuration of CouchDB (not clustered).
I am not using CouchDB directly but only through another application called Pyrame.
In the link, you can look at the portion of code that throws the error. In turn, this application makes use of the purge function offered by the couchdb-python package.
I am a physicists and not a server administrator so my knowledge of the inner working of CouchDB is very limited. I read from above that there is a workaround but I cannot understand how to use it.
Could you please explain to me how to modify the Pyrame or couchdb-python code to make use of the workaround? I know that it is not strictly "your job" to do so and apologize for the strange request.
I am using CouchDB 2.2.0~bionic and Ubuntu 18.04. CouchDB was installed from the repositories.

@LastStarDust Clustered purge is not in CouchDB 2.2, but was just merged to CouchDB master branch. You can see more information about this new feature from https://github.com/apache/couchdb-documentation/pull/285/files.

@jiangphcn Thank you for the hint. Anyway I am using a single-node configuration and I am getting the same error. I tried to compile from source the master branch but I got stuck because of other errors. If possible I would like to stick using the repository version of couchdb.

@LastStarDust The next released version of CouchDB will include purge functionality. Or, you can go back to CouchDB 1.x.

Ok clear! I will downgrade to
1.x for the time being.

Was this page helpful?
0 / 5 - 0 ratings