Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created July 23, 2012 09:41
Show Gist options
  • Save boxxxie/3162829 to your computer and use it in GitHub Desktop.
Save boxxxie/3162829 to your computer and use it in GitHub Desktop.
couchdb $.couch.db.save Error
[debug] [<0.1228.0>] 'PUT' /categorization/9aef603131112c1f3aba4efb090031cb {1,
1} from "127.0.0.1"
Headers: [{'Accept',"application/json, text/javascript, */*; q=0.01"},
{'Accept-Charset',"ISO-8859-1,utf-8;q=0.7,*;q=0.3"},
{'Accept-Encoding',"gzip,deflate,sdch"},
{'Accept-Language',"en-GB,en-US;q=0.8,en;q=0.6"},
{'Connection',"keep-alive"},
{'Content-Length',"417"},
{'Content-Type',"application/json"},
{'Host',"127.0.0.1:5984"},
{"Origin","http://127.0.0.1:5984"},
{'Referer',"http://127.0.0.1:5984/"},
{'User-Agent',"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19"},
{"x-couchdb-requested-path",
"/categorization/_design/mrci/_rewrite/api/9aef603131112c1f3aba4efb090031cb"},
{"x-couchdb-vhost-path","/api/9aef603131112c1f3aba4efb090031cb"},
{"X-Requested-With","XMLHttpRequest"}]
[error] [<0.1228.0>] function_clause error in HTTP request
[info] [<0.1228.0>] Stacktrace: [{base64,decode,
[undefined],
[{file,"base64.erl"},{line,113}]},
{couch_doc,'-transfer_fields/2-fun-0-',1,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_doc.erl"},
{line,252}]},
{lists,map,2,
[{file,"lists.erl"},{line,1173}]},
{couch_doc,transfer_fields,2,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_doc.erl"},
{line,225}]},
{couch_httpd_db,couch_doc_from_req,3,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_httpd_db.erl"},
{line,968}]},
{couch_httpd_db,db_doc_req,3,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_httpd_db.erl"},
{line,776}]},
{couch_httpd_db,do_db_req,2,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_httpd_db.erl"},
{line,230}]},
{couch_httpd,handle_request_int,5,
[{file,
"/media/secrets/couchdb/dependencies/couchdb/src/couchdb/couch_httpd.erl"},
{line,317}]}]
[error] [<0.1228.0>] Uncaught server error: function_clause
[info] [<0.1228.0>] 127.0.0.1 - - PUT /categorization/9aef603131112c1f3aba4efb090031cb 500
[debug] [<0.1228.0>] httpd 500 error response:
{"error":"unknown_error","reason":"function_clause"}
@boxxxie
Copy link
Author

boxxxie commented Jul 23, 2012

Request URL:http://127.0.0.1:5984/api/9aef603131112c1f3aba4efb090031cb
Request Method:PUT
Status Code:500 Internal Server Error
Request Headersview source
Accept:application/json, text/javascript, /; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:552
Content-Type:application/json
Host:127.0.0.1:5984
Origin:http://127.0.0.1:5984
Referer:http://127.0.0.1:5984/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
X-Requested-With:XMLHttpRequest
Request Payload
{"min_page":1,"scale":1.5,"current_page":1,"_id":"9aef603131112c1f3aba4efb090031cb","_rev":"168-41a268f788e79e55e2db573e1cbfc5c4","#type":"market_research","last_edit_date":1343039799626,"dfhdhh":"dfhdfh","sdfds":"sdfsfsd","_attachments":{"qualilabelres":{"pdf":{"content_type":"application/pdf","revpos":2,"digest":"md5-0V3SLThkdwR57A01C6EYnA==","length":1038604,"stub":true}}},"max_page":96,"page":{"1":{"category":{"Study Nationality":{"Canada":false,"United Kingdom":true,"European Union":true,"Australia/New Zealand":true,"International":true}}}}}
Response Headersview source
Cache-Control:must-revalidate
Content-Length:53
Content-Type:application/json
Date:Mon, 23 Jul 2012 10:36:39 GMT
Server:CouchDB/1.2.0 (Erlang OTP/R15B)

@boxxxie
Copy link
Author

boxxxie commented Jul 23, 2012

ddoc.rewrites = [{
    from: "/",
    to: 'index.html'
}, {
    from: "/api",
    to: '../../'
}, {
    from: "/api/*",
    to: '../../*'
}, {
    from: "/*",
    to: '/*'
}];

@boxxxie
Copy link
Author

boxxxie commented Jul 23, 2012

working futon log

[debug] [<0.5148.0>] 'PUT' /categorization/9aef603131112c1f3aba4efb090031cb {1,
1} from "127.0.0.1"
Headers: [{'Accept',"application/json, text/javascript, /; q=0.01"},
{'Accept-Charset',"ISO-8859-1,utf-8;q=0.7,*;q=0.3"},
{'Accept-Encoding',"gzip,deflate,sdch"},
{'Accept-Language',"en-GB,en-US;q=0.8,en;q=0.6"},
{'Connection',"keep-alive"},
{'Content-Length',"329"},
{'Content-Type',"application/json"},
{'Cookie',"AuthSession="},
{'Host',"localhost:5984"},
{"Origin","http://localhost:5984"},
{'Referer',"http://localhost:5984/_utils/document.html?categorization/9aef603131112c1f3aba4efb090031cb"},
{'User-Agent',"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19"},
{"X-Requested-With","XMLHttpRequest"}]
[debug] [<0.5148.0>] OAuth Params: []
[info] [<0.5148.0>] 127.0.0.1 - - PUT /categorization/9aef603131112c1f3aba4efb090031cb 201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment