Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[chttpd_auth_lockout] max_lifetime = -1 always makes the Elixir integration tests fail #5520

Answered by big-r81
JobayerAhmmed asked this question in Q&A
Discussion options

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 -

  1. Is this expected behavior of CouchDB?
  2. Or, this is a bug because max_lifetime is related to locking out the database, which should not affect starting the database.

Steps:

  1. 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
  2. Build CouchDB 3.4.2 from source till make release
  3. 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.

You must be logged in to vote

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

Comment options

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?

You must be logged in to vote
1 reply
Comment options

Yes, I have tried other non-negative values. And they work correctly.

Comment options

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?

You must be logged in to vote
2 replies
Comment options

I was trying to run integration tests with different max_lifetime values to check whether they work or not.

Comment options

rnewson Apr 28, 2025
Collaborator

and now you know :)

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

AltStyle によって変換されたページ (->オリジナル) /