[clouchdb-devel] Issue

Leo Zovic leo.zovic at gmail.com
Sat Sep 24 13:51:04 UTC 2011


Hey guys.

I tried out clouchdb yesterday and got an error while trying to have CouchDB
generate the ID for a document.

Reason "Content-Type must be application/json", Document ID: "NIL"
   [Condition of type DOC-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING
{10040D2E11}>)

Backtrace:
  0: (POST-DOCUMENT ((:|name| . "wine") (:|tags| "beverage" "fun"
"alcoholic")))
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CREATE-DOCUMENT '((:|name| . "wine")
(:|tags| "beverage" "fun" "alcoholic"))) #<NULL-LEXENV>)
 --more--

It seems that the DB now wants everything with the content-type
"application/json" (though creating a document while specifying the ID works
properly even though it's still being set to "text/javascript").

Your site doesn't list this issue, so I thought I'd bring it to your
attention.

This seems to fix it (based on the clouchdb source from quicklisp):

--- clouchdb.lispOLD    2011-09-24 09:38:20.000000000 -0400
+++ clouchdb.lisp    2011-09-24 09:38:58.000000000 -0400
@@ -753,7 +753,7 @@
 the :ID property."
   (let ((res (ensure-db ()
                (db-request (cat (url-encode (db-name *couchdb*)) "/")
-                           :content-type "text/javascript"
+                           :content-type "application/json"
                            :external-format-out +utf-8+
                            :content-length nil
                            :method :post
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/clouchdb-devel/attachments/20110924/4cf89ed2/attachment.html>


More information about the clouchdb-devel mailing list