function_clause error with _bulk_docs in dp4
Tue, 04/24/2012 - 02:52
While migrating to dp4 i found a (minor) issue when filling my test cluster with test data.
The cluster has 2 small nodes (one on a debian vm on my dev box and the other the dev box itself, an ubuntu box) and two buckets, both empty and fresh clean install of Couchbase DP4.
(i tried the same with on node in the vm itself, same output, but the logs are from the cluster)
I use a curl call like the following for this:
curl -v -H 'Content-Type: application/json' --data-binary @test.json -X POST 'http://ar-couch1.tech:8092/default/_bulk_docs/'
The data ist simple enozgh:
{
"docs": [
{
"_id": "0001",
"nix": "huhu, ich bin 1",
"stamp": 1335185005.3333,
"text": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
},
{
"_id": "0002",
"nix": "huhu, ich bin 2",
"stamp": 1335185005.3334,
"text": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
},
[...](you get the idea....)
The complete json ist valid as my checkers say.
The output of curl is:
* About to connect() to localhost port 8092 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8092 (#0)
> GET /_config/log HTTP/1.1
> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6
> Host: localhost:8092
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: CouchDB/1.2.0a-5afec79-git (Erlang OTP/R14B03)
< Date: Tue, 24 Apr 2012 09:11:29 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 89
< Cache-Control: must-revalidate
<
{"file":"/opt/couchbase/var/log/couchdb/couch.log","include_sasl":"true","level":"info"}
* Connection #0 to host localhost left intact
* Closing connection #0and in the log is:
[couchdb:info] [2012-04-24 11:12:25] [ns_1@192.168.62.203:<0.9005.0>:couch_log:error:42] function_clause error in HTTP request
[couchdb:info] [2012-04-24 11:12:25] [ns_1@192.168.62.203:<0.9005.0>:couch_log:info:39] Stacktrace: [{capi_frontend,
'-update_docs/3-fun-0-',
[{doc,
<<"0001">>,
{0,
<<>>},
{[{<<"nix">>,
<<"huhu, ich bin 1">>},
{<<"text">>,
<<"Lorem ipsum dolor sit amet, consectetuer adipiscing elit.">>},
{<<"stamp">>,
1335185005.3333}]},
nil,
false,
[]}]},
{lists,
foreach,
2},
{capi_frontend,
update_docs,
3},
{couch_httpd_db,
db_req,
2},
{couch_httpd,
handle_request_int,
6},
{mochiweb_http,
headers,
5},
{proc_lib,
init_p_do_apply,
3}]
[couchdb:info] [2012-04-24 11:12:25] [ns_1@192.168.62.203:<0.9005.0>:couch_log:info:39] 127.0.0.1 - - POST /default/_bulk_docs 500(output from cbbrowse_logs|and only a small snipplet from it, i got more if necessary)
i'm pretty sure it's something stupid i missed but i cant see it...
the error function_clause is something from erlang, i presume?
Any tips on how to get th bulk upload working?
hanks in advance,
A. Rabus
Oh, my workaround for now is a small php script that uploads the data in the json via memcache API.
This works..