Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Mon, 20 Oct 2014 22:43:47 GMT] [info] [<0.102.0>] 127.0.0.1 - - GET / 200
- [Mon, 20 Oct 2014 22:43:47 GMT] [info] [<0.103.0>] 127.0.0.1 - - HEAD /_users/_all_docs 403
- [Mon, 20 Oct 2014 22:43:47 GMT] [info] [<0.31.0>] Apache CouchDB has started on http://127.0.0.1:6024/
- [Mon, 20 Oct 2014 22:43:47 GMT] [info] [<0.104.0>] 127.0.0.1 - - HEAD /_users/_all_docs 200
- [Mon, 20 Oct 2014 22:43:47 GMT] [error] [<0.148.0>] Could not open file /Users/briancleland/qwe3/data/app.couch: file already exists
- [Mon, 20 Oct 2014 22:43:47 GMT] [info] [<0.105.0>] 127.0.0.1 - - PUT /app 412
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.106.0>] 127.0.0.1 - - PUT /app/_security 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.107.0>] 127.0.0.1 - - PUT /app/config 409
- [Mon, 20 Oct 2014 22:43:48 GMT] [error] [<0.162.0>] Could not open file /Users/briancleland/qwe3/data/plugins.couch: file already exists
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.108.0>] 127.0.0.1 - - PUT /plugins 412
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.109.0>] 127.0.0.1 - - PUT /plugins/_security 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.110.0>] 127.0.0.1 - - PUT /_config/httpd/authentication_handlers 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.113.0>] 127.0.0.1 - - GET / 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.112.0>] 127.0.0.1 - - GET /plugins/_all_docs?include_docs=true 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.111.0>] 127.0.0.1 - - GET /app/config 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.115.0>] 127.0.0.1 - - GET /_users 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.114.0>] 127.0.0.1 - - GET /_db_updates?feed=longpoll&timeout=0 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.115.0>] 127.0.0.1 - - GET /plugins/ 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.117.0>] 127.0.0.1 - - GET /_users/_changes?since=1&feed=continuous&heartbeat=30000&include_docs=true 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.116.0>] 127.0.0.1 - - GET /app/ 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.119.0>] 127.0.0.1 - - GET /_db_updates?feed=continuous&heartbeat=true 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.131.0>] 127.0.0.1 - - GET /_users/_all_docs?include_docs=true 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.135.0>] 127.0.0.1 - - GET /plugins//_changes?since=2&feed=continuous&heartbeat=30000&include_docs=true 200
- [Mon, 20 Oct 2014 22:43:48 GMT] [info] [<0.147.0>] 127.0.0.1 - - GET /app//_changes?since=3&feed=continuous&heartbeat=30000 200
- [Mon, 20 Oct 2014 22:43:51 GMT] [info] [<0.160.0>] 127.0.0.1 - - GET /?hoodieId=2p2lfhr 200
- [Mon, 20 Oct 2014 22:43:51 GMT] [info] [<0.150.0>] 127.0.0.1 - - DELETE /_session 200
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.94.0>] OS Process Error <0.211.0> :: {os_process_error,
- {exit_status,133}}
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.94.0>] ** Generic server couch_query_servers terminating
- ** Last message in was {get_proc,{doc,<<"_design/_auth">>,
- {1,
- [<<117,239,204,225,240,131,49,109,98,
- 45,56,159,63,152,19,247>>]},
- {[{<<"language">>,<<"javascript">>},
- {<<"validate_doc_update">>,
- <<"\n function(newDoc, oldDoc, userCtx, secObj) {\n if (newDoc._deleted === true) {\n // allow deletes by admins and matching users\n // without checking the other fields\n if ((userCtx.roles.indexOf('_admin') !== -1) ||\n (userCtx.name == oldDoc.name)) {\n return;\n } else {\n throw({forbidden: 'Only admins may delete other user docs.'});\n }\n }\n\n if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') {\n throw({forbidden : 'doc.type must be user'});\n } // we only allow user docs for now\n\n if (!newDoc.name) {\n throw({forbidden: 'doc.name is required'});\n }\n\n if (!newDoc.roles) {\n throw({forbidden: 'doc.roles must exist'});\n }\n\n if (!isArray(newDoc.roles)) {\n throw({forbidden: 'doc.roles must be an array'});\n }\n\n for (var idx = 0; idx < newDoc.roles.length; idx++) {\n if (typeof newDoc.roles[idx] !== 'string') {\n throw({forbidden: 'doc.roles can only contain strings'});\n }\n }\n\n if (newDoc._id !== ('org.couchdb.user:' + newDoc.name)) {\n throw({\n forbidden: 'Doc ID must be of the form org.couchdb.user:name'\n });\n }\n\n if (oldDoc) { // validate all updates\n if (oldDoc.name !== newDoc.name) {\n throw({forbidden: 'Usernames can not be changed.'});\n }\n }\n\n if (newDoc.password_sha && !newDoc.salt) {\n throw({\n forbidden: 'Users with password_sha must have a salt.' +\n 'See /_utils/script/couch.js for example code.'\n });\n }\n\n if (newDoc.password_scheme === \"pbkdf2\") {\n if (typeof(newDoc.iterations) !== \"number\") {\n throw({forbidden: \"iterations must be a number.\"});\n }\n if (typeof(newDoc.derived_key) !== \"string\") {\n throw({forbidden: \"derived_key must be a string.\"});\n }\n }\n\n var is_server_or_database_admin = function(userCtx, secObj) {\n // see if the user is a server admin\n if(userCtx.roles.indexOf('_admin') !== -1) {\n return true; // a server admin\n }\n\n // see if the user a database admin specified by name\n if(secObj && secObj.admins && secObj.admins.names) {\n if(secObj.admins.names.indexOf(userCtx.name) !== -1) {\n return true; // database admin\n }\n }\n\n // see if the user a database admin specified by role\n if(secObj && secObj.admins && secObj.admins.roles) {\n var db_roles = secObj.admins.roles;\n for(var idx = 0; idx < userCtx.roles.length; idx++) {\n var user_role = userCtx.roles[idx];\n if(db_roles.indexOf(user_role) !== -1) {\n return true; // role matches!\n }\n }\n }\n\n return false; // default to no admin\n }\n\n if (!is_server_or_database_admin(userCtx, secObj)) {\n if (oldDoc) { // validate non-admin updates\n if (userCtx.name !== newDoc.name) {\n throw({\n forbidden: 'You may only update your own user document.'\n });\n }\n // validate role updates\n var oldRoles = oldDoc.roles.sort();\n var newRoles = newDoc.roles.sort();\n\n if (oldRoles.length !== newRoles.length) {\n throw({forbidden: 'Only _admin may edit roles'});\n }\n\n for (var i = 0; i < oldRoles.length; i++) {\n if (oldRoles[i] !== newRoles[i]) {\n throw({forbidden: 'Only _admin may edit roles'});\n }\n }\n } else if (newDoc.roles.length > 0) {\n throw({forbidden: 'Only _admin may set roles'});\n }\n }\n\n // no system roles in users db\n for (var i = 0; i < newDoc.roles.length; i++) {\n if (newDoc.roles[i][0] === '_') {\n throw({\n forbidden:\n 'No system roles (starting with underscore) in users db.'\n });\n }\n }\n\n // no system names as names\n if (newDoc.name[0] === '_') {\n throw({forbidden: 'Username may not start with underscore.'});\n }\n\n var badUserNameChars = [':'];\n\n for (var i = 0; i < badUserNameChars.length; i++) {\n if (newDoc.name.indexOf(badUserNameChars[i]) >= 0) {\n throw({forbidden: 'Character `' + badUserNameChars[i] +\n '` is not allowed in usernames.'});\n }\n }\n }\n">>}]},
- [],false,[]},
- {<<"_design/_auth">>,
- <<"1-75efcce1f083316d622d389f3f9813f7">>}}
- ** When Server state == {qserver,28708,36902,40999,32805,[],
- {[{<<"reduce_limit">>,true},
- {<<"timeout">>,5000}]}}
- ** Reason for termination ==
- ** {bad_return_value,{os_process_error,{exit_status,133}}}
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.94.0>] {error_report,<0.30.0>,
- {<0.94.0>,crash_report,
- [[{initial_call,
- {couch_query_servers,init,['Argument__1']}},
- {pid,<0.94.0>},
- {registered_name,couch_query_servers},
- {error_info,
- {exit,
- {bad_return_value,
- {os_process_error,{exit_status,133}}},
- [{gen_server,terminate,6,
- [{file,"gen_server.erl"},{line,737}]},
- {proc_lib,init_p_do_apply,3,
- [{file,"proc_lib.erl"},{line,237}]}]}},
- {ancestors,
- [couch_secondary_services,couch_server_sup,
- <0.31.0>]},
- {messages,
- [{'EXIT',<0.211.0>,normal},
- {'DOWN',#Ref<0.0.0.769>,process,<0.211.0>,
- normal}]},
- {links,[<0.90.0>]},
- {dictionary,[]},
- {trap_exit,true},
- {status,running},
- {heap_size,1598},
- {stack_size,27},
- {reductions,3634}],
- []]}}
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.90.0>] {error_report,<0.30.0>,
- {<0.90.0>,supervisor_report,
- [{supervisor,{local,couch_secondary_services}},
- {errorContext,child_terminated},
- {reason,
- {bad_return_value,
- {os_process_error,{exit_status,133}}}},
- {offender,
- [{pid,<0.94.0>},
- {name,query_servers},
- {mfargs,{couch_query_servers,start_link,[]}},
- {restart_type,permanent},
- {shutdown,brutal_kill},
- {child_type,worker}]}]}}
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.176.0>] Uncaught error in HTTP request: {exit,
- {{bad_return_value,
- {os_process_error,
- {exit_status,133}}},
- {gen_server,call,
- [couch_query_servers,
- {get_proc,
- {doc,
- <<"_design/_auth">>,
- {1,
- [<<117,239,204,
- 225,240,131,49,
- 109,98,45,56,
- 159,63,152,19,
- 247>>]},
- {[{<<"language">>,
- <<"javascript">>},
- {<<"validate_doc_update">>,
- <<"\n function(newDoc, oldDoc, userCtx, secObj) {\n if (newDoc._deleted === true) {\n // allow deletes by admins and matching users\n // without checking the other fields\n if ((userCtx.roles.indexOf('_admin') !== -1) ||\n (userCtx.name == oldDoc.name)) {\n return;\n } else {\n throw({forbidden: 'Only admins may delete other user docs.'});\n }\n }\n\n if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') {\n throw({forbidden : 'doc.type must be user'});\n } // we only allow user docs for now\n\n if (!newDoc.name) {\n throw({forbidden: 'doc.name is required'});\n }\n\n if (!newDoc.roles) {\n throw({forbidden: 'doc.roles must exist'});\n }\n\n if (!isArray(newDoc.roles)) {\n throw({forbidden: 'doc.roles must be an array'});\n }\n\n for (var idx = 0; idx < newDoc.roles.length; idx++) {\n if (typeof newDoc.roles[idx] !== 'string') {\n throw({forbidden: 'doc.roles can only contain strings'});\n }\n }\n\n if (newDoc._id !== ('org.couchdb.user:' + newDoc.name)) {\n throw({\n forbidden: 'Doc ID must be of the form org.couchdb.user:name'\n });\n }\n\n if (oldDoc) { // validate all updates\n if (oldDoc.name !== newDoc.name) {\n throw({forbidden: 'Usernames can not be changed.'});\n }\n }\n\n if (newDoc.password_sha && !newDoc.salt) {\n throw({\n forbidden: 'Users with password_sha must have a salt.' +\n 'See /_utils/script/couch.js for example code.'\n });\n }\n\n if (newDoc.password_scheme === \"pbkdf2\") {\n if (typeof(newDoc.iterations) !== \"number\") {\n throw({forbidden: \"iterations must be a number.\"});\n }\n if (typeof(newDoc.derived_key) !== \"string\") {\n throw({forbidden: \"derived_key must be a string.\"});\n }\n }\n\n var is_server_or_database_admin = function(userCtx, secObj) {\n // see if the user is a server admin\n if(userCtx.roles.indexOf('_admin') !== -1) {\n return true; // a server admin\n }\n\n // see if the user a database admin specified by name\n if(secObj && secObj.admins && secObj.admins.names) {\n if(secObj.admins.names.indexOf(userCtx.name) !== -1) {\n return true; // database admin\n }\n }\n\n // see if the user a database admin specified by role\n if(secObj && secObj.admins && secObj.admins.roles) {\n var db_roles = secObj.admins.roles;\n for(var idx = 0; idx < userCtx.roles.length; idx++) {\n var user_role = userCtx.roles[idx];\n if(db_roles.indexOf(user_role) !== -1) {\n return true; // role matches!\n }\n }\n }\n\n return false; // default to no admin\n }\n\n if (!is_server_or_database_admin(userCtx, secObj)) {\n if (oldDoc) { // validate non-admin updates\n if (userCtx.name !== newDoc.name) {\n throw({\n forbidden: 'You may only update your own user document.'\n });\n }\n // validate role updates\n var oldRoles = oldDoc.roles.sort();\n var newRoles = newDoc.roles.sort();\n\n if (oldRoles.length !== newRoles.length) {\n throw({forbidden: 'Only _admin may edit roles'});\n }\n\n for (var i = 0; i < oldRoles.length; i++) {\n if (oldRoles[i] !== newRoles[i]) {\n throw({forbidden: 'Only _admin may edit roles'});\n }\n }\n } else if (newDoc.roles.length > 0) {\n throw({forbidden: 'Only _admin may set roles'});\n }\n }\n\n // no system roles in users db\n for (var i = 0; i < newDoc.roles.length; i++) {\n if (newDoc.roles[i][0] === '_') {\n throw({\n forbidden:\n 'No system roles (starting with underscore) in users db.'\n });\n }\n }\n\n // no system names as names\n if (newDoc.name[0] === '_') {\n throw({forbidden: 'Username may not start with underscore.'});\n }\n\n var badUserNameChars = [':'];\n\n for (var i = 0; i < badUserNameChars.length; i++) {\n if (newDoc.name.indexOf(badUserNameChars[i]) >= 0) {\n throw({forbidden: 'Character `' + badUserNameChars[i] +\n '` is not allowed in usernames.'});\n }\n }\n }\n">>}]},
- [],false,[]},
- {<<"_design/_auth">>,
- <<"1-75efcce1f083316d622d389f3f9813f7">>}},
- infinity]}}}
- [Mon, 20 Oct 2014 22:44:04 GMT] [info] [<0.176.0>] Stacktrace: [{gen_server,call,3,
- [{file,"gen_server.erl"},{line,190}]},
- {couch_query_servers,get_ddoc_process,2,
- [{file,"couch_query_servers.erl"},
- {line,547}]},
- {couch_query_servers,with_ddoc_proc,2,
- [{file,"couch_query_servers.erl"},
- {line,268}]},
- {couch_query_servers,validate_doc_update,5,
- [{file,"couch_query_servers.erl"},
- {line,227}]},
- {couch_db,
- '-validate_doc_update/3-lc$^0/1-0-',5,
- [{file,"couch_db.erl"},{line,473}]},
- {couch_db,validate_doc_update,3,
- [{file,"couch_db.erl"},{line,473}]},
- {couch_db,
- '-prep_and_validate_updates/6-fun-1-',3,
- [{file,"couch_db.erl"},{line,532}]},
- {lists,foldl,3,
- [{file,"lists.erl"},{line,1261}]}]
- [Mon, 20 Oct 2014 22:44:04 GMT] [info] [<0.176.0>] 127.0.0.1 - - PUT /_users/org.couchdb.user%3Auser%2Ftest 500
- [Mon, 20 Oct 2014 22:44:04 GMT] [error] [<0.176.0>] httpd 500 error response:
- {"error":"{bad_return_value,{os_process_error,{exit_status,133}}}","reason":"{gen_server,call,\n [couch_query_servers,\n {get_proc,{doc,<<\"_design/_auth\">>,\n {1,\n [<<117,239,204,225,240,131,49,109,98,45,56,159,\n 63,152,19,247>>]},\n {[{<<\"language\">>,<<\"javascript\">>},\n {<<\"validate_doc_update\">>,\n <<\"\\n function(newDoc, oldDoc, userCtx, secObj) {\\n if (newDoc._deleted === true) {\\n // allow deletes by admins and matching users\\n // without checking the other fields\\n if ((userCtx.roles.indexOf('_admin') !== -1) ||\\n (userCtx.name == oldDoc.name)) {\\n return;\\n } else {\\n throw({forbidden: 'Only admins may delete other user docs.'});\\n }\\n }\\n\\n if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') {\\n throw({forbidden : 'doc.type must be user'});\\n } // we only allow user docs for now\\n\\n if (!newDoc.name) {\\n throw({forbidden: 'doc.name is required'});\\n }\\n\\n if (!newDoc.roles) {\\n throw({forbidden: 'doc.roles must exist'});\\n }\\n\\n if (!isArray(newDoc.roles)) {\\n throw({forbidden: 'doc.roles must be an array'});\\n }\\n\\n for (var idx = 0; idx < newDoc.roles.length; idx++) {\\n if (typeof newDoc.roles[idx] !== 'string') {\\n throw({forbidden: 'doc.roles can only contain strings'});\\n }\\n }\\n\\n if (newDoc._id !== ('org.couchdb.user:' + newDoc.name)) {\\n throw({\\n forbidden: 'Doc ID must be of the form org.couchdb.user:name'\\n });\\n }\\n\\n if (oldDoc) { // validate all updates\\n if (oldDoc.name !== newDoc.name) {\\n throw({forbidden: 'Usernames can not be changed.'});\\n }\\n }\\n\\n if (newDoc.password_sha && !newDoc.salt) {\\n throw({\\n forbidden: 'Users with password_sha must have a salt.' +\\n 'See /_utils/script/couch.js for example code.'\\n });\\n }\\n\\n if (newDoc.password_scheme === \\\"pbkdf2\\\") {\\n if (typeof(newDoc.iterations) !== \\\"number\\\") {\\n throw({forbidden: \\\"iterations must be a number.\\\"});\\n }\\n if (typeof(newDoc.derived_key) !== \\\"string\\\") {\\n throw({forbidden: \\\"derived_key must be a string.\\\"});\\n }\\n }\\n\\n var is_server_or_database_admin = function(userCtx, secObj) {\\n // see if the user is a server admin\\n if(userCtx.roles.indexOf('_admin') !== -1) {\\n return true; // a server admin\\n }\\n\\n // see if the user a database admin specified by name\\n if(secObj && secObj.admins && secObj.admins.names) {\\n if(secObj.admins.names.indexOf(userCtx.name) !== -1) {\\n return true; // database admin\\n }\\n }\\n\\n // see if the user a database admin specified by role\\n if(secObj && secObj.admins && secObj.admins.roles) {\\n var db_roles = secObj.admins.roles;\\n for(var idx = 0; idx < userCtx.roles.length; idx++) {\\n var user_role = userCtx.roles[idx];\\n if(db_roles.indexOf(user_role) !== -1) {\\n return true; // role matches!\\n }\\n }\\n }\\n\\n return false; // default to no admin\\n }\\n\\n if (!is_server_or_database_admin(userCtx, secObj)) {\\n if (oldDoc) { // validate non-admin updates\\n if (userCtx.name !== newDoc.name) {\\n throw({\\n forbidden: 'You may only update your own user document.'\\n });\\n }\\n // validate role updates\\n var oldRoles = oldDoc.roles.sort();\\n var newRoles = newDoc.roles.sort();\\n\\n if (oldRoles.length !== newRoles.length) {\\n throw({forbidden: 'Only _admin may edit roles'});\\n }\\n\\n for (var i = 0; i < oldRoles.length; i++) {\\n if (oldRoles[i] !== newRoles[i]) {\\n throw({forbidden: 'Only _admin may edit roles'});\\n }\\n }\\n } else if (newDoc.roles.length > 0) {\\n throw({forbidden: 'Only _admin may set roles'});\\n }\\n }\\n\\n // no system roles in users db\\n for (var i = 0; i < newDoc.roles.length; i++) {\\n if (newDoc.roles[i][0] === '_') {\\n throw({\\n forbidden:\\n 'No system roles (starting with underscore) in users db.'\\n });\\n }\\n }\\n\\n // no system names as names\\n if (newDoc.name[0] === '_') {\\n throw({forbidden: 'Username may not start with underscore.'});\\n }\\n\\n var badUserNameChars = [':'];\\n\\n for (var i = 0; i < badUserNameChars.length; i++) {\\n if (newDoc.name.indexOf(badUserNameChars[i]) >= 0) {\\n throw({forbidden: 'Character `' + badUserNameChars[i] +\\n '` is not allowed in usernames.'});\\n }\\n }\\n }\\n\">>}]},\n [],false,[]},\n {<<\"_design/_auth\">>,\n <<\"1-75efcce1f083316d622d389f3f9813f7\">>}},\n infinity]}"}
- [Mon, 20 Oct 2014 22:44:08 GMT] [info] [<0.195.0>] 127.0.0.1 - - GET /?hoodieId=2p2lfhr 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement