You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Alexander Gabriel <al...@barbalex.ch> on 2011/04/24 23:17:30 UTC

bulk import error

Hi
I've imported several bulk json files so far.

This time I get an error I can't solve.
I'm using: curl -vX POST
http://barbalex:dLhdMg12@127.0.0.1:5984/evab/_bulk_docs -H "Content-Type:
application/json" -d @Feld.json

And I get this:
C:\Users\alex\EvabMobile>curl -vX POST
http://barbalex:dLhdMg12@127.0.0.1:5984/e
vab/_bulk_docs -H "Content-Type: application/json" -d @Feld.json
* About to connect() to 127.0.0.1 port 5984 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
* Server auth using Basic with user 'barbalex'
> POST /evab/_bulk_docs HTTP/1.1
> Authorization: Basic YmFyYmFsZXg6ZExoZE1nMTI=
> User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 zlib/1.2.5
> Host: 127.0.0.1:5984
> Accept: */*
> Content-Type: application/json
> Content-Length: 115221
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 500 Internal Server Error
< Server: CouchDB/1.0.2 (Erlang OTP/R14B)
< Date: Sun, 24 Apr 2011 21:11:37 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 53
< Cache-Control: must-revalidate
<
{"error":"unknown_error","reason":"function_clause"}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0

The document passes the text on http://www.jsonlint.com/
It is attached.

Any idea what is wrong?

Help is much appreciated.

Re: bulk import error

Posted by Alexander Gabriel <al...@barbalex.ch>.
Hi Sebastian

CouchDb log says:

[Mon, 25 Apr 2011 20:20:10 GMT] [error] [<0.5010.0>] *function_clause error
in HT*
*TP request*

[Mon, 25 Apr 2011 20:20:10 GMT] [info] [<0.5010.0>] Stacktrace:
[{lists,map,[#Fu
n<couch_httpd_db.7.2522027>,undefined]},
             {couch_httpd_db,db_req,2},
             {couch_httpd_db,do_db_req,2},
             {couch_httpd,handle_request_int,5},
             {mochiweb_http,headers,5},
             {proc_lib,init_p_do_apply,3}]

[Mon, 25 Apr 2011 20:20:10 GMT] [info] [<0.5010.0>] 127.0.0.1 - - 'POST'
/evab/_
bulk_docs 500

there is a design coc but at the moment no validation functions.

Does that tell you something?

Thanks for answering!


2011/4/25 Sebastian Cohnen <se...@googlemail.com>

> Hey Alexander,
>
> What does your couchdb log say? Do you have any design docs in this db?
> What about validation functions?
>
> Typed on glass.
>
> Am 24.04.2011 um 23:17 schrieb Alexander Gabriel <al...@barbalex.ch>:
>
> > Hi
> > I've imported several bulk json files so far.
> >
> > This time I get an error I can't solve.
> > I'm using: curl -vX POST
> http://barbalex:dLhdMg12@127.0.0.1:5984/evab/_bulk_docs -H "Content-Type:
> application/json" -d @Feld.json
> >
> > And I get this:
> > C:\Users\alex\EvabMobile>curl -vX POST
> http://barbalex:dLhdMg12@127.0.0.1:5984/e
> > vab/_bulk_docs -H "Content-Type: application/json" -d @Feld.json
> > * About to connect() to 127.0.0.1 port 5984 (#0)
> > *   Trying 127.0.0.1... connected
> > * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
> > * Server auth using Basic with user 'barbalex'
> > > POST /evab/_bulk_docs HTTP/1.1
> > > Authorization: Basic YmFyYmFsZXg6ZExoZE1nMTI=
> > > User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 zlib/1.2.5
> > > Host: 127.0.0.1:5984
> > > Accept: */*
> > > Content-Type: application/json
> > > Content-Length: 115221
> > > Expect: 100-continue
> > >
> > < HTTP/1.1 100 Continue
> > < HTTP/1.1 500 Internal Server Error
> > < Server: CouchDB/1.0.2 (Erlang OTP/R14B)
> > < Date: Sun, 24 Apr 2011 21:11:37 GMT
> > < Content-Type: text/plain;charset=utf-8
> > < Content-Length: 53
> > < Cache-Control: must-revalidate
> > <
> > {"error":"unknown_error","reason":"function_clause"}
> > * Connection #0 to host 127.0.0.1 left intact
> > * Closing connection #0
> >
> > The document passes the text on http://www.jsonlint.com/
> > It is attached.
> >
> > Any idea what is wrong?
> >
> > Help is much appreciated.
> >
> > <Feld.json>
>

Re: bulk import error

Posted by Sebastian Cohnen <se...@googlemail.com>.
Hey Alexander,

What does your couchdb log say? Do you have any design docs in this db? What about validation functions?

Typed on glass.

Am 24.04.2011 um 23:17 schrieb Alexander Gabriel <al...@barbalex.ch>:

> Hi
> I've imported several bulk json files so far.
> 
> This time I get an error I can't solve.
> I'm using: curl -vX POST http://barbalex:dLhdMg12@127.0.0.1:5984/evab/_bulk_docs -H "Content-Type: application/json" -d @Feld.json
> 
> And I get this:
> C:\Users\alex\EvabMobile>curl -vX POST http://barbalex:dLhdMg12@127.0.0.1:5984/e
> vab/_bulk_docs -H "Content-Type: application/json" -d @Feld.json
> * About to connect() to 127.0.0.1 port 5984 (#0)
> *   Trying 127.0.0.1... connected
> * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
> * Server auth using Basic with user 'barbalex'
> > POST /evab/_bulk_docs HTTP/1.1
> > Authorization: Basic YmFyYmFsZXg6ZExoZE1nMTI=
> > User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 zlib/1.2.5
> > Host: 127.0.0.1:5984
> > Accept: */*
> > Content-Type: application/json
> > Content-Length: 115221
> > Expect: 100-continue
> >
> < HTTP/1.1 100 Continue
> < HTTP/1.1 500 Internal Server Error
> < Server: CouchDB/1.0.2 (Erlang OTP/R14B)
> < Date: Sun, 24 Apr 2011 21:11:37 GMT
> < Content-Type: text/plain;charset=utf-8
> < Content-Length: 53
> < Cache-Control: must-revalidate
> <
> {"error":"unknown_error","reason":"function_clause"}
> * Connection #0 to host 127.0.0.1 left intact
> * Closing connection #0
> 
> The document passes the text on http://www.jsonlint.com/
> It is attached.
> 
> Any idea what is wrong?
> 
> Help is much appreciated.
> 
> <Feld.json>

Re: bulk import error

Posted by Alexander Gabriel <al...@barbalex.ch>.
Hi Dave

That was it: docs instead of rows did it!

Thanks a lot!

Is there a way to mark the problem solved? This was my first post.

Alex





2011/4/25 Dave Cottlehuber <da...@muse.net.nz>

> On 25 April 2011 09:17, Alexander Gabriel <al...@barbalex.ch> wrote:
>
> > Hi
> > I've imported several bulk json files so far.
> >
> > This time I get an error I can't solve.
> > I'm using: curl -vX POST http://127.0.0.1:5984/evab/_bulk_docs<
> http://barbalex:dLhdMg12@127.0.0.1:5984/evab/_bulk_docs>-H "Content-Type:
> application/json" -d @Feld.json
> > The document passes the text on http://www.jsonlint.com/.
> >
> > Any idea what is wrong?
> >
> > Help is much appreciated.
> >
> >
> #L2 s/rows/docs/
>
> your JSON is valid, but does not comply with _bulk_docs spec.
>
>
> http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Modify_Multiple_Documents_With_a_Single_Request
>
> http://techzone.couchbase.com/sites/default/files/uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_db-bulk-docs_post
>
> A+
> Dave
>

Re: bulk import error

Posted by Dave Cottlehuber <da...@muse.net.nz>.
On 25 April 2011 09:17, Alexander Gabriel <al...@barbalex.ch> wrote:

> Hi
> I've imported several bulk json files so far.
>
> This time I get an error I can't solve.
> I'm using: curl -vX POST http://127.0.0.1:5984/evab/_bulk_docs<http://barbalex:dLhdMg12@127.0.0.1:5984/evab/_bulk_docs>-H "Content-Type: application/json" -d @Feld.json
> The document passes the text on http://www.jsonlint.com/.
>
> Any idea what is wrong?
>
> Help is much appreciated.
>
>
#L2 s/rows/docs/

your JSON is valid, but does not comply with _bulk_docs spec.

http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Modify_Multiple_Documents_With_a_Single_Request
http://techzone.couchbase.com/sites/default/files/uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_db-bulk-docs_post

A+
Dave