OpenLI-NZ / openli

Open Source ETSI compliant Lawful Intercept software
GNU General Public License v3.0
87 stars 27 forks source link

Error configuring RabbitMQ and Mediator from OpenLi installation with source code #101

Closed laaurii00 closed 1 month ago

laaurii00 commented 2 months ago

I have install OpenLI project from source code. I have done the RabbitMQ configuration with:

echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install rabbitmq-server

sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server

Modify config: sudo nano /etc/rabbitmq/rabbitmq.conf
listeners.tcp.default = 127.0.0.1:5672
loopback_users.guest = false

Added user:
sudo rabbitmqctl add_vhost "OpenLI-med"
sudo rabbitmqctl add_user "openli.nz" "<secretpassword>"
sudo rabbitmqctl set_permissions -p "OpenLI-med" "openli.nz" ".*" ".*" ".*"

The mediator configuration yaml is:

operatorid: WAND
mediatorid: 1

provisioneradd: 127.0.0.1
provisionerport: 9002
listenaddr: 127.0.0.1
listenport: 12009

etsitls: no
tlscert: /usr/local/etc/openli/mediator-crt.pem
tlskey: /usr/local/etc/openli/mediator-key.pem
tlsca: /usr/local/etc/openli/dilithium3_CA.pem

RMQenabled: false
RMQname: openli.nz
RMQpass: openli.key
RMQSSL: false
RMQheartbeatfreq: 30
RMQinternalpass: <secretpassword>

And when I run the OpenLI Mediator component:

× openli-mediator.service - OpenLI mediator daemon
     Loaded: loaded (/lib/systemd/system/openli-mediator.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-08-28 10:29:56 CEST; 4s ago
       Docs: http://github.com/OpenLI-NZ/openli/wiki
    Process: 21754 ExecStart=/usr/local/bin/openlimediator -c /usr/local/etc/openli/mediator-OQS.yaml (code=exited, status=1/FAILURE)
   Main PID: 21754 (code=exited, status=1/FAILURE)
        CPU: 6ms

ago 28 10:29:55 laaurii00-VirtualBox systemd[1]: Started OpenLI mediator daemon.
ago 28 10:29:56 laaurii00-VirtualBox openlimediator[21754]: OpenLI mediator: unable to determine password for internal RMQ vhost -- mediator must exit
ago 28 10:29:56 laaurii00-VirtualBox openlimediator[21754]: OpenLI Mediator: Error initialising mediator.
ago 28 10:29:56 laaurii00-VirtualBox systemd[1]: openli-mediator.service: Main process exited, code=exited, status=1/FAILURE
ago 28 10:29:56 laaurii00-VirtualBox systemd[1]: openli-mediator.service: Failed with result 'exit-code'.

Can you help me determine what the error is? Thank you so much.

salcock commented 1 month ago

Hello,

Sorry, I have been away on vacation -- do you still need assistance with this problem?

salcock commented 1 month ago

Regardless, I have tracked down the source of the problem here -- it is a documentation error.

The documentation says that the option name for setting the internal RMQ password in the mediator config file is RMQinternalpass -- this is incorrect.

The option name that the OpenLI mediator is actually looking for is RMQlocalpass. So if you use that option instead to set the password then the error should go away.

I apologise for the mistake and the resulting confusion. I will be updating the OpenLI configuration parser to accept both RMQlocalpass and RMQinternalpass as suitable keys for setting this config option in the future (starting from OpenLI 1.1.9).

Thank you so much for reporting this bug!

laaurii00 commented 1 month ago

Okay, thanks!