y-scope/clp

CLP package can't be started by root user

Closed this issue · 0 comments

Bug

When running as root, the clp-package fails to start. sbin/start-clp.sh prints the following log:

Traceback (most recent call last):
  File "/home/local/tmp/clp-text-ubuntu-focal-x86_64-v0.1.1/lib/python3/site-packages/clp_package_utils/scripts/start_clp.py", line 943, in main
    start_queue(instance_id, clp_config)
  File "/home/local/tmp/clp-text-ubuntu-focal-x86_64-v0.1.1/lib/python3/site-packages/clp_package_utils/scripts/start_clp.py", line 295, in start_queue
    raise EnvironmentError(f"{component_name} did not initialize in time")
OSError: queue did not initialize in time

Checking the queue container's logs shows:

2024-07-29 04:11:47.440453+00:00 [erro] <0.145.0> Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>     supervisor: {local,net_sup}
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>     errorContext: start_error
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>     reason: {"Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces",
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>              [{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>               {auth,init,1,[{file,"auth.erl"},{line,144}]},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>               {gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>               {gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>               {proc_lib,init_p_do_apply,3,
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                         [{file,"proc_lib.erl"},{line,226}]}]}
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>     offender: [{pid,undefined},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {id,auth},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {mfargs,{auth,start_link,[]}},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {restart_type,permanent},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {significant,false},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {shutdown,2000},
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>                {child_type,worker}]
2024-07-29 04:11:47.453762+00:00 [erro] <0.143.0>
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>   crasher:
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     initial call: auth:init/1
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     pid: <0.145.0>
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     registered_name: []
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     exception error: "Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces"
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>       in function  auth:init_no_setcookie/0 (auth.erl, line 293)
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>       in call from auth:init/1 (auth.erl, line 144)
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>       in call from gen_server:init_it/2 (gen_server.erl, line 423)
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>       in call from gen_server:init_it/6 (gen_server.erl, line 390)
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     ancestors: [net_sup,kernel_sup,<0.47.0>]
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     message_queue_len: 0
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     messages: []
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     links: [<0.143.0>]
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     dictionary: []
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     trap_exit: true
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     status: running
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     heap_size: 987
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     stack_size: 29
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>     reductions: 2078
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>   neighbours:
2024-07-29 04:11:47.453885+00:00 [erro] <0.145.0>

BOOT FAILED
...

A similar issue was reported in #135.

CLP version

0.1.1

Environment

  • OS: Ubuntu 22.04
  • Docker: 24.0.6

Reproduction steps

As root, run:

curl -fsSLO https://github.com/y-scope/clp/releases/download/v0.1.1/clp-text-ubuntu-focal-x86_64-v0.1.1.tar.gz
tar xzf clp-text-ubuntu-focal-x86_64-v0.1.1.tar.gz
cd clp-text-ubuntu-focal-x86_64-v0.1.1
sbin/start-clp.sh