couchdb - Cloudant "case_clause" error with pouchdb when replicating -
i working pouchdb , cloudant, , when web app starts replication cloudant down pouchdb in browser. have idea of how pouchdb works internally, , how believe process works (high level):
- replication starts
- gets checkpoint doc cloudant db (contains latest sequence number retrived server, if not exists, assumes sequence # 0, case)
- grabs changes changes freed starting @ sequence number (it grabs 25 changes)
- writes(or updates) checkpoint doc cloudant server new sequence number (this way if network error occurs, can continue left off or next replication)
- repeats until no changes left
- replication complete
the problem @ step 4, when pouch tries write doc cloudant server (for first time), server returns 'case_clause' error. thinking issue might invalid id sent cloudant (cloudant doesn't accept ids of format), because id of doc written server _local/799c37dfaefb3774a04f55c7f8cee947
(or other random numbers , characters @ end). don't know if valid doc id or not (for cloudant is, because accurate pouchdb), guess asking, issue (unacceptable id cloudant), or there other issue based on error cloudant server returns.
here doc being written:
{ _id: "_local/799c37dfaefb3774a04f55c7f8cee947", last_seq: "63" }
here full error output chrome debugger:
{ error: "case_clause" reason: "{{case_clause,{ok,{error,[{{doc,>, {338, [>]}, {[{>,>}]}, [],false,[]}, {error,internal_server_error}}]}}}, [{fabric,update_doc,3},{chttpd_db,'-update_doc/6-fun-0-',3}]}" stack: array[4] 0: "chttpd_db:update_doc/6" 1: "chttpd:handle_request/1" 2: "mochiweb_http:headers/5" 3: "proc_lib:init_p_do_apply/3" length: 4 __proto__: array[0] status: 500 }
note: when go cloudant's futon , manually enter url checkpoint doc using id, not exist.
thanks
edit:
header info above request using chrome debugger:
request url:http://lessontrek.toddbluhm.c9.io/db/ilintindingreseseldropec/_local%2f799c37dfaefb3774a04f55c7f8cee947 request method:put status code:500 internal server error request headersview parsed put /db/ilintindingreseseldropec/_local%2f799c37dfaefb3774a04f55c7f8cee947 http/1.1 host: lessontrek.toddbluhm.c9.io connection: keep-alive content-length: 111 accept: application/json origin: http://lessontrek.toddbluhm.c9.io user-agent: mozilla/5.0 (macintosh; intel mac os x 10_8_4) applewebkit/537.36 (khtml, gecko) chrome/28.0.1500.71 safari/537.36 content-type: application/json referer: http://lessontrek.toddbluhm.c9.io/app accept-encoding: gzip,deflate,sdch accept-language: en-us,en;q=0.8 cookie: connect.sid=s%3a8mvbfmbiztx4vnoqzntiuxqi.tz9ykrqnv0epbtb%2fmspjsncyszj8qbsd5ewhzxqyibg; authsession=(removed security purposes, valid); db_name=ilintindingreseseldropec; __utma=200306492.386329876.1368934655.1375164160.1375252679.55; __utmc=200306492; __utmz=200306492.1372711539.22.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); c9.live.proxy=(removed security purposes, valid) request payloadview parsed {"_id":"_local/799c37dfaefb3774a04f55c7f8cee947","last_seq":"63","_rev":"338-7db9750558e43e2076a3aa720a6de47b"} response headersview parsed http/1.1 500 internal server error x-powered-by: express vary: accept-encoding x-couch-request-id: 7d2ca9fc server: couchdb/1.0.2 (erlang otp/r14b) date: wed, 31 jul 2013 07:29:23 gmt content-type: application/json cache-control: must-revalidate content-encoding: gzip transfer-encoding: chunked via: 1.1 project-livec993c2dc8b8c.rhcloud.com (node-web-proxy/0.4) x-c9-server: proxy_subdomain_collab-bus2_01
cloudant, couchdb, expects _local revs begin "0-". pouchdb should not generating rev values of form. if try put against couchdb same stack trace.
Comments
Post a Comment