Skip to content

Commit 70777c9

Browse files
committed
Fix RabbitMQ log output with Vault configured
This commit fixes the CI failure which tests the following example: https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/vault-default-user RabbitMQ crashed at startup as follows: ``` failed to open log file at '/var/log/rabbitmq/rabbit@vault-default-user-server-0.vault-default-user-nodes.examples.log', reason: read-only file system ``` The problem was that with Vault configured the mount in https://github.com/rabbitmq/cluster-operator/blob/575cfacf74775a569202d08e406e4e6b5d9d1780/internal/resource/statefulset.go#L876 seems to hide the config file in https://github.com/docker-library/rabbitmq/blob/master/conf.d/10-defaults.conf containing the setting ``` log.console = true ``` Without any vault, the config in the RabbitMQ pod looks as follows: ``` k exec r1-server-0 -c rabbitmq -- ls /etc/rabbitmq/conf.d 10-defaults.conf 10-operatorDefaults.conf 11-default_user.conf 90-userDefinedConfiguration.conf ``` With vault configured, the config directory in the RabbitMQ pod looks as follows: ``` k exec vault-default-user-server-0 -c rabbitmq -- ls /etc/rabbitmq/conf.d 10-operatorDefaults.conf 11-default_user.conf 90-userDefinedConfiguration.conf ``` This commit fixes the issue by adding ``` log.console = true ``` to file `10-operatorDefaults.conf`. There is no harm if this setting is defined twice in different files in the `/etc/rabbitmq/conf.d` directory. The last one wins.
1 parent 575cfac commit 70777c9

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

docs/examples/vault-default-user/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ helm repo update
1414
# For OpenShift deployments, also set the following:
1515
# --set "global.openshift=true"
1616
helm install vault hashicorp/vault \
17-
--version 0.19.0 \
17+
--version 0.31.0 \
1818
--set='server.dev.enabled=true' \
1919
--set='server.logLevel=debug' \
2020
--set='injector.logLevel=debug' \

internal/resource/configmap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
const (
3030
ServerConfigMapName = "server-conf"
3131
defaultRabbitmqConf = `
32+
log.console = true
3233
queue_master_locator = min-masters
3334
disk_free_limit.absolute = 2GB
3435
cluster_partition_handling = pause_minority

internal/resource/configmap_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929

3030
func defaultRabbitmqConf(instanceName string) string {
3131
return iniString(`
32+
log.console = true
3233
queue_master_locator = min-masters
3334
disk_free_limit.absolute = 2GB
3435
cluster_partition_handling = pause_minority

0 commit comments

Comments
 (0)