[Bug 285020] net/rabbitmq: fix crash on start

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 25 Feb 2025 10:35:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285020

Dave Cottlehuber <dch@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|erlang@FreeBSD.org          |dch@freebsd.org
                 CC|                            |dch@freebsd.org
             Status|New                         |Open

--- Comment #2 from Dave Cottlehuber <dch@freebsd.org> ---
Created attachment 257914
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=257914&action=edit
alternative approach

thanks Marek!

I can't replicate it here in a fresh 14.2-RELEASE jail, I
think we should probably use rabbitmq_chdir here, and
make sure that all of the *HOME flavoured variables line
up.

Can you try this and see if it helps?

## reproduce steps
root@bunny:/ # pkg install -r FreeBSD rabbitmq
Updating FreeBSD repository catalogue...
[bunny.skunkwerks.at] Fetching meta.conf: 100%    178 B   0.2kB/s    00:01
[bunny.skunkwerks.at] Fetching data.pkg: 100%    7 MiB   1.5MB/s    00:05
Processing entries: 100%
FreeBSD repository update completed. 35857 packages processed.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        erlang-runtime27: 27.1.2_1 [FreeBSD]
        rabbitmq: 4.0.4 [FreeBSD]

Number of packages to be installed: 2

The process will require 139 MiB more space.
55 MiB to be downloaded.

Proceed with this action? [y/N]: y
[bunny.skunkwerks.at] [1/2] Fetching rabbitmq-4.0.4.pkg: 100%   16 MiB  
2.8MB/s    00:06
[bunny.skunkwerks.at] [2/2] Fetching erlang-runtime27-27.1.2_1.pkg: 100%   39
MiB   3.7MB/s    00:11
Checking integrity... done (0 conflicting)
[bunny.skunkwerks.at] [1/2] Installing erlang-runtime27-27.1.2_1...
[bunny.skunkwerks.at] [1/2] Extracting erlang-runtime27-27.1.2_1: 100%
[bunny.skunkwerks.at] [2/2] Installing rabbitmq-4.0.4...
===> Creating groups
Creating group 'rabbitmq' with gid '135'
===> Creating users
Creating user 'rabbitmq' with uid '135'
===> Creating homedir(s)
[bunny.skunkwerks.at] [2/2] Extracting rabbitmq-4.0.4: 100%
=====
Message from erlang-runtime27-27.1.2_1:

--
To use this runtime port for development or testing, just prepend
its binary path ("/usr/local/lib/erlang27/bin") to your PATH variable.
=====
Message from rabbitmq-4.0.4:

--
First-time users will want to run:

sudo -u rabbitmq rabbitmq-plugins enable rabbitmq_management
sudo -u rabbitmq rabbitmqctl enable_feature_flag --experimental khepri_db

and restart, to enable the web admin console at http://localhost:15672/
with a default username and password of guest:guest. You should change it..

See https://www.rabbitmq.com/docs for install help, and
https://www.rabbitmq.com/docs/configure for further options.
root@bunny:/ # sudo -u rabbitmq rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@bunny:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@bunny...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

set 3 plugins.
Offline change; changes will take effect at broker restart.
root@bunny:/ # sudo -u rabbitmq rabbitmqctl enable_feature_flag --experimental
khepri_db
Error: unable to perform an operation on node 'rabbit@bunny'. Please see
diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection
or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's
Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on
https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@bunny
 * If target node is configured to use long node names, don't forget to use
--longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@bunny]

rabbit@bunny:
  * connected to epmd (port 4369) on bunny
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on bunny
  * suggestion: start the node

Current node details:
 * node name: 'rabbitmqcli-625-rabbit@bunny'
 * effective user's home directory: /var/db/rabbitmq
 * Erlang cookie hash: 2MNtNN90Ut00NNgJZ3fypg==

root@bunny:/ # sysrc rabbitmq_enable=yes
rabbitmq_enable:  -> yes
root@bunny:/ # service rabbitmq restart
Starting rabbitmq.
root@bunny:/ # sockstat -46l|grep 5672
rabbitmq beam.smp   12629 19  tcp4   100.64.112.33:25672   *:*
rabbitmq beam.smp   12629 37  tcp4   100.64.112.33:15672   *:*
rabbitmq beam.smp   12629 38  tcp6   fca2:927d:4de2:8e50:6c98::7021:5672 *:*
rabbitmq beam.smp   12629 39  tcp4   100.64.112.33:5672    *:*
```

-- 
You are receiving this mail because:
You are the assignee for the bug.