Rotate the RabbitMQ Password, Erlang Cookie and User in Xray (Self-Hosted)

Rotate RabbitMQ credentials and replace the default user in self-hosted JFrog Xray.

Use this procedure to replace the default RabbitMQ credentials of a self-hosted JFrog Xray installation with your own values:

  • RabbitMQ password: the password Xray uses to connect to RabbitMQ.
  • Erlang cookie: the shared secret that RabbitMQ nodes and the rabbitmqctl CLI use to talk to each other.
  • RabbitMQ user: Xray connects as guest by default. You replace it with a dedicated user and delete guest.

By default, these are well-known installer values, and guest can log in from other hosts, so anyone who can reach RabbitMQ's ports can try them. Each platform tab lists its defaults.

Applies to: Xray self-hosted with the RabbitMQ that Xray installs:

  • Linux: RPM, Debian and archive (tar.gz), single node, multi-node, and split mode (dedicated RabbitMQ nodes installed with the RabbitMQ RPM/Debian package).
  • Docker Compose: single node, multi-node, and split mode.
  • Helm: the Xray chart and the JFrog Platform chart.

Not covered:

  • An external RabbitMQ broker that you manage yourself. Rotate the credentials on that broker, then update shared.rabbitMq.* in Xray's system.yaml.
  • Changing which network interfaces or ports RabbitMQ listens on. See Network Access to RabbitMQ Ports for how to restrict access.

Expected downtime:

ChangeLinux and Docker ComposeHelm
PasswordShort. On a multi-node installation, Xray on a node that has not been restarted yet cannot open new RabbitMQ connections until its restart.One downtime window for all three changes: Xray and RabbitMQ are scaled to 0, the RabbitMQ secret is changed, RabbitMQ is started, and one helm upgrade switches Xray to the new user.
Erlang cookieRabbitMQ and Xray are stopped on all nodes at the same time.(same window)
UserShort restarts.(same window)
⚠️

All paths, users and values on this page are examples

They show a default installation. Before you run a command, check the value on your own system and change the command where needed.

How this page is organized: Choose your platform tab under Rotate the Credentials: Linux, Docker Compose or Helm. Each tab is complete on its own, from preparation to clean-up, with its own troubleshooting and rollback; follow it from top to bottom. On Linux and Docker Compose you make the three changes in this order, and verify each one before the next: password → cookie → user. On Helm, one helm upgrade makes all three changes in one downtime window.


Why the guest User Must Be Deleted

  • By default, Xray connects to RabbitMQ as guest, a well-known user name.
  • RabbitMQ normally lets guest log in only from localhost. Xray's rabbitmq.conf turns that off with loopback_users.guest = false, so anyone who can reach port 5672 or 15672 can try to log in as guest.
  • Xray's start-up script sets the password of guest on every RabbitMQ start. After you switch Xray to a dedicated user, a remaining guest user would get the same password as that user. That is why guest must be deleted, not only restricted.
  • RabbitMQ's own access-control guidance recommends creating a user with generated credentials and deleting guest.
  • The order matters: create the new user → point Xray at it → restart Xray and verify → restrict guest → delete guest → verify. If you restrict or delete guest while Xray still uses it, Xray is locked out: on Docker Compose, Helm, multi-node and split-mode installations, Xray connects over the network, so RabbitMQ treats it as a remote client and refuses guest with user 'guest' can only connect via localhost.

When you finish: Xray uses a dedicated user (xray_admin in the examples), guest does not exist, and loopback_users.guest is no longer false.


Rotate the Credentials

Choose your platform.

Step 0 — Prepare (Linux)

Rules

  1. One cookie and one password per cluster. Generate them once and copy the same values to every node. RabbitMQ shares users and passwords across the whole cluster, so you run rabbitmqctl change_password and add_user once, on any node.
  2. Change every copy. The password is stored in system.yaml and in every rabbitmq.conf on the node. Every time RabbitMQ starts, Xray's start-up script sets the password of default_user to default_pass from rabbitmq.conf. Because the password is shared across the cluster, one node with an old default_pass resets the password for the whole cluster the next time it starts.
  3. Do not paste the new values into tickets, chat or source control.
  4. Make the password, cookie and user changes as separate steps, and verify each one before the next. Deleting guest is part of the procedure, not optional.
  5. Stop and restart RabbitMQ only through its service, with shared.rabbitMq.autoStop: true. Without this setting, systemctl stop xray and systemctl restart xray on a node that runs both Xray and RabbitMQ stop or restart only Xray, and RabbitMQ keeps running. The cookie change then fails. Step 0.1 sets it. The RabbitMQ package for split mode (xray-rabbitmq.service) sets it by default.

0.1 Set autoStop. On every node that runs RabbitMQ, add this to system.yaml (for example /opt/jfrog/xray/var/etc/system.yaml):

shared:
  rabbitMq:
    autoStop: true

Without it, systemctl stop xray and systemctl restart xray stop or restart only Xray, and RabbitMQ keeps running. RPM, Debian and archive installations where Xray and RabbitMQ run on the same node do not set it by default. On split-mode RabbitMQ nodes, the RabbitMQ package sets it; check that it is there.

Check:

sudo grep -n autoStop /opt/jfrog/xray/var/etc/system.yaml

No restart is needed now; the setting is used the next time the service is stopped or restarted.

0.2 Plan a maintenance window and announce it. Scans and other Xray processing stall during the change.

0.3 Generate the new values once, on a trusted host, with shell history turned off:

set +o history
RMQ_PASSWORD=$(openssl rand -hex 24)
RMQ_COOKIE=$(openssl rand -hex 32)

Store both in your secret manager, and use the same two values on every node. The examples use the same $RMQ_PASSWORD for the new xray_admin user.

In the shell on each node, set the new values and the current values (the checks use them):

set +o history
RMQ_PASSWORD='<new password>'
RMQ_COOKIE='<new cookie>'
OLD_PASS='<current password>'
OLD_COOKIE='<current cookie>'

The installer default for the password and the cookie is JFXR_RABBITMQ_COOKIE, and the default user is guest. Many installations set their own values during installation, so do not assume the default. Read the current password from default_pass in rabbitmq.conf, and the current cookie from the .erlang.cookie file.

Set the RabbitMQ folder. It is .../rabbitmq on RabbitMQ 3 and .../rabbitmq4 on RabbitMQ 4. Check it, then set it in the same shell:

grep JF_PRODUCT_RABBITMQ_HOME /opt/jfrog/xray/app/bin/xray.default
RMQ_HOME=/opt/jfrog/xray/app/third-party/rabbitmq

Use the folder printed by the first command. The commands in this tab use $RMQ_HOME for the server cookie and for rabbitmqctl.

0.4 Record the current settings. The paths are listed in A.0.

  • Current RabbitMQ user (<user> in this tab). Default: guest. Check shared.rabbitMq.username in system.yaml.
  • Active node (multi-node only): the node named in shared.rabbitMq.active.node.name in system.yaml.
  • Cluster nodes, users and vhosts: rabbitmqctl cluster_status, rabbitmqctl list_users, rabbitmqctl list_vhosts.

0.5 Back up. Copy, do not move. The backups contain secrets; keep them readable by root only. On nodes that run RabbitMQ, back up system.yaml, both rabbitmq.conf files, both cookie files and the RabbitMQ data folder. For example:

sudo tar -czpf /var/tmp/xray-rmq-backup.tgz \
  /opt/jfrog/xray/var/etc/system.yaml \
  /opt/jfrog/xray/var/etc/rabbitmq.conf \
  /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf \
  /opt/jfrog/xray/.erlang.cookie \
  $RMQ_HOME/.erlang.cookie \
  /opt/jfrog/xray/var/data/rabbitmq
sudo chmod 600 /var/tmp/xray-rmq-backup.tgz

Leave out /opt/jfrog/xray/var/etc/rabbitmq.conf if it does not exist. On split-mode Xray nodes, back up system.yaml.

0.6 Check that the system is healthy before you start, and again after each step:

  • Xray health, on a node that runs Xray. All services must show "state" : "HEALTHY":

    curl -s http://localhost:8082/router/api/v1/system/health
  • Xray is connected to RabbitMQ:

    rabbitmqctl list_connections user
  • The current password is correct (prints Success):

    rabbitmqctl authenticate_user <user> "$OLD_PASS"

After a restart, the Xray services can take a few minutes to report HEALTHY again.

In this tab, rabbitmqctl <command> means sudo -u xray -i $RMQ_HOME/sbin/rabbitmqctl <command> (see A.0).

A.0 Paths and Users

RPM, Debian and archive installations use the same RabbitMQ scripts and the same folder layout under the installation folder. The RabbitMQ package for split mode installs only RabbitMQ, with the same layout and its own service. The commands in this tab use the default RPM/Debian paths; replace /opt/jfrog/xray with your installation folder.

RPM / DebianSplit mode: RabbitMQ nodeArchive (tar.gz)How to check
Service userxrayxrayxrayps -o user= -C beam.smp
Installation folder (JF_PRODUCT_HOME)/opt/jfrog/xray, also the service user's home folder/opt/jfrog/xrayThe extraction folder, for example /opt/jfrog/jfrog-xray-<version>-linuxgetent passwd xray | cut -d: -f6 (home folder)
CLI cookie (used by rabbitmqctl)/opt/jfrog/xray/.erlang.cookiesame<service user's home>/.erlang.cookie—
RabbitMQ folder (JF_PRODUCT_RABBITMQ_HOME)/opt/jfrog/xray/app/third-party/rabbitmq (RabbitMQ 3) or .../rabbitmq4 (RabbitMQ 4)samesame, under the extraction foldergrep JF_PRODUCT_RABBITMQ_HOME /opt/jfrog/xray/app/bin/xray.default
Server cookie (used by RabbitMQ)<RabbitMQ folder>/.erlang.cookie ($RMQ_HOME/.erlang.cookie, set in Step 0.3)samesame—
rabbitmq.conf (read by RabbitMQ)/opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.confsamesameAlways present
rabbitmq.conf (second copy)/opt/jfrog/xray/var/etc/rabbitmq.confsamesameExists on newer installations only
system.yaml/opt/jfrog/xray/var/etc/system.yamlsamesame—
Servicexrayxray-rabbitmqxray (without a service: app/bin/xrayManage.sh start|stop)systemctl list-unit-files | grep xray
autoStopNot set by default; set it in 0.1true by defaultNot set by default; set it in 0.1grep autoStop system.yaml

In this tab, "the service" means xray on nodes that run Xray and RabbitMQ, and xray-rabbitmq on split-mode RabbitMQ nodes.

Split mode, Xray nodes. They run xray.service without RabbitMQ and connect to all RabbitMQ nodes through shared.rabbitMq.urls. Only system.yaml matters on these nodes. One user name and password are used for every URL in the list; this works because RabbitMQ users are shared across the cluster.

shared:
  rabbitMq:
    urls:
      - amqp://<rabbitmq-node-1>:5672/
      - amqp://<rabbitmq-node-2>:5672/
    username: "xray_admin"
    password: "<RMQ_PASSWORD>"

system.yaml and encryption. On nodes that run Xray, Xray encrypts the password in system.yaml after it starts, so you will not see the new value in plain text afterwards. On split-mode RabbitMQ nodes, the value stays in plain text; make sure only the service user and root can read the file.

How to run rabbitmqctl. Run it as the service user, with a login shell (-i):

sudo -u xray -i $RMQ_HOME/sbin/rabbitmqctl cluster_status
  • rabbitmqctl reads the cookie from the service user's home folder. As root, or as any other user, it uses a different cookie and cannot connect.
  • Without -i, it runs in your current folder. If the service user cannot read that folder, it fails with File operation error: eacces.

In this tab, rabbitmqctl <command> means sudo -u xray -i $RMQ_HOME/sbin/rabbitmqctl <command>.

What happens on every start. The service starts RabbitMQ as the service user. The start-up script:

  • creates a cookie file only if none exists, so the cookie files you write are kept;
  • writes the entries of shared.rabbitMq.node.rabbitmqConf from system.yaml into rabbitmq.conf;
  • sets the password of default_user to default_pass from rabbitmq.conf.

A.1 Password

Where each part runs: system.yaml on every node (split mode: every Xray node and every RabbitMQ node); rabbitmq.conf on every node that runs RabbitMQ; change_password once per cluster.

A.1.1 On every node, edit system.yaml as the service user, so its owner does not change:

sudo -u xray vi /opt/jfrog/xray/var/etc/system.yaml

Set the password under shared.rabbitMq:

shared:
  rabbitMq:
    password: "<RMQ_PASSWORD>"

Change only the password: line inside the rabbitMq: block. shared.database also has a password: line, and on split-mode Xray nodes the rabbitMq: block also contains the urls: list; leave both unchanged. Check:

sudo grep -n -A6 'rabbitMq:' /opt/jfrog/xray/var/etc/system.yaml

A.1.2 On every node that runs RabbitMQ, set default_pass to the new password in each rabbitmq.conf that exists:

  • /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf (always present; RabbitMQ reads this one)
  • /opt/jfrog/xray/var/etc/rabbitmq.conf (newer installations only)
default_pass = <RMQ_PASSWORD>

Edit the files as the service user, or run, for each file:

sudo -u xray sed -i "s|^default_pass *=.*|default_pass = $RMQ_PASSWORD|" /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf
sudo -u xray sed -i "s|^default_pass *=.*|default_pass = $RMQ_PASSWORD|" /opt/jfrog/xray/var/etc/rabbitmq.conf

Check:

sudo grep -n '^default_' /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf /opt/jfrog/xray/var/etc/rabbitmq.conf

A.1.3 Change the password in RabbitMQ. Run once per cluster, on any RabbitMQ node:

rabbitmqctl change_password <user> "$RMQ_PASSWORD"
rabbitmqctl authenticate_user <user> "$RMQ_PASSWORD"

Expect Success. Existing Xray connections keep working, but new connections fail until Xray restarts. Continue with A.1.4 straight away.

A.1.4 Restart the service, one node at a time, active node first:

sudo systemctl restart xray            # split-mode RabbitMQ node: sudo systemctl restart xray-rabbitmq

After each restart, check that the new password still works:

rabbitmqctl authenticate_user <user> "$RMQ_PASSWORD"

If it fails, that node still has the old default_pass. Fix its rabbitmq.conf (A.1.2), then run A.1.3 again. Split mode: then restart xray on every Xray node, one at a time.

A.1.5 Verify

  • The new password works and the old one is rejected:

    rabbitmqctl authenticate_user <user> "$RMQ_PASSWORD"
    rabbitmqctl authenticate_user <user> "$OLD_PASS"

    Expect Success for the first, an error for the second.

  • The password survives a restart: restart the service once more and repeat the check above.

  • rabbitmqctl cluster_status lists all nodes. The health check (0.6) shows HEALTHY, and Xray connections are back.

  • There are no RabbitMQ authentication errors in the Xray logs. This prints nothing:

    sudo grep -l ACCESS_REFUSED /opt/jfrog/xray/var/log/*.log
  • A test scan completes.

If a check fails, see Troubleshooting (A.4), or go to Rollback (A.5).

A.2 Erlang Cookie

All nodes must be stopped at the same time. No node may run with the new cookie while another runs with the old one. In split mode, also stop the Xray nodes; they cannot work while RabbitMQ is down.

❗️

Start order in a cluster

  • Stop the nodes one at a time and note which node stopped last.
  • Start that node first, then start all other nodes right away.

A.2.1 Stop everything.

  1. Split mode only: on every Xray node, run sudo systemctl stop xray.

  2. On every node that runs RabbitMQ, one at a time, stop the service and note which node you stop last:

    sudo systemctl stop xray            # split-mode RabbitMQ node: sudo systemctl stop xray-rabbitmq
  3. Check that RabbitMQ is stopped. This must print RabbitMQ stopped:

    pgrep -f beam.smp || echo "RabbitMQ stopped"

    If RabbitMQ is still running, autoStop is not set on that node (0.1). Do not change the cookie while RabbitMQ is running.

A.2.2 On every node that runs RabbitMQ, write the new cookie to both cookie files. Each file must be owned by the service user, with mode 400.

CLI cookie (used by rabbitmqctl):

F=/opt/jfrog/xray/.erlang.cookie
sudo chmod 600 $F
printf '%s' "$RMQ_COOKIE" | sudo tee $F > /dev/null
sudo chown xray:xray $F
sudo chmod 400 $F

Server cookie (used by RabbitMQ):

F=$RMQ_HOME/.erlang.cookie
sudo chmod 600 $F
printf '%s' "$RMQ_COOKIE" | sudo tee $F > /dev/null
sudo chown xray:xray $F
sudo chmod 400 $F

Check:

sudo ls -l /opt/jfrog/xray/.erlang.cookie $RMQ_HOME/.erlang.cookie

Expect both files listed as -r-------- and owned by xray. If both paths point to the same file, writing it once is enough. If only the server cookie is changed, RabbitMQ starts but rabbitmqctl cannot connect to it. If a file is owned by root, or unreadable by the service user, RabbitMQ cannot start.

A.2.3 On every node that runs RabbitMQ (split mode: also on Xray nodes where the key is present), set the cookie in system.yaml. The start-up script uses this value when it creates a cookie file, for example on a new node or after a reinstall.

shared:
  rabbitMq:
    erlangCookie:
      value: "<RMQ_COOKIE>"

A.2.4 Start the node that stopped last first, then immediately all other RabbitMQ nodes:

sudo systemctl start --no-block xray            # split-mode RabbitMQ node: xray-rabbitmq

On a single node, sudo systemctl start xray is enough. Wait until rabbitmqctl cluster_status lists all nodes under Running Nodes. Split mode: then run sudo systemctl start xray on every Xray node.

A.2.5 Verify

  • Both cookie files hold the new value, on every node. Compare checksums, so you never print the value; all three must be the same:

    sudo sha256sum /opt/jfrog/xray/.erlang.cookie $RMQ_HOME/.erlang.cookie
    printf '%s' "$RMQ_COOKIE" | sha256sum
  • The old cookie is rejected. This command must fail with Erlang distribution failed:

    sudo -u xray -i $RMQ_HOME/sbin/rabbitmq-diagnostics -n rabbit@$(hostname -s) --erlang-cookie "$OLD_COOKIE" status
  • rabbitmqctl cluster_status lists all nodes and shows no network partitions.

  • The password from A.1 still works: rabbitmqctl authenticate_user <user> "$RMQ_PASSWORD".

  • rabbitmqctl list_queues -p xray_haq name messages consumers shows the expected queues with consumers, and the health check (0.6) shows HEALTHY.

  • A test scan completes, and there are no errors in the Xray or RabbitMQ logs.

If a check fails, see Troubleshooting (A.4), or go to Rollback (A.5).

A.3 User — Replace guest with xray_admin and Delete guest

Before you start: A.1 and A.2 are done and verified, and $RMQ_PASSWORD is set in your shell. Xray restarts in A.3.3 and RabbitMQ restarts in A.3.4.

A.3.1 Create the new user. Run once, on any RabbitMQ node; users are shared across the cluster.

  1. List the vhosts. Expect at least / and xray_haq:

    rabbitmqctl list_vhosts
  2. Create the user and give it full permissions on each vhost Xray uses:

    rabbitmqctl add_user xray_admin "$RMQ_PASSWORD"
    rabbitmqctl set_user_tags xray_admin administrator
    rabbitmqctl set_permissions -p / xray_admin ".*" ".*" ".*"
    rabbitmqctl set_permissions -p xray_haq xray_admin ".*" ".*" ".*"

    If list_vhosts prints another vhost that Xray uses, run set_permissions for it too.

  3. Check:

    rabbitmqctl list_user_permissions xray_admin
    rabbitmqctl authenticate_user xray_admin "$RMQ_PASSWORD"

Permissions are stored in RabbitMQ and survive restarts.

A.3.2 Point Xray at the new user, on every node:

  1. In system.yaml (split mode: every Xray node and every RabbitMQ node):

    shared:
      rabbitMq:
        username: "xray_admin"
        password: "<RMQ_PASSWORD>"
  2. On every node that runs RabbitMQ, in each rabbitmq.conf that exists:

    default_user = xray_admin
    default_pass = <RMQ_PASSWORD>

    For example:

    sudo -u xray sed -i "s|^default_user *=.*|default_user = xray_admin|" /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf
    sudo -u xray sed -i "s|^default_user *=.*|default_user = xray_admin|" /opt/jfrog/xray/var/etc/rabbitmq.conf
    sudo grep -n '^default_' /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf /opt/jfrog/xray/var/etc/rabbitmq.conf

    This keeps the password of xray_admin in line with default_pass when RabbitMQ restarts.

A.3.3 Restart Xray and confirm it uses the new user. Run sudo systemctl restart xray on each node that runs Xray, one at a time, active node first. On nodes that run both Xray and RabbitMQ, this also restarts RabbitMQ (because of autoStop). Then:

rabbitmqctl list_connections user

All Xray connections must show xray_admin; none may show guest. Run a test scan, and check the Xray logs for RabbitMQ authentication errors. Do not continue until no connection uses guest.

A.3.4 Restrict guest to localhost, permanently. On every node that runs RabbitMQ, add this to system.yaml. The start-up script writes it into rabbitmq.conf on every start.

shared:
  rabbitMq:
    node:
      rabbitmqConf:
        - name: loopback_users.guest
          value: "true"

If rabbitmqConf already has entries, add this one to the list. Then restart the service, one node at a time, and check:

rabbitmqctl environment | grep loopback_users

Expect {loopback_users,[<<"guest">>]}.

A.3.5 Delete guest.

rabbitmqctl delete_user guest
rabbitmqctl list_users

guest must not be listed. After this, the RabbitMQ start-up log shows these lines on every start. They are expected and harmless:

  • Failed to change password for user 'guest' / the user does not exist
  • Failed to set permissions for vhost: xray_haq with user: guest

A.3.6 Verify

  • From a different host, guest is refused. Each command must print 401 (this works only if port 15672 is reachable from that host):

    curl -s -o /dev/null -w '%{http_code}\n' -u "guest:$OLD_PASS" http://<rabbitmq-host>:15672/api/whoami
    curl -s -o /dev/null -w '%{http_code}\n' -u "guest:$RMQ_PASSWORD" http://<rabbitmq-host>:15672/api/whoami
    curl -s -o /dev/null -w '%{http_code}\n' -u guest:JFXR_RABBITMQ_COOKIE http://<rabbitmq-host>:15672/api/whoami
    curl -s -o /dev/null -w '%{http_code}\n' -u guest:guest http://<rabbitmq-host>:15672/api/whoami
  • rabbitmqctl list_users does not list guest, and rabbitmqctl list_connections user shows only xray_admin.

  • After one more restart, both checks above still pass.

  • A test scan completes.

A.3.7 After every Xray upgrade or installer re-run, check that the old settings did not come back. An upgrade can rewrite rabbitmq.conf from the installer's defaults.

rabbitmqctl list_users                                                                    # no guest
sudo grep -n 'loopback_users.guest' /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf     # true (or no line)
sudo grep -n '^default_user' /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf            # xray_admin
sudo grep -n -A6 'rabbitMq:' /opt/jfrog/xray/var/etc/system.yaml                      # username: xray_admin

If a value is back to the default, set it again (A.3.2, A.3.4) and restart.

A.4 Troubleshooting

SymptomLikely causeAction
After systemctl stop xray, beam.smp is still running, and the next start times out after 300 secondsshared.rabbitMq.autoStop is not true, so the service did not stop RabbitMQ, and it still runs with the old cookieSet autoStop: true (0.1). To recover now, stop RabbitMQ with the old cookie: sudo -u xray -i $RMQ_HOME/sbin/rabbitmqctl --erlang-cookie "$OLD_COOKIE" shutdown, then sudo systemctl restart xray. If the Xray services do not report HEALTHY afterwards, run sudo systemctl restart xray once more.
rabbitmqctl fails with File operation error: eaccesIt was run without a login shell, from a folder the service user cannot readRun it as sudo -u xray -i ...
rabbitmqctl reports that it cannot connect, or that cookie authentication failedIt was run as the wrong user; or the CLI cookie (in the service user's home folder) differs from the server cookie; or a node still has the old cookieRun it as sudo -u xray -i. Compare the checksums and owners of all cookie files on all nodes.
RabbitMQ does not start after the cookie changeThe cookie file is owned by root, or has the wrong modeSet the owner to the service user and the mode to 400
A node logs Waiting for Mnesia tables, then Timeout contacting cluster nodes or BOOT FAILEDThe first node started was not the last one stopped, or the other nodes started more than about 5 minutes laterStart the remaining nodes now (systemctl start --no-block). Next time, start the last-stopped node first.
The new password works, then the old one is back after a restartA rabbitmq.conf on some node still has the old default_passFix every rabbitmq.conf on every node, run change_password again, and restart
A loop over the vhosts fails with vhost 'name' not foundlist_vhosts -q prints a header line on RabbitMQ 4Run set_permissions for each vhost by name (A.3.1)
Xray cannot connect after guest was restrictedXray still used guest when it was restrictedPoint Xray at the new user (A.3.2), then restart Xray
loopback_users.guest = false is back after an upgrade or a configV2.sh runThe installer wrote a fresh rabbitmq.conf from its templateAdd the shared.rabbitMq.node.rabbitmqConf entry (A.3.4) and set the value again
A node cannot rejoin the cluster after it was offlineA cluster state problem, not a credentials problemContact JFrog Support. Do not run rabbitmqctl reset without a plan for the node's data.

A.5 Rollback

  1. Stop Xray on every node (split mode: the Xray nodes first), then the service on every RabbitMQ node. Note which node you stop last. Check that pgrep -f beam.smp prints nothing. If RabbitMQ is still running, stop it with the cookie it runs with: sudo -u xray -i $RMQ_HOME/sbin/rabbitmqctl --erlang-cookie <cookie> shutdown.

  2. From the backup (0.5), restore only system.yaml, every rabbitmq.conf, and both cookie files, with the same owner and mode.

  3. Start the node you stopped last first, then the others immediately (systemctl start --no-block). The restored default_pass is applied on start.

  4. If guest was already deleted, create it again:

    rabbitmqctl add_user guest "$OLD_PASS"
    rabbitmqctl set_user_tags guest administrator
    rabbitmqctl set_permissions -p / guest ".*" ".*" ".*"
    rabbitmqctl set_permissions -p xray_haq guest ".*" ".*" ".*"

    Set username: guest and default_user = guest back, and remove the loopback_users.guest entry from shared.rabbitMq.node.rabbitmqConf.

  5. Run the checks from A.1.5 and A.2.5 with the old values.

A.6 Clean Up

  • Clear the values from your shell and turn history back on:

    unset RMQ_PASSWORD RMQ_COOKIE OLD_PASS OLD_COOKIE
    set -o history
  • When the change is confirmed, delete the backups that contain secrets (for example sudo rm /var/tmp/xray-rmq-backup.tgz), or move them to secure storage.

  • Keep shared.rabbitMq.autoStop: true. It is the recommended setting.

  • Record the change in your change-management system: date, layout (single node, multi-node or split mode), versions, and the result of each check.


Network Access to RabbitMQ Ports (All Platforms)

A new cookie and password reduce the risk, but the RabbitMQ ports must not be reachable from outside networks. Allow them only from the hosts that need them, with a firewall, security groups or Kubernetes network policies:

PortUsed forWho may reach it
4369epmd (Erlang node discovery)Other RabbitMQ nodes of the same cluster only. Single node: no other host.
25672Erlang distribution (node-to-node, protected only by the cookie)Other RabbitMQ nodes of the same cluster only. Single node: no other host.
35672-35682CLI tools (rabbitmqctl)Other RabbitMQ nodes of the same cluster only. Single node: no other host.
5672 (5671 with TLS)AMQPXray nodes and services only (split mode: the Xray nodes).
15672Management UI and APIAdministrators only, from a trusted network.

Notes:

  • Docker Compose publishes these ports on the host. Docker's published ports can bypass host firewalls such as ufw or firewalld, so check that your rules apply to Docker traffic.
  • Check what is listening: ss -tlnp | grep -E '4369|25672|35672|5672|15672'. On Helm, use kubectl get svc -n <ns>; RabbitMQ services should not be of type LoadBalancer or NodePort unless you need it.
  • Make sure no other software on the host uses these ports, for example containers left over from an earlier Docker Compose installation.

Related Topics


Did this page help you?