Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ management - 404 when loading a queue or exchange

I have installed RabbitMQ to my Kubernetes Cluster via Google Cloud Platform's marketplace.

I can connect to it fine in my other applications hosted in the Kubernetes Cluster, I can create queues and setup consumers from them without any problems too.

I can temporarily port forward port 15672 so that I can access the management user interface from my machine. I can login fine and I get a list of queues and exchanges when visiting their pages. But as soon as I select a queue or an exchange to load that specific item, I get a 404 response and the following message. I get them same when trying to add a new queue.

Not found
The object you clicked on was not found; it may have been deleted on the server.

They definitely exist, because when I go back to the listing page, they're there. It's really frustrating as it would be nice to test my microservices by simply publishing a message to a queue using RabbitMQ management, but I'm currently blocked from doing so!

Any help would be appreciated, thanks!

Edit
A screenshot provided for clarity (after clicking the queue in the list): rabbitmq admin

If I try to add a new queue, I don't get that message, instead I get a 405.

like image 310
Lloyd Powell Avatar asked Nov 07 '22 20:11

Lloyd Powell


1 Answers

This is because the default virtual-host is '/'. RabbitMQ admin uses this in the URL when you access the exchanges/queues pages. URL encoded it becomes '%2F'. However, the Ingress Controller (in my case nginx) converts that back to '/' so the admin app can't find that URL (hence the 404).

The work-around I came up with was to change the default_vhost setting in rabbitmq to something without '/' in it (e.g. 'vhost').

In the bitnami rabbitmq Helm chart I'm using, this is configured using:

rabbitmq:
  extraConfiguration: |-
    default_vhost = vhost

You do have to update your clients to explicitly specify this new virtual-host though as they generally default to using '/'. In Spring Boot this is as simple as adding:

spring:
  rabbitmq:
    virtual-host: vhost
like image 151
collers Avatar answered Nov 15 '22 10:11

collers