You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/10/31 18:44:37 UTC

[GitHub] [couchdb] paulbert opened a new issue #2291: Can set couch_peruser.database_prefix with illegal characters

paulbert opened a new issue #2291: Can set couch_peruser.database_prefix with illegal characters
URL: https://github.com/apache/couchdb/issues/2291
 
 
   ## Description
   
   When using couch_peruser it is allowed to set database_prefix with illegal characters for a database name.  For us this resulted in CouchDB crashing and being unable to start until we changed the configuration manually in local.ini
   
   ## Steps to Reproduce
   
   1. Set up single node CouchDB
   2. Run 
   ```
   curl -H 'Content-Type: application/json' -X PUT http://localhost:5984/_node/nonode@nohost/_config/couch_peruser/database_prefix -d '"userdb-.-"'
   curl -H 'Content-Type: application/json' -X PUT http://localhost:5984/_node/nonode@nohost/_config/couch_peruser/enable -d '"true"'
   ```
   3. CouchDB has now crashed, and will crash immediately on restart.  The error messages I saw after attempted restart were:
   ```
   Error: {error,{illegal_database_name,<<"userdb-.-">>}}
   [error] 2019-10-31T14:28:37.769379Z nonode@nohost <0.416.0> -------- CRASH REPORT Process couch_peruser (<0.416.0>) with 0 neighbors exited with reason: bad return value {error,{illegal_database_name,<<"userdb-.-">>}} at gen_server:init_it/6(line:356) <= proc_lib:init_p_do_apply/3(line:247); initial_call: {couch_peruser,init,['Argument__1']}, ancestors: [couch_peruser_sup,<0.414.0>], messages: [], links: [<0.415.0>,<0.87.0>], dictionary: [], trap_exit: false, status: running, heap_size: 1598, stack_size: 27, reductions: 1586
   [error] 2019-10-31T14:28:37.769649Z nonode@nohost <0.415.0> -------- Supervisor couch_peruser_sup had child couch_peruser started with couch_peruser:start_link() at undefined exit with reason bad return value {error,{illegal_database_name,<<"userdb-.-">>}} in context start_error
   [error] 2019-10-31T14:28:37.770164Z nonode@nohost <0.413.0> -------- CRASH REPORT Process  (<0.413.0>) with 0 neighbors exited with reason: {{shutdown,{failed_to_start_child,couch_peruser,{bad_return_value,{error,{illegal_database_name,<<"userdb-.-">>}}}}},{couch_peruser_app,start,[normal,[]]}} at application_master:init/4(line:134) <= proc_lib:init_p_do_apply/3(line:247); initial_call: {application_master,init,['Argument__1','Argument__2',...]}, ancestors: [<0.412.0>], messages: [{'EXIT',<0.414.0>,normal}], links: [<0.412.0>,<0.9.0>], dictionary: [], trap_exit: true, status: running, heap_size: 376, stack_size: 27, reductions: 105
   [info] 2019-10-31T14:28:37.770459Z nonode@nohost <0.9.0> -------- Application couch_peruser exited with reason: {{shutdown,{failed_to_start_child,couch_peruser,{bad_return_value,{error,{illegal_database_name,<<"userdb-.-">>}}}}},{couch_peruser_app,start,[normal,[]]}}
   
   ```
   
   ## Expected Behaviour
   
   Setting `couch_peruser.database_prefix` to a value with invalid database characters will throw an error.
   
   ## Your Environment
   
   * CouchDB Version used: 2.3.1
   * Operating System and version: Debain 10 (buster)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services