Skip to content

User creation via WebUI not propagated to REST API via event bus (bus-amqp) in Kubernetes #702

@Talyson

Description

@Talyson

Issue Body:

Bug Description

When a new user is created in the web interface (webui service) of GeoServer Cloud, the change is not reflected in the REST API service (rest) in real-time. The REST API only recognizes the new user after the rest service pod is manually restarted.

This indicates a failure in event propagation through the Spring Cloud Bus and RabbitMQ, despite the webui and rest services being successfully connected to the RabbitMQ broker.

Environment

  • GeoServer Cloud Version: 2.26.2.0
  • Deployment Environment: Azure Kubernetes Service (AKS)
  • Catalog Backend: PostgreSQL (pgconfig profile)
  • Event Bus: RabbitMQ (bus-amqp profile)
  • Orchestration: Terraform for Kubernetes manifests

Steps to Reproduce

  1. Deploy GeoServer Cloud to a Kubernetes cluster with the configuration described below.
  2. Log in to the web interface (webui).
  3. Navigate to Security > Users, Groups, and Roles and create a new user.
  4. Save the new user.
  5. Query the REST API endpoint to list users (e.g., GET /geoserver/rest/security/users.json).

Expected Behavior

The REST API query in step 5 should immediately return the newly created user in the list.

Current Behavior

The REST API query in step 5 does not show the new user. The user only appears in the API response after the geoserver-rest pod is manually restarted.

Diagnostic Steps Taken

  1. The SPRING_PROFILES_ACTIVE environment variable in the webui and rest deployments was updated to include bus-amqp. The full profile string used is: pgconfig,acl,json-logs,standalone,bus-amqp.
  2. The GEOSERVER_BUS_ENABLED=true environment variable was added to the deployments.
  3. Connectivity Confirmation: It was verified (by shelling into the RabbitMQ pod and listing connections) that both the webui pod and the rest pod have active connections to the RabbitMQ broker. This confirms that the issue is not related to basic network connectivity or authentication with the broker, but likely lies within the event publishing or consumption logic.

Relevant Configuration (Terraform HCL)

Below are snippets of the Kubernetes deployment configuration for the webui and rest services, reflecting the applied changes.

geoserver/webui/main.tf:

resource "kubernetes_deployment" "geoserver_webui" {
  metadata {
    name      = "webui"
    namespace = var.namespace
    #...
  }
  spec {
    replicas = 1
    #...
    template {
      #...
      spec {
        #...
        container {
          name  = "webui"
          image = "geoservercloud/geoserver-cloud-webui:2.26.2.0"

          env_from {
            config_map_ref {
              name = var.common_config_map_name
            }
          }
          env_from {
            secret_ref {
              name = var.common_secret_name
            }
          }
          env {
            name  = "SPRING_PROFILES_ACTIVE"
            value = "pgconfig,acl,json-logs,standalone,bus-amqp" # bus-amqp profile added
          }
          env {
            name  = "GEOSERVER_BUS_ENABLED"
            value = "true" # Added to enable the bus
          }
          #... other envs and configurations
        }
      }
    }
  }
}

geoserver/rest/main.tf:

resource "kubernetes_deployment" "geoserver_rest" {
  metadata {
    name      = "rest"
    namespace = var.namespace
    #...
  }
  spec {
    replicas = 1
    #...
    template {
      #...
      spec {
        #...
        container {
          name  = "rest"
          image = "geoservercloud/geoserver-cloud-rest:2.26.2.0"

          env_from {
            config_map_ref {
              name = var.common_config_map_name
            }
          }
          env_from {
            secret_ref {
              name = var.common_secret_name
            }
          }
          env {
            name  = "SPRING_PROFILES_ACTIVE"
            value = "pgconfig,acl,json-logs,standalone,bus-amqp" # bus-amqp profile added
          }
          env {
            name  = "GEOSERVER_BUS_ENABLED"
            value = "true" # Added to enable the bus
          }
          #... other envs and configurations
        }
      }
    }
  }
}

Thanks in advance for any help or guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions