You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Chris Stockton <ch...@gmail.com> on 2009/10/27 21:13:45 UTC
Bad special document member: [_attachments|__type]
Hello,
I was trying to replicate one of our databases, and came across the
response [1], Some googlin' led me to [2] I did not see further
discussion, anyone know a resolution?
When reducing my dataset for troubleshooting, I came across [3]. We
use __type to denote a application specific type, like _* is used for
couchdb, __* we were going to use for our application. I can see how
__ would match _* :p This is something I assume we need to rectify our
self, any suggestions to a alternative?
Regards,
-Chris
--
[1] {"error":"json_encode","reason":"{bad_term,{nocatch,{doc_validation,<<\"Bad
special document member: _attachments\">>}}}"}
[2] http://issues.apache.org/jira/browse/COUCHDB-362
[3] {"error":"json_encode","reason":"{bad_term,{nocatch,{doc_validation,<<\"Bad
special document member: __type\">>}}}"}
Re: Bad special document member: [_attachments|__type]
Posted by Paul Davis <pa...@gmail.com>.
Chris,
If memory serves that was a bug fix in 0.9.1 (though maybe it got
delayed to 0.10.0) but it was never intended that we allow _* fields.
In fact you might be able to try:
$ curl -X PUT -d '{"_foo": 1}' http://127.0.0.1:5984/db_name/bar
That should fail because the field value is a number and not a string.
HTH,
Paul Davis
On Tue, Oct 27, 2009 at 4:43 PM, Chris Stockton
<ch...@gmail.com> wrote:
> Hello, thank you for the response,
>
> On Tue, Oct 27, 2009 at 1:21 PM, Adam Kocoloski <ko...@apache.org> wrote:
>> Hi Chris, it sounds like a version mismatch. Were you replicating from a
>> newer version to an older version? Better yet, can you just give the full
>> details of the replication config and the server versions.
>
> I believe I am going from 0.9.0 to 0.10.0. The replication command I
> am running to do this 1 time copy (migrating from this old server to a
> new one)
>
> curl -X POST http://user:pass@(new 0.10.0):5984/_replicate -d
> '{"source":"http://user:pass@(old 0.10.0):5984/master",
> "target":"master"}'
>
> Result:
> {"error":"json_encode","reason":"{bad_term,{nocatch,{doc_validation,<<\"Bad
> special document member: _attachments\">>}}}"}
>
>> Yeah, at the moment there's no way to bypass this restriction -- you can't
>> start your own fields with _* Best,
> Okay, it seems this restriction must have skipped "__" in 0.9.0 as it
> works on that server. I will update the column names to something
> else.
>
> Regards,
>
> -Chris
>
Re: Bad special document member: [_attachments|__type]
Posted by Chris Stockton <ch...@gmail.com>.
Hello, thank you for the response,
On Tue, Oct 27, 2009 at 1:21 PM, Adam Kocoloski <ko...@apache.org> wrote:
> Hi Chris, it sounds like a version mismatch. Were you replicating from a
> newer version to an older version? Better yet, can you just give the full
> details of the replication config and the server versions.
I believe I am going from 0.9.0 to 0.10.0. The replication command I
am running to do this 1 time copy (migrating from this old server to a
new one)
curl -X POST http://user:pass@(new 0.10.0):5984/_replicate -d
'{"source":"http://user:pass@(old 0.10.0):5984/master",
"target":"master"}'
Result:
{"error":"json_encode","reason":"{bad_term,{nocatch,{doc_validation,<<\"Bad
special document member: _attachments\">>}}}"}
> Yeah, at the moment there's no way to bypass this restriction -- you can't
> start your own fields with _* Best,
Okay, it seems this restriction must have skipped "__" in 0.9.0 as it
works on that server. I will update the column names to something
else.
Regards,
-Chris
Re: Bad special document member: [_attachments|__type]
Posted by Adam Kocoloski <ko...@apache.org>.
On Oct 27, 2009, at 4:13 PM, Chris Stockton wrote:
> Hello,
>
> I was trying to replicate one of our databases, and came across the
> response [1], Some googlin' led me to [2] I did not see further
> discussion, anyone know a resolution?
Hi Chris, it sounds like a version mismatch. Were you replicating
from a newer version to an older version? Better yet, can you just
give the full details of the replication config and the server versions.
_attachments, if memory serves, is a new-ish field, so older versions
may not recognize it.
> When reducing my dataset for troubleshooting, I came across [3]. We
> use __type to denote a application specific type, like _* is used for
> couchdb, __* we were going to use for our application. I can see how
> __ would match _* :p This is something I assume we need to rectify our
> self, any suggestions to a alternative?
Yeah, at the moment there's no way to bypass this restriction -- you
can't start your own fields with _* Best,
Adam
>
> Regards,
>
> -Chris
>
> --
>
> [1] {"error":"json_encode","reason":"{bad_term,{nocatch,
> {doc_validation,<<\"Bad
> special document member: _attachments\">>}}}"}
> [2] http://issues.apache.org/jira/browse/COUCHDB-362
> [3] {"error":"json_encode","reason":"{bad_term,{nocatch,
> {doc_validation,<<\"Bad
> special document member: __type\">>}}}"}