-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[chttpd_auth_lockout] max_lifetime = -1 always makes the Elixir integration tests fail #5520
-
I am trying to run Elixir integration tests by setting [chttpd_auth_lockout] max_lifetime = -1
in local.ini file. But everytime it fails.
My question -
- Is this expected behavior of CouchDB?
- Or, this is a bug because
max_lifetime
is related to locking out the database, which should not affect starting the database.
Steps:
- Install required dependencies for CouchDB
- Erlang OTP 27.2
- Elixir 1.18.1
- Node 18
- libicu-dev libssl-dev libmozjs-91-dev build-essential pkg-config python3 python3-venv openjdk-11-jdk erlang-reltool
- Build CouchDB 3.4.2 from source till
make release
- Run Elixir integration test:
make elixir
When I run make elixir
, it always fails to start the node and gives the following error in the terminal -
* creating /home/userme/.mix/elixir/1-18/rebar3
* creating /home/userme/.mix/archives/hex-2.1.1
Resolving Hex dependencies...
Resolution completed in 0.024s
Unchanged:
bunt 1.0.0
credo 1.7.11
excoveralls 0.18.3
file_system 1.1.0
[33m httpotion 3.2.0 RETIRED![0m
[33m (deprecated) Not really maintained, please check out Tesla [0m
jason 1.4.4
junit_formatter 3.4.0
ssl_verify_fun 1.1.7
Failed to start all the nodes. Check the dev/logs/*.log for errors.
make: *** [Makefile:260: elixir] Error 1
The dev/logs/node1.log file contains -
[error] 2025年04月28日T04:38:35.205700Z node1@127.0.0.1 <0.249.0> -------- CRASH REPORT Process (<0.249.0>) with 0 neighbors exited with reason: bad return value {invalid_option,{max_lifetime,-1}} at gen_server:init_it/6(line:2222) <= proc_lib:init_p_do_apply/3(line:329); initial_call: {ets_lru,init,['Argument__1']}, process_label: undefined, ancestors: [couch_primary_services,couch_sup,<0.240.0>], message_queue_len: 0, links: [<0.243.0>], dictionary: [], trap_exit: false, status: running, heap_size: 233, stack_size: 29, reductions: 52
[error] 2025年04月28日T04:38:35.205784Z node1@127.0.0.1 <0.249.0> -------- CRASH REPORT Process (<0.249.0>) with 0 neighbors exited with reason: bad return value {invalid_option,{max_lifetime,-1}} at gen_server:init_it/6(line:2222) <= proc_lib:init_p_do_apply/3(line:329); initial_call: {ets_lru,init,['Argument__1']}, process_label: undefined, ancestors: [couch_primary_services,couch_sup,<0.240.0>], message_queue_len: 0, links: [<0.243.0>], dictionary: [], trap_exit: false, status: running, heap_size: 233, stack_size: 29, reductions: 52
[error] 2025年04月28日T04:38:35.206083Z node1@127.0.0.1 <0.240.0> -------- Error starting Apache CouchDB:
{error,{shutdown,{failed_to_start_child,couch_primary_services,{shutdown,{failed_to_start_child,couch_lockout_lru,{bad_return_value,{invalid_option,{max_lifetime,-1}}}}}}}}
Runtime terminating during boot (terminating)
[error] 2025年04月28日T04:38:35.209252Z node1@127.0.0.1 <0.243.0> -------- Supervisor couch_primary_services had child couch_lockout_lru started with ets_lru:start_link(couch_lockout_lru, [{max_objects,10000},{max_lifetime,-1}]) at undefined exit with reason bad return value {invalid_option,{max_lifetime,-1}} in context start_error
Crash dump is being written to: erl_crash.dump...done
The documentation of [chttpd_auth_lockout] max_lifetime says the following -
The maximum duration of the lockout period, measured in milliseconds. Changes to this setting are only picked up at CouchDB start or restart time.
Beta Was this translation helpful? Give feedback.
All reactions
Hi,
as Jay correctly outlined, max_lifetime
needs to be a non-negative integer value or undefined!
max_lifetime :: non_neg_integer() | undefined,
What do you want to achieve with a setting of -1
?
Replies: 2 comments 3 replies
-
Hi,
The reason for the failure is explicit in the error message:
{bad_return_value,{invalid_option,{max_lifetime,-1}
So the value -1
is not a valid option.
Have you tried any other values?
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, I have tried other non-negative values. And they work correctly.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi,
as Jay correctly outlined, max_lifetime
needs to be a non-negative integer value or undefined!
max_lifetime :: non_neg_integer() | undefined,
What do you want to achieve with a setting of -1
?
Beta Was this translation helpful? Give feedback.
All reactions
-
I was trying to run integration tests with different max_lifetime values to check whether they work or not.
Beta Was this translation helpful? Give feedback.
All reactions
-
and now you know :)
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1