Cloudant design document crashed with error, how can I fix it

106 Views Asked by At

I was making a mistake in cloudant. I was added dbcopy into my view without reduce function. Which making the cloudant gone crazy. I can't get that design document to fix

I call GET _design/ThatDesignDoc. It really should just give me text content of that document

But it not, instead it return error

{"error":"bad_request","reason":"The dbcopy option is only valid for reduce views."}

Which is bad. I cannot fix that document with this error keep coming instead of just a raw content. I cannot get any more information, to get specific revision also need to call this API and I don't know previous revision key

Actually I think this is a bug in cloudant system. This should not be a correct behaviour. I can't find any workaround

Are there anyone know anything I could do?

1

There are 1 best solutions below

2
On

There does indeed seem to be a bug in Cloudant - I've raised a ticket to get it fixed.

As a work around, you can hit the GET /db/_all_docs endpoint to get the rev token of the offending design document e.g.

GET /db/_all_docs?key="_design/ThatDesignDoc"

{"total_rows":1,"offset":0,"rows":[
{"id":"_design/ThatDesignDoc","key":"_design/ThatDesignDoc","value":{"rev":"1-d4fc0de1acd271dd298ef74e38906ab0"}}
]}

You can then use that value of rev to update or delete the document.