testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

RabbitMQContainer not working with the latest rabbitmq-management docker image

Open AlexCovizzi opened this issue 4 years ago • 8 comments

When using the RabbitMQContainer with the latest version of rabbitmq-management docker image, the docker container is not started. The error is caused by the RABBITMQ_DEFAULT_PASS environment variable that has been deprecated and is not supported anymore (see this commit).

AlexCovizzi avatar Jul 29 '21 09:07 AlexCovizzi

Hi @AlexCovizzi, thanks a lot for raising this issue and adding the context. I can confirm that it does not work OOTB because of the linked changed.

However, as a simple workaround, one can simply explicitly remove the password:

container.withAdminPassword(null);

kiview avatar Jul 29 '21 09:07 kiview

It seams to be fixed in 1.16.0 I guess...

nmoreira avatar Jul 29 '21 11:07 nmoreira

It should not be fixed when using the new image, at least to my knowledge.

kiview avatar Jul 29 '21 11:07 kiview

It should not be fixed when using the new image, at least to my knowledge.

I switched to the alpine version rabbitmq:3-management-alpine... that's why I didn't got the issue this time... My bad... sorry :)

nmoreira avatar Jul 29 '21 11:07 nmoreira

I tested with rabbitmq:3.9.0-management-alpine, which did not work. And indeed the commit referenced in the original comment indicates that this problem starts to appear with version 3.9.0, which was released 6 days ago.

kiview avatar Jul 29 '21 11:07 kiview

I don't know why but my docker didn't updated my docker image tagged with rabbitmq:3-management-alpine to the latest one released a few days ago, so I was still running with the previous version. I manually deleted the image and it pulled the updated one and it started to fail. An additional workaround to the one you've suggested is to explicitly use a docker image from 3.8 version (like rabbitmq:3.8-management)

nmoreira avatar Jul 29 '21 14:07 nmoreira

I don't know why but my docker didn't updated my docker image tagged with rabbitmq:3-management-alpine to the latest one released a few days ago, so I was still running with the previous version. I manually deleted the image and it pulled the updated one and it started to fail. An additional workaround to the one you've suggested is to explicitly use a docker image from 3.8 version (like rabbitmq:3.8-management)

Was just about to post the same issue. We ended up doing the workaround that you suggested. For now we are using the latest 3.8.x version of the official image -> rabbitmq:3.8.19-alpine Our issue and the fix for it can be seen here -> https://github.com/eclipse/dirigible/issues/1013

BorisNen avatar Aug 05 '21 18:08 BorisNen

I launched RabbitMQContainer (using the provided RabbitMQContainerJUnitIntegrationTest) with 3.9 and 3.10 versions and the environment variable RABBITMQ_DEFAULT_PASS is fully supported. See the official RabbitMQ image documentation, the latest Ubuntu entrypoint and the latest Alpine entrypoint.

This only test that fails is RabbitMQContainerTest.shouldWorkWithSSL, but this have be reported in #5599.

@kiview, I vote for closing this issue in favour of #5599.

mgryszko avatar Jul 15 '22 08:07 mgryszko

I can confirm RabbitMQContainer works with latest version, see the following example.

eddumelendez avatar Oct 28 '23 01:10 eddumelendez