couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zekeriya KOÇ <>
Subject i have a bulk insert problem about invalid json
Date Tue, 10 Jan 2012 09:11:10 GMT
Sorry for subjectless message!!!


my problem: i am trying to insert approximately 255000 documents to a

couchdb instance with bulk docs api. i always get invalid json

so i am trying to test  the problem with just one document. because
the error raises wether with a large file or a file with just one

my system:
couchdb: on an ubuntu server 10.04
client: windows 7 with cygwin curl

$ curl -X GET http://admin:ad...<>

$ curl -d @test.txt -H "Content-Type:application/json" -X POST
{"error":"bad_request","reason":"invalid UTF-8 JSON: <<\"\ufeff{\\
\"docs\\\":[{\\\"adi\\\": \\\"zeko\\\"}]}\">>"}

now i copy the content of test.txt and paste it to my command line:
$ curl -d '{"docs":[{"adi": "zeko"}]}' -H "Content-Type:application/
json" -X POST http://admin:ad...<>

as you can see same content gives an invalid json error within a file
but from direct command line it inserts fine.

my text file is encoded in utf-8.

i am so close to give up. i am fighting with this for hours. if i can
not insert initial data to my instance i can not test the replication

please help!!

Zekeriya "zekUs" KOÇ -

Zekeriya "zekUs" KOÇ -

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message