_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:43:23 GMT] [error] [<0.6197.123>] ** Generic server <0.6197.123> terminating ** Last message in was {'EXIT',<0.6201.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6198.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6198.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6198.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6201.123>,nil,false, [{{<0.6187.123>,#Ref<0.0.272.235559>},2195}], <0.6202.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:23 GMT] [error] [<0.6197.123>] {error_report,<0.31.0>, {<0.6197.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6197.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6198.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:43:23 GMT] [error] [<0.6198.123>] ** Generic server <0.6198.123> terminating ** Last message in was {'EXIT',<0.6197.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891271>,636}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:23 GMT] [error] [<0.6198.123>] {error_report,<0.31.0>, {<0.6198.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6198.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6197.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6202.123>,shutdown}]}, {links,[#Port<0.891271>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1499}], []]}} [Mon, 04 Oct 2010 15:43:23 GMT] [info] [<0.6187.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:43:23 GMT] [error] [<0.6195.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:43:23 GMT] [info] [<0.6195.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:43:23 GMT] [info] [<0.6195.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:43:24 GMT] [info] [<0.6196.123>] 10.220.226.191 - - 'GET' /jsregistry/ 200 [Mon, 04 Oct 2010 15:43:29 GMT] [error] [<0.6187.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:43:29 GMT] [info] [<0.6187.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:43:29 GMT] [error] [<0.6187.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:43:29 GMT] [info] [<0.6187.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:43:29 GMT] [info] [<0.6187.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/favicon.ico 500 [Mon, 04 Oct 2010 15:43:38 GMT] [error] [<0.6223.123>] ** Generic server <0.6223.123> terminating ** Last message in was {'EXIT',<0.6226.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6224.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6224.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6224.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6226.123>,nil,false, [{{<0.6212.123>,#Ref<0.0.272.235888>},2195}], <0.6227.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:38 GMT] [error] [<0.6223.123>] {error_report,<0.31.0>, {<0.6223.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6223.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6224.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:43:38 GMT] [error] [<0.6224.123>] ** Generic server <0.6224.123> terminating ** Last message in was {'EXIT',<0.6223.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891277>,633}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:38 GMT] [error] [<0.6224.123>] {error_report,<0.31.0>, {<0.6224.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6224.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6223.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891277>,<0.6227.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1490}], [{neighbour, [{pid,<0.6227.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6223.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.235887>,process,<0.6223.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6224.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:43:38 GMT] [info] [<0.6212.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:43:43 GMT] [error] [<0.6212.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:43:43 GMT] [info] [<0.6212.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:43:43 GMT] [error] [<0.6212.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:43:43 GMT] [info] [<0.6212.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:43:43 GMT] [info] [<0.6212.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/favicon.ico 500 [Mon, 04 Oct 2010 15:43:48 GMT] [error] [<0.6243.123>] ** Generic server <0.6243.123> terminating ** Last message in was {'EXIT',<0.6246.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6244.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6244.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6244.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6246.123>,nil,false, [{{<0.6222.123>,#Ref<0.0.272.236155>},2195}], <0.6247.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:48 GMT] [error] [<0.6243.123>] {error_report,<0.31.0>, {<0.6243.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6243.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6244.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:43:48 GMT] [error] [<0.6244.123>] ** Generic server <0.6244.123> terminating ** Last message in was {'EXIT',<0.6243.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891280>,636}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:43:48 GMT] [error] [<0.6244.123>] {error_report,<0.31.0>, {<0.6244.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6244.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6243.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891280>,<0.6247.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1498}], [{neighbour, [{pid,<0.6247.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6243.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.236154>,process,<0.6243.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6244.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:43:48 GMT] [info] [<0.6222.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:43:50 GMT] [error] [<0.6242.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:43:50 GMT] [info] [<0.6242.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:43:50 GMT] [error] [<0.6242.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:43:50 GMT] [info] [<0.6242.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:43:50 GMT] [info] [<0.6242.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:44:00 GMT] [error] [<0.6254.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:44:00 GMT] [info] [<0.6254.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:44:00 GMT] [error] [<0.6254.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:44:00 GMT] [info] [<0.6254.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:44:00 GMT] [info] [<0.6254.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/node-inspector 500 [Mon, 04 Oct 2010 15:44:03 GMT] [error] [<0.6265.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:44:03 GMT] [info] [<0.6265.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:44:03 GMT] [error] [<0.6265.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:44:03 GMT] [info] [<0.6265.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:44:03 GMT] [info] [<0.6265.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:44:06 GMT] [error] [<0.6268.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:44:06 GMT] [info] [<0.6268.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:44:06 GMT] [error] [<0.6268.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:44:06 GMT] [info] [<0.6268.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:44:06 GMT] [info] [<0.6268.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:44:15 GMT] [info] [<0.6273.123>] 10.220.226.191 - - 'GET' /jsregistry/ 200 [Mon, 04 Oct 2010 15:44:31 GMT] [error] [<0.6302.123>] ** Generic server <0.6302.123> terminating ** Last message in was {'EXIT',<0.6305.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6303.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6303.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6303.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6305.123>,nil,false, [{{<0.6289.123>,#Ref<0.0.272.236725>},2195}], <0.6306.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:44:31 GMT] [error] [<0.6302.123>] {error_report,<0.31.0>, {<0.6302.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6302.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6303.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:44:31 GMT] [error] [<0.6303.123>] ** Generic server <0.6303.123> terminating ** Last message in was {'EXIT',<0.6302.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891290>,631}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:44:31 GMT] [error] [<0.6303.123>] {error_report,<0.31.0>, {<0.6303.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6303.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6302.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891290>,<0.6306.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1494}], [{neighbour, [{pid,<0.6306.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6302.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.236724>,process,<0.6302.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6303.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:44:31 GMT] [info] [<0.6289.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:44:45 GMT] [error] [<0.6301.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:44:45 GMT] [info] [<0.6323.123>] 127.0.0.1 - - 'GET' / 200 [Mon, 04 Oct 2010 15:44:45 GMT] [info] [<0.6301.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:44:45 GMT] [error] [<0.6301.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:44:45 GMT] [info] [<0.6301.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:44:45 GMT] [info] [<0.6301.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:44:53 GMT] [error] [<0.6335.123>] ** Generic server <0.6335.123> terminating ** Last message in was {'EXIT',<0.6338.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6336.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6336.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6336.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6338.123>,nil,false, [{{<0.6330.123>,#Ref<0.0.272.237059>},2195}], <0.6339.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:44:53 GMT] [error] [<0.6335.123>] {error_report,<0.31.0>, {<0.6335.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6335.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6336.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:44:53 GMT] [info] [<0.6330.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:44:53 GMT] [error] [<0.6336.123>] ** Generic server <0.6336.123> terminating ** Last message in was {'EXIT',<0.6335.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891297>,594}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:44:53 GMT] [error] [<0.6336.123>] {error_report,<0.31.0>, {<0.6336.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6336.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6335.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6339.123>,shutdown}]}, {links,[#Port<0.891297>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1495}], []]}} [Mon, 04 Oct 2010 15:45:07 GMT] [error] [<0.6358.123>] ** Generic server <0.6358.123> terminating ** Last message in was {'EXIT',<0.6361.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6359.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6359.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6359.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6361.123>,nil,false, [{{<0.6334.123>,#Ref<0.0.272.237471>},2195}], <0.6362.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:45:07 GMT] [error] [<0.6358.123>] {error_report,<0.31.0>, {<0.6358.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6358.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6359.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:45:07 GMT] [info] [<0.6334.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:45:07 GMT] [error] [<0.6359.123>] ** Generic server <0.6359.123> terminating ** Last message in was {'EXIT',<0.6358.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891302>,594}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:45:07 GMT] [error] [<0.6359.123>] {error_report,<0.31.0>, {<0.6359.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6359.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6358.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6362.123>,shutdown}]}, {links,[#Port<0.891302>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1503}], []]}} [Mon, 04 Oct 2010 15:45:39 GMT] [error] [<0.6357.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:45:39 GMT] [info] [<0.6357.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:45:39 GMT] [error] [<0.6357.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:45:39 GMT] [info] [<0.6357.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:45:39 GMT] [info] [<0.6357.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:45:55 GMT] [error] [<0.6400.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:45:55 GMT] [info] [<0.6400.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:45:56 GMT] [error] [<0.6400.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:45:56 GMT] [info] [<0.6400.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:45:56 GMT] [info] [<0.6400.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/ejs 500 [Mon, 04 Oct 2010 15:45:58 GMT] [error] [<0.6422.123>] ** Generic server <0.6422.123> terminating ** Last message in was {'EXIT',<0.6425.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6423.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6423.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6423.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6425.123>,nil,false, [{{<0.6417.123>,#Ref<0.0.272.237795>},2195}], <0.6426.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:45:59 GMT] [error] [<0.6422.123>] {error_report,<0.31.0>, {<0.6422.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6422.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6423.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:45:59 GMT] [error] [<0.6423.123>] ** Generic server <0.6423.123> terminating ** Last message in was {'EXIT',<0.6422.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891320>,631}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:45:59 GMT] [error] [<0.6423.123>] {error_report,<0.31.0>, {<0.6423.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6423.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6422.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891320>,<0.6426.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1494}], [{neighbour, [{pid,<0.6426.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6422.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.237794>,process,<0.6422.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6423.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:45:59 GMT] [info] [<0.6417.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:46:13 GMT] [error] [<0.6446.123>] ** Generic server <0.6446.123> terminating ** Last message in was {'EXIT',<0.6449.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6447.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6447.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6447.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6449.123>,nil,false, [{{<0.6421.123>,#Ref<0.0.272.238076>},2195}], <0.6450.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:13 GMT] [error] [<0.6446.123>] {error_report,<0.31.0>, {<0.6446.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6446.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6447.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:46:13 GMT] [error] [<0.6447.123>] ** Generic server <0.6447.123> terminating ** Last message in was {'EXIT',<0.6446.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891323>,594}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:13 GMT] [error] [<0.6447.123>] {error_report,<0.31.0>, {<0.6447.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6447.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6446.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6450.123>,shutdown}]}, {links,[#Port<0.891323>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1499}], []]}} [Mon, 04 Oct 2010 15:46:13 GMT] [info] [<0.6421.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll?callback=callback&jsonp=callback 500 [Mon, 04 Oct 2010 15:46:17 GMT] [info] [<0.6445.123>] 10.220.226.191 - - 'GET' /jsregistry/ 200 [Mon, 04 Oct 2010 15:46:26 GMT] [error] [<0.6465.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:46:27 GMT] [info] [<0.6465.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:46:27 GMT] [error] [<0.6465.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:46:27 GMT] [info] [<0.6465.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:46:27 GMT] [info] [<0.6465.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/yeti 500 [Mon, 04 Oct 2010 15:46:27 GMT] [error] [<0.6473.123>] ** Generic server <0.6473.123> terminating ** Last message in was {'EXIT',<0.6476.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6474.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6474.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6474.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6476.123>,nil,false, [{{<0.6470.123>,#Ref<0.0.272.238376>},2195}], <0.6477.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:27 GMT] [error] [<0.6473.123>] {error_report,<0.31.0>, {<0.6473.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6473.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6474.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:46:27 GMT] [error] [<0.6474.123>] ** Generic server <0.6474.123> terminating ** Last message in was {'EXIT',<0.6473.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891390>,636}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:27 GMT] [error] [<0.6474.123>] {error_report,<0.31.0>, {<0.6474.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6474.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6473.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891390>,<0.6477.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1498}], [{neighbour, [{pid,<0.6477.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6473.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.238375>,process,<0.6473.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6474.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:46:27 GMT] [info] [<0.6470.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:46:32 GMT] [error] [<0.6470.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:46:32 GMT] [info] [<0.6470.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:46:33 GMT] [error] [<0.6470.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:46:33 GMT] [info] [<0.6470.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:46:33 GMT] [info] [<0.6470.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/favicon.ico 500 [Mon, 04 Oct 2010 15:46:46 GMT] [error] [<0.6502.123>] ** Generic server <0.6502.123> terminating ** Last message in was {'EXIT',<0.6505.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6503.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6503.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6503.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6505.123>,nil,false, [{{<0.6472.123>,#Ref<0.0.272.238713>},2195}], <0.6506.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:46 GMT] [error] [<0.6502.123>] {error_report,<0.31.0>, {<0.6502.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6502.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6503.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:46:46 GMT] [error] [<0.6503.123>] ** Generic server <0.6503.123> terminating ** Last message in was {'EXIT',<0.6502.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891393>,636}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:46:46 GMT] [error] [<0.6503.123>] {error_report,<0.31.0>, {<0.6503.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6503.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6502.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6506.123>,shutdown}]}, {links,[#Port<0.891393>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1499}], []]}} [Mon, 04 Oct 2010 15:46:46 GMT] [info] [<0.6472.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll?callback=callback&jsonp=callback 500 [Mon, 04 Oct 2010 15:47:04 GMT] [error] [<0.6529.123>] ** Generic server <0.6529.123> terminating ** Last message in was {'EXIT',<0.6532.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6530.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6530.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6530.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6532.123>,nil,false, [{{<0.6528.123>,#Ref<0.0.272.239174>},2195}, {{<0.6501.123>,#Ref<0.0.272.238989>},2195}], <0.6533.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:47:04 GMT] [error] [<0.6529.123>] {error_report,<0.31.0>, {<0.6529.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6529.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6530.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,526}], []]}} [Mon, 04 Oct 2010 15:47:04 GMT] [error] [<0.6530.123>] ** Generic server <0.6530.123> terminating ** Last message in was {'EXIT',<0.6529.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891401>,633}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:47:04 GMT] [error] [<0.6530.123>] {error_report,<0.31.0>, {<0.6530.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6530.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6529.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[{'EXIT',<0.6533.123>,shutdown}]}, {links,[#Port<0.891401>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1495}], []]}} [Mon, 04 Oct 2010 15:47:04 GMT] [info] [<0.6528.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:47:04 GMT] [info] [<0.6501.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:47:10 GMT] [error] [<0.6528.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:47:10 GMT] [info] [<0.6528.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:47:10 GMT] [error] [<0.6528.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:47:10 GMT] [info] [<0.6528.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:47:10 GMT] [info] [<0.6528.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/favicon.ico 500 [Mon, 04 Oct 2010 15:47:39 GMT] [error] [<0.6539.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:47:39 GMT] [info] [<0.6539.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:47:39 GMT] [error] [<0.6539.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:47:39 GMT] [info] [<0.6539.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:47:39 GMT] [info] [<0.6539.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/npm 500 [Mon, 04 Oct 2010 15:48:01 GMT] [error] [<0.6598.123>] ** Generic server <0.6598.123> terminating ** Last message in was {'EXIT',<0.6601.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6599.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6599.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6599.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6601.123>,nil,false, [{{<0.6573.123>,#Ref<0.0.272.239529>},2195}], <0.6602.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:48:01 GMT] [error] [<0.6598.123>] {error_report,<0.31.0>, {<0.6598.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6598.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6599.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,514}], []]}} [Mon, 04 Oct 2010 15:48:01 GMT] [error] [<0.6599.123>] ** Generic server <0.6599.123> terminating ** Last message in was {'EXIT',<0.6598.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891407>,594}}, 0,51} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:48:01 GMT] [error] [<0.6599.123>] {error_report,<0.31.0>, {<0.6599.123>,crash_report, [[{initial_call,{couch_file,init,['Argument__1']}}, {pid,<0.6599.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [<0.6598.123>,couch_view,couch_secondary_services,couch_server_sup, <0.32.0>]}, {messages,[]}, {links,[#Port<0.891407>,<0.6602.123>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,610}, {stack_size,24}, {reductions,1494}], [{neighbour, [{pid,<0.6602.123>}, {registered_name,[]}, {initial_call,{couch_ref_counter,init,['Argument__1']}}, {current_function,{gen_server,loop,6}}, {ancestors, [<0.6598.123>,couch_view,couch_secondary_services, couch_server_sup,<0.32.0>]}, {messages, [{'DOWN',#Ref<0.0.272.239528>,process,<0.6598.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}}]}, {links,[<0.6599.123>]}, {dictionary,[]}, {trap_exit,false}, {status,runnable}, {heap_size,233}, {stack_size,9}, {reductions,47}]}]]}} [Mon, 04 Oct 2010 15:48:01 GMT] [info] [<0.6573.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_list/index/listAll 500 [Mon, 04 Oct 2010 15:48:08 GMT] [error] [<0.6573.123>] Uncaught error in HTTP request: {exit, {timeout, {gen_server,call, [couch_query_servers, {get_proc, {doc,<<"_design/app">>, {113, [<<235,136,94,84,243,165,43,208,7,157, 152,27,208,116,0,177>>, <<"g��M%6��008vU">>, <<139,170,178,148,23,208,24,210,95,197, 52,98,80,229,155,107>>, <<0,39,64,171,66,51,253,17,196,42,143, 5,252,188,238,219>>, <<40,24,123,115,146,2,177,136,208,68, 185,253,73,196,217,248>>, <<74,196,205,188,174,143,86,188,252, 120,230,36,125,90,97,65>>, <<23,54,51,39,185,255,196,111,195,72, 142,175,10,127,1,160>>, <<205,245,118,96,185,151,7,231,130,55, 182,77,142,37,2,204>>, <<162,157,201,18,199,67,42,139,214,47, 211,208,139,195,89,225>>, <<235,177,224,128,74,75,61,65,114,199, 47,43,100,155,250,88>>, <<26,187,81,167,242,95,179,37,83,247, 143,88,96,1,58,25>>, <<56,220,132,119,46,182,79,7,166,13,22, 5,70,201,41,171>>, <<199,17,39,103,169,98,179,180,147,250, 60,9,75,230,81,14>>, <<89,13,94,109,223,102,118,190,58,226, 0,64,199,246,129,87>>, <<152,39,229,223,225,134,129,196,194, 122,52,39,181,77,12,126>>, <<22,68,225,161,128,171,250,60,241,160, 104,238,107,226,168,15>>, <<93,32,63,113,110,164,115,165,160,150, 59,6,253,177,218,81>>, <<246,222,16,162,81,117,42,146,250,141, 28,111,37,156,5,207>>, <<187,167,189,48,70,242,206,62,164,212, 49,203,173,95,176,155>>, <<251,157,247,115,167,77,205,77,175,64, 62,179,255,4,139,94>>, <<16,127,185,53,211,205,137,145,108,68, 178,41,10,175,250,252>>, <<100,6,58,170,8,230,167,116,98,185,78, 198,169,32,131,7>>, <<4,84,43,223,106,126,168,19,44,252, 233,250,0,31,215,193>>, <<13,83,73,159,49,245,155,150,209,118, 110,225,207,26,195,39>>, <<177,123,70,21,248,127,156,36,31,229, 205,244,16,224,56,218>>, <<69,195,74,241,179,48,234,201,37,190, 128,30,136,25,90,92>>, <<126,138,136,172,253,56,179,237,101, 151,197,7,84,153,73,227>>, <<67,22,107,142,166,107,162,48,51,44, 48,208,82,16,198,201>>, <<221,165,39,50,94,12,240,7,111,218,5, 149,133,187,106,77>>, <<212,221,81,176,208,147,93,161,76,123, 53,192,174,52,163,233>>, <<105,217,191,29,142,2,125,183,179,139, 31,139,224,208,78,21>>, <<160,113,59,147,165,38,65,13,133,83, 249,22,6,208,54,171>>, <<149,207,173,43,250,115,183,134,189, 78,223,9,33,117,133,6>>, <<187,196,251,254,163,161,71,158,47,82, 249,180,148,226,200,16>>, <<168,79,249,47,187,52,109,147,56,194, 255,54,193,104,246,86>>, <<30,162,241,218,116,137,105,119,7,12, 77,174,39,101,25,224>>, <<75,244,126,56,72,233,249,145,198,157, 127,53,78,226,28,131>>, <<94,156,228,19,97,17,180,93,146,209, 234,156,63,248,229,160>>, <<49,157,218,119,201,176,26,52,86,114, 19,3,124,251,62,147>>, <<163,15,153,134,180,214,194,98,94,124, 247,100,61,139,83,203>>, <<"�]\t7g��p�wl-�@��">>, <<249,80,144,243,56,63,114,153,223,226, 102,82,73,127,165,71>>, <<53,211,79,225,53,51,21,243,147,67,77, 200,251,234,172,29>>, <<221,32,78,84,196,227,210,211,110,120, 241,24,54,168,104,124>>, <<117,51,187,87,89,78,213,250,30,30,6, 39,25,175,23,130>>, <<217,224,24,173,166,85,2,86,73,157,29, 103,212,175,218,13>>, <<206,144,128,48,251,37,203,119,43,135, 136,46,238,255,16,8>>, <<145,152,108,56,201,129,133,96,203,89, 244,227,96,210,24,43>>, <<108,30,95,149,84,45,132,130,72,215, 234,247,67,109,2,177>>, <<93,66,152,11,205,196,173,47,254,49, 90,155,128,141,128,128>>, <<57,83,222,162,218,7,33,54,110,117,99, 203,116,179,180,61>>, <<159,186,185,17,35,47,28,177,209,59, 245,114,169,125,223,79>>, <<78,237,159,27,138,81,101,3,210,178, 123,238,13,230,152,135>>, <<81,8,159,117,231,200,95,174,170,123, 20,120,174,86,79,8>>, <<81,113,85,126,19,73,218,163,192,118, 105,180,60,193,245,42>>, <<58,111,212,175,182,129,200,56,170, 194,163,57,246,32,196,252>>, <<28,148,200,34,145,177,46,62,183,15, 125,116,14,205,125,187>>, <<255,87,13,235,230,253,140,186,25,85, 142,74,176,29,117,28>>, <<227,164,24,95,231,76,173,107,42,162, 13,190,201,173,254,213>>, <<134,71,94,232,137,212,204,29,12,209, 98,195,167,213,54,46>>, <<235,94,211,0,198,116,95,97,170,21, 169,0,231,197,219,18>>, <<231,4,116,196,78,214,180,65,215,82,5, 174,159,111,173,57>>, <<150,54,51,97,107,188,210,15,185,78, 241,193,61,140,62,137>>, <<30,212,102,32,24,146,235,87,245,39, 102,30,96,45,242,117>>, <<249,225,213,159,10,121,20,143,48,248, 94,45,61,68,105,89>>, <<119,45,160,73,60,180,20,33,50,186,1, 163,218,214,93,150>>, <<75,117,155,207,237,215,203,165,175, 248,202,144,97,191,98,82>>, <<219,9,152,194,9,104,71,138,75,47,171, 24,50,162,117,38>>, <<95,212,50,63,157,203,12,151,125,163, 138,32,146,65,119,234>>, <<11,133,240,170,227,12,160,84,202,180, 19,81,192,117,66,250>>, <<28,40,91,158,234,161,151,218,111,185, 78,208,10,194,66,85>>, <<108,0,173,97,156,106,158,136,39,23, 155,21,17,210,230,188>>, <<72,122,116,40,154,63,202,157,234,172, 104,131,39,232,218,173>>, <<141,154,48,190,252,189,124,179,210, 44,189,126,73,202,17,223>>, <<223,178,218,203,222,27,36,137,40,151, 81,24,198,238,20,15>>, <<241,157,7,154,245,181,194,65,36,211, 149,199,45,176,51,144>>, <<115,194,121,107,202,91,32,195,109, 124,150,185,82,101,183,8>>, <<222,57,171,252,69,218,244,217,129,55, 80,182,252,66,0,125>>, <<252,42,221,148,43,78,186,118,15,88, 191,202,118,79,85,113>>, <<11,191,27,88,165,236,246,234,98,133, 7,24,211,140,27,89>>, <<196,196,6,205,99,119,246,26,125,10, 36,23,41,0,193,177>>, <<174,82,238,234,115,225,86,170,150,58, 247,25,8,75,226,117>>, <<218,69,240,126,111,169,172,183,96, 159,226,138,199,202,202,143>>, <<70,233,29,121,214,29,229,8,42,129, 210,50,107,178,243,110>>, <<240,249,49,178,48,127,21,158,3,208, 14,138,178,135,139,42>>, <<196,89,21,59,226,233,200,18,123,19, 191,200,119,230,3,218>>, <<166,89,10,80,114,56,218,151,88,32,23, 51,250,192,107,4>>, <<47,30,141,51,39,70,170,130,111,131, 121,240,218,26,100,242>>, <<10,155,219,189,14,251,131,181,27,129, 149,50,38,12,77,88>>, <<170,167,139,95,39,69,120,98,101,84, 180,134,243,156,24,165>>, <<143,9,236,252,34,235,32,15,183,39, 187,238,69,52,159,177>>, <<95,208,224,231,3,254,219,28,102,120, 217,144,229,204,3,7>>, <<184,235,19,149,64,144,143,102,219, 209,76,192,105,64,251,122>>, <<38,117,121,143,37,7,238,153,164,201, 111,174,11,180,197,253>>, <<141,58,111,231,126,108,194,7,157,198, 43,186,202,217,174,183>>, <<156,96,172,41,142,210,83,211,243,183, 211,95,101,62,48,253>>, <<5,103,33,169,244,55,77,7,188,1,237, 43,48,147,179,147>>, <<219,40,65,70,217,189,107,130,34,120, 152,106,77,150,130,30>>, <<130,71,123,80,247,1,82,143,146,72, 151,98,123,15,245,80>>, <<113,216,190,92,152,179,144,199,13, 244,56,160,183,189,185,127>>, <<245,132,251,99,241,225,53,233,118, 240,213,18,122,156,17,157>>, <<126,82,217,236,151,63,230,81,126,14, 98,68,18,222,127,149>>, <<178,247,91,33,156,96,16,62,37,235, 199,47,34,159,194,106>>, <<230,37,11,222,157,237,250,105,71,61, 85,229,186,48,102,40>>, <<218,42,218,149,241,91,109,68,1,185, 180,36,65,189,143,65>>, <<243,43,213,71,251,108,199,4,163,62, 247,226,70,125,35,135>>, <<158,45,74,98,15,147,250,65,32,43,63, 9,172,56,64,51>>, <<128,179,23,212,212,94,164,18,110,240, 76,154,105,92,50,48>>, <<"t�ETzx3�\"��t�l��">>, <<66,221,104,147,237,247,50,160,186, 147,3,38,89,159,197,4>>, <<200,176,250,225,168,2,198,227,3,134, 168,229,87,80,124,220>>, <<38,248,111,170,123,50,205,50,194,151, 116,171,173,222,34,111>>, <<194,121,239,105,203,79,216,107,155, 120,182,142,231,218,210,137>>]}, {[{<<"shows">>, {[{<<"package">>, <<"function (doc, req) {\n var code = 200\n , headers = {\"Content-Type\":\"application/json\"}\n , body = null\n if (req.query.version) {\n if (isNaN(parseInt(req.query.version[0]))) {\n body = doc.versions[doc['dist-tags'][req.query.version]]\n } else {\n body = doc.versions[req.query.version]\n }\n if (!body) {\n code = 404\n body = {\"error\" : \"version not found: \"+req.query.version}\n }\n } else {\n body = doc\n delete body._revisions\n delete body._attachments\n }\n body = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(body) + \")\"\n : toJSON(body)\n return {\n code : code,\n body : body,\n headers : headers,\n }\n}">>}]}}, {<<"updates">>, {[{<<"package">>, <<"function (doc, req) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n function toISOString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}\n var now = toISOString(new Date())\n function error (reason) {\n return [{forbidden:reason}, JSON.stringify({forbidden:reason})]\n }\n\n if (doc) {\n if (req.query.version) {\n var parsed = semver(req.query.version)\n if (!parsed) {\n // it's a tag.\n var tag = req.query.version\n parsed = semver(JSON.parse(req.body))\n if (!parsed) {\n return error(\n \"setting tag \"+req.query.version+\n \" to invalid version: \"+req.body)\n }\n doc[\"dist-tags\"][req.query.version] = JSON.parse(req.body)\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated tag\"})]\n }\n // adding a new version.\n if (req.query.version in doc.versions) {\n // attempting to overwrite an existing version.\n // not supported at this time.\n return error(\"cannot modify existing version\")\n }\n var body = JSON.parse(req.body)\n // for (var i in body) if (typeof body[i] === \"string\") {\n // doc[i] = body[i]\n // }\n if (body.description) doc.description = body.description\n if (body.author) doc.author = body.author\n if (body.repository) doc.repository = body.repository\n body.ctime = body.mtime = doc.mtime = now\n doc[\"dist-tags\"].latest = body.version\n doc.versions[req.query.version] = body\n return [doc, JSON.stringify({ok:\"added version\"})]\n }\n\n // update the package info\n var newdoc = JSON.parse(req.body)\n , changed = false\n if (doc._rev && doc._rev !== newdoc._rev) {\n return error( \"must supply latest _rev to update existing package\" )\n }\n for (var i in newdoc) if (typeof newdoc[i] === \"string\" || i === \"maintainers\") {\n doc[i] = newdoc[i]\n }\n if (newdoc.versions) {\n doc.versions = newdoc.versions\n doc[\"dist-tags\"] = newdoc[\"dist-tags\"]\n }\n doc.mtime = now\n return [doc, JSON.stringify({ok:\"updated package metadata\"})]\n } else {\n // Create new package doc\n doc = JSON.parse(req.body)\n if (!doc.versions) doc.versions = {}\n var latest\n for (var v in doc.versions) {\n doc.versions[v].ctime = doc.versions[v].mtime = now\n latest = v\n }\n if (latest) doc[\"dist-tags\"].latest = latest\n if (!doc['dist-tags']) doc['dist-tags'] = {}\n doc.ctime = doc.mtime = now\n return [doc, JSON.stringify({ok:\"created new entry\"})]\n }\n}">>}]}}, {<<"views">>, {[{<<"listAll">>, {[{<<"map">>, <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>}]}}]}}, {<<"lists">>, {[{<<"index">>, <<"function (head, req) {\n var row\n , out = {}\n while (row = getRow()) {\n var p = out[row.id] = {}\n for (var i in row.value) {\n if (i === \"versions\"\n || i.charAt(0) === \"_\"\n || i === \"ctime\"\n ) continue\n p[i] = row.value[i]\n }\n p.versions = {}\n if (row.repository) p.repository = row.repository\n if (row.description) p.description = row.description\n for (var i in row.value.versions) {\n if (row.value.versions[i].repository && !row.repository) {\n p.repository = row.value.versions[i].repository\n }\n if (row.value.versions[i].description && !row.description) {\n p.description = row.value.versions[i].description\n }\n p.versions[i] = \"http://\"+req.headers.Host+\"/\"+row.value.name+\"/\"+i\n }\n p.url = \"http://\"+req.headers.Host+\"/\"+encodeURIComponent(row.value.name)+\"/\"\n }\n out = req.query.jsonp\n ? req.query.jsonp + \"(\" + JSON.stringify(out) + \")\"\n : toJSON(out)\n\n send(out)\n}">>}]}}, {<<"rewrites">>, [{[{<<"from">>,<<"/">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/all">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/all/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/-/jsonp/:jsonp">>}, {<<"to">>, <<"_list/index/listAll">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/adduser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/adduser/:user/-rev/:rev">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/getuser/:user">>}, {<<"to">>, <<"../../../_users/:user">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/jsonp/:jsonp">>}, {<<"to">>, <<"/_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/:version/-/jsonp/:jsonp">>}, {<<"to">>, <<"_show/package/:pkg">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>,<<"/:pkg/-/:att">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"GET">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>, <<"/:pkg/-/:att/-rev/:rev">>}, {<<"to">>,<<"../../:pkg/:att">>}, {<<"method">>,<<"DELETE">>}]}, {[{<<"from">>,<<"/:pkg">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>, <<"/_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/:version">>}, {<<"to">>, <<"_update/package/:pkg">>}, {<<"method">>,<<"PUT">>}]}, {[{<<"from">>,<<"/:pkg/-rev/:rev">>}, {<<"to">>,<<"../../:pkg">>}, {<<"method">>,<<"DELETE">>}]}]}, {<<"validate_doc_update">>, <<"function (newDoc, oldDoc, user) {\n var semver = /v?([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-zA-Z-][a-zA-Z0-9-]*)?/\n\n function assert (ok, message) {\n if (!ok) throw {forbidden:message}\n }\n \n // if the newDoc is an {error:\"blerg\"}, then throw that right out.\n // something detected in the _updates/package script.\n if (newDoc.forbidden) throw {forbidden:newDoc.forbidden || newDoc.error}\n\n function validUser () {\n if ( !oldDoc || !oldDoc.maintainers ) return true\n if (isAdmin()) return true\n if (typeof oldDoc.maintainers !== \"object\") return true\n for (var i = 0, l = oldDoc.maintainers.length; i < l; i ++) {\n if (oldDoc.maintainers[i].name === user.name) return true\n }\n return false\n }\n function isAdmin () { return user.roles.indexOf(\"_admin\") >= 0 }\n\n if (!validUser()) {\n throw {forbidden:\"user: \" + user.name + \" not authorized to modify \"\n + newDoc.name }\n }\n if (newDoc._deleted) return true\n\n if (oldDoc && oldDoc.maintainers && !newDoc.maintainers) {\n throw {forbidden: \"Please upgrade your package manager program\"}\n }\n \n // make sure all the dist-tags and versions are valid semver\n assert(newDoc[\"dist-tags\"], \"must have dist-tags\")\n assert(newDoc.versions, \"must have versions\")\n\n for (var i in newDoc[\"dist-tags\"]) {\n assert(semver(newDoc[\"dist-tags\"][i]),\n \"dist-tag \"+i+\" is not a valid version: \"+newDoc[\"dist-tags\"][i])\n assert(newDoc[\"dist-tags\"][i] in newDoc.versions,\n \"dist-tag \"+i+\" refers to non-existent version: \"+newDoc[\"dist-tags\"][i])\n }\n for (var i in newDoc.versions) {\n assert(semver(i),\n \"version \"+i+\" is not a valid version\")\n }\n}">>}]}, [],false,[]}, {<<"_design/app">>, <<"113-eb885e54f3a52bd0079d981bd07400b1">>}}]}}} [Mon, 04 Oct 2010 15:48:08 GMT] [info] [<0.6573.123>] Stacktrace: [{gen_server,call,2}, {couch_query_servers,get_ddoc_process,2}, {couch_query_servers,with_ddoc_proc,2}, {couch_httpd_show,'-handle_doc_show/6-fun-0-',7}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}, {couch_httpd,handle_request_int,5}] [Mon, 04 Oct 2010 15:48:08 GMT] [error] [<0.6573.123>] Uncaught error in HTTP request: {exit,{ucs,{bad_utf8_character_code}}} [Mon, 04 Oct 2010 15:48:08 GMT] [info] [<0.6573.123>] Stacktrace: [{xmerl_ucs,from_utf8,1}, {mochijson2,json_encode_string,2}, {mochijson2,'-json_encode_proplist/2-fun-0-',3}, {lists,foldl,3}, {mochijson2,json_encode_proplist,2}, {couch_httpd,send_json,4}, {couch_httpd,handle_request_int,5}, {couch_httpd_db,do_db_req,2}] [Mon, 04 Oct 2010 15:48:08 GMT] [info] [<0.6573.123>] 10.220.226.191 - - 'GET' /jsregistry/_design/app/_rewrite/favicon.ico 500 [Mon, 04 Oct 2010 15:48:10 GMT] [error] [<0.6616.123>] ** Generic server <0.6616.123> terminating ** Last message in was {'EXIT',<0.6619.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {group_state,undefined,<<"jsregistry">>, {"/home/ubuntu/hosting-couchio/servers/isaacs/db/view_index_dir", <<"jsregistry">>, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223, 223,139>>, nil,nil,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, nil,[],[]}], nil,0,0,nil,nil}}, {group, <<7,87,142,180,63,238,57,47,189,15,122,38,76,223,223, 139>>, {db,<0.30975.120>,<0.30976.120>,nil, <<"1286149211964274">>,<0.18000.121>,<0.18002.121>, {db_header,5,2195,0, {466311091,{434,39}}, {466195033,473}, {466313318,[]}, 0,nil,nil,1000}, 2195, {btree,<0.18000.121>, {466311091,{434,39}}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466195033,473}, #Fun, #Fun, #Fun, #Fun}, {btree,<0.18000.121>, {466313318,[]}, #Fun, #Fun, #Fun,nil}, 2195,<<"jsregistry">>, "/home/ubuntu/hosting-couchio/servers/isaacs/db/database_dir/jsregistry.couch", [],[],nil, {user_ctx,null,[],undefined}, nil,1000, [before_header,after_header,on_file_open], false}, <0.6617.123>,<<"_design/app">>,<<"javascript">>,[], [{view,0, [<<"listAll">>], <<"function (doc) {\n for (var i in doc.versions) return emit(doc.id, {})\n }">>, {btree,<0.6617.123>,nil, #Fun, #Fun, #Fun, #Fun}, [],[]}], {btree,<0.6617.123>,nil, #Fun, #Fun, #Fun,nil}, 0,0,nil,nil}, <0.6619.123>,nil,false, [{{<0.6615.123>,#Ref<0.0.272.239977>},2195}, {{<0.6597.123>,#Ref<0.0.272.239788>},2195}], <0.6620.123>} ** Reason for termination == ** {timeout,{gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}} [Mon, 04 Oct 2010 15:48:10 GMT] [error] [<0.6616.123>] {error_report,<0.31.0>, {<0.6616.123>,crash_report, [[{initial_call,{couch_view_group,init,['Argument__1']}}, {pid,<0.6616.123>}, {registered_name,[]}, {error_info, {exit, {timeout, {gen_server,call, [couch_query_servers,{get_proc,<<"javascript">>}]}}, [{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_view,couch_secondary_services,couch_server_sup,<0.32.0>]}, {messages,[]}, {links,[<0.6617.123>,<0.30901.120>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_size,1597}, {stack_size,24}, {reductions,526}], []]}} [Mon, 04 Oct 2010 15:48:10 GMT] [error] [<0.6617.123>] ** Generic server <0.6617.123> terminating ** Last message in was {'EXIT',<0.6616.123>, {timeout, {gen_server,call, [couch_query_servers, {get_proc,<<"javascript">>}]}}} ** When Server state == {file, {file_descriptor,prim_file,{#Port<0.891444>,631}}, 0,51} ** Re