Skip to content

default user invalid credentials #2095

Closed

Description

@SachinMaharana

Describe the bug

A clear and concise description of what the bug is.
After deploying, i see the invalid credentials error in the log

   HTTP access denied: user 'default_user_HrdLmjryMbnYQFcLIur' - invalid credentials

The operator then cannot authenticate against the management API, resulting in Quorum Status: unavailable and repeated log warnings.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy a RabbitmqCluster with load_definitions pointing to a definitions JSON that defines its own users (without the operator's generated default user).

  2. Observe logs:

    HTTP access denied: user 'default_user_HrdLmjryMbnYQFcLIur' - invalid credentials

  3. kubectl describe rabbitmqcluster shows Quorum Status: unavailable.

Include any YAML or manifest necessary to reproduce the problem.

manifests:
  - apiVersion: rabbitmq.com/v1beta1
    kind: RabbitmqCluster
    metadata:
      name: rabbitmq
      namespace: rabbitmq-system
    spec:
      replicas: 1
      resources:
        requests:
          cpu: 600m
          memory: 800Mi
        limits:
          cpu: 600m
          memory: 800Mi
      persistence:
        storageClassName: standard
        storage: 10Gi
      rabbitmq:
        additionalPlugins:
          - rabbitmq_mqtt
          - rabbitmq_prometheus
        additionalConfig: |
          vm_memory_high_watermark.absolute = 550MiB
          mqtt.listeners.tcp.default = 1883
          mqtt.allow_anonymous = false
          collect_statistics_interval = 10000
          load_definitions = /etc/rabbitmq/definitions
      override:
        statefulSet:
          spec:
            template:
              spec:
                containers:
                  - name: rabbitmq
                    volumeMounts:
                    - mountPath: /etc/rabbitmq/definitions/definitions.json
                      subPath: definitions.json
                      name: definitions
                    ports:
                      - containerPort: 1883
                        name: mqtt
                        protocol: TCP
                volumes:
                - name: definitions
                  secret:
                    secretName: rabbitmq-definitions
        service:
          spec:
            ports:
              - name: mqtt
                port: 1883
                targetPort: 1883
                protocol: TCP

  - apiVersion: policy/v1
    kind: PodDisruptionBudget
    metadata:
      name: rabbitmq
      namespace: rabbitmq-system
    spec:
      maxUnavailable: 1
      selector:
        matchLabels:
          app.kubernetes.io/name: rabbitmq

  - apiVersion: secrets.hashicorp.com/v1beta1
    kind: VaultStaticSecret
    metadata:
      name: rabbitmq-user-definitions
      namespace: rabbitmq-system
    spec:
      vaultAuthRef: rabbitmq-system/rabbitmq-system
      mount: k8s/mount
      type: kv-v2
      path: rabbitmq-system/rabbitmq-server
      refreshAfter: 5m
      destination:
        create: true
        name: rabbitmq-definitions
        overwrite: true
        transformation:
          excludeRaw: true
          excludes:
            - .*
          templates:
            definitions.json:
              text: |
                {
                  "vhosts": [
                    {
                      "name": "/"
                    }
                  ],
                  "users": [
                    {
                      "name": "admin",
                      "password": "{{ "{{" }} .Secrets.admin {{ "}}" }}",
                      "tags": "administrator"
                    }
                  ],
                  "permissions": [
                    {
                      "vhost": "/",
                      "user": "admin",
                      "read": ".*",
                      "write": ".*",
                      "configure": ".*"
                    }
                  ],
                 
                }
      rolloutRestartTargets:
        - kind: StatefulSet
          name: rabbitmq-server

  - apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: rabbitmq
    spec:
      endpoints:
      - port: prometheus
        scheme: http
        interval: 15s
        scrapeTimeout: 14s
        tlsConfig:
          insecureSkipVerify: true
      - port: prometheus
        scheme: http
        path: /metrics/detailed
        params:
          family:
            - queue_coarse_metrics
            - queue_metrics
        interval: 15s
        scrapeTimeout: 14s
      selector:
        matchLabels:
          app.kubernetes.io/component: rabbitmq
      namespaceSelector:
        any: true

Expected behavior
A clear and concise description of what you expected to happen.
Quorum Status: ok

Screenshots

If applicable, add screenshots to help explain your problem.

Version and environment information

Additional context

Add any other context about the problem here.

Activity

  1. added
    bug
    on Apr 10, 2026
  2. SachinMaharana commented on Apr 10, 2026

    @SachinMaharana
    Author

    even with the addtionalConfig, i see the same issue.

            additionalConfig: |
              vm_memory_high_watermark.absolute = 550MiB
              mqtt.listeners.tcp.default = 1883
              mqtt.allow_anonymous = false
              collect_statistics_interval = 10000
              load_definitions = /etc/rabbitmq/definitions
              default_user=guest
              default_pass=guest
    
  3. MirahImage commented on Apr 10, 2026

    @MirahImage
    Member

    Yes, the default user created by the operator will not work if you import definitions, it will be overwritten by the definitions, which means the checks will not function. This is documented in the example https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/import-definitions

  4. MirahImage commented on Apr 10, 2026

    @MirahImage
    Member

    One option to work around this issue is to create your own default user both in the imported configuration as well as in a provided secret, following the example https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/external-admin-secret-credentials

  5. locked and limited conversation to collaborators on Apr 10, 2026
  6. converted this issue into a discussion #2097 on Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions