Skip to content

External rabbitmq instance without access to "/" vhost #1971

@nevesing

Description

@nevesing

I am trying to use external rabbitmq instance where we dont have access to / vhost and our internal team who host this rabbitmq instance do not provide access to / vhost. We configure RP_AMQP_ANALYZER-VHOST to specific vhost but still it tries to connect to additional vhost /

  api:
    image: reportportal/service-api:5.11.0
    container_name: reportportal-api
    logging:
      <<: *logging
    depends_on:
      # rabbitmq:
      #   condition: service_healthy
      gateway:
        condition: service_started
      postgres:
        condition: service_healthy
    environment:
      RP_DB_HOST: *db_host
      RP_DB_USER: *db_user
      RP_DB_PASS: *db_password
      RP_DB_NAME: *db_name
      RP_AMQP_HOST: rabbitmq-external.xxx.com
      RP_AMQP_PORT: 5672
      RP_AMQP_USER: reportportaladmusr
      RP_AMQP_PASS: xxx
      RP_AMQP_APIUSER: reportportaladmusr
      RP_AMQP_APIPASS: xxx
      RP_AMQP_ANALYZER-VHOST: fs-qa-reportportal
      DATASTORE_TYPE: filesystem
      LOGGING_LEVEL_ORG_HIBERNATE_SQL: debug
      RP_REQUESTLOGGING: "false"
      AUDIT_LOGGER: "OFF"
      MANAGEMENT_HEALTH_ELASTICSEARCH_ENABLED: "false"
      RP_ENVIRONMENT_VARIABLE_ALLOW_DELETE_ACCOUNT: "false"
      LOGGING_LEVEL_COM_EPAM_TA_REPORTPORTAL_WS_CONTROLLER: debug
      LOGGING_LEVEL_COM_EPAM_TA_REPORTPORTAL_WS_RABBIT: debug
      JAVA_OPTS: >
        -Xmx1g 
        -XX:+HeapDumpOnOutOfMemoryError 
        -XX:HeapDumpPath=/tmp  
        -Dcom.sun.management.jmxremote.rmi.port=12349 
        -Dcom.sun.management.jmxremote 
        -Dcom.sun.management.jmxremote.local.only=false  
        -Dcom.sun.management.jmxremote.port=9010 
        -Dcom.sun.management.jmxremote.authenticate=false 
        -Dcom.sun.management.jmxremote.ssl=false 
        -Djava.rmi.server.hostname=0.0.0.0
      RP_JOBS_BASEURL: http://jobs:8686
      COM_TA_REPORTPORTAL_JOB_INTERRUPT_BROKEN_LAUNCHES_CRON: PT1H
      RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_BATCH-SIZE: 100
      RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_PREFETCH-COUNT: 1
      RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_CONSUMERS-COUNT: 1
    volumes:
      - storage:/data/storage
    healthcheck:
      test: curl -f http://0.0.0.0:8585/health
      interval: 60s
      timeout: 30s
      retries: 10
      start_period: 60s
    labels:
      - "traefik.http.middlewares.api-strip-prefix.stripprefix.prefixes=/api"
      - "traefik.http.routers.api.middlewares=api-strip-prefix@docker"
      - "traefik.http.routers.api.rule=PathPrefix(`/api`)"
      - "traefik.http.routers.api.service=api"
      - "traefik.http.services.api.loadbalancer.server.port=8585"
      - "traefik.http.services.api.loadbalancer.server.scheme=http"
      - "traefik.expose=true"
    networks:
      - reportportal
    restart: always

Error logs if we use external hosted rabbitmq:

reportportal-api  | Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'reportportaladmusr', class-id=10, method-id=40)

Success logs if we use internal rabbitmq in docker--compose:

reportportal-api  | 2024-04-16 11:28:59.875  INFO 1 --- [           main] o.s.a.r.c.CachingConnectionFactory       : Created new connection: connectionFactory#1d8e9f22:0/SimpleConnection@29a73056 [delegate=amqp://rabbitmq@172.26.0.3:5672/, localPort= 54540]

...

reportportal-api  | 2024-04-16 11:29:44.783  INFO 1 --- [nio-8585-exec-1] o.s.a.r.c.CachingConnectionFactory       : Created new connection: analyzerConnectionFactory#2f19ab6:0/SimpleConnection@748feadf [delegate=amqp://rabbitmq@172.26.0.3:5672/fs-qa-reportportal, localPort= 54610]

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