docker-magento: onelinesetup - Could not connect to Amqp Server on WSL2

I’m trying to run onelinesetup on a Windows 10 machine with WSL2 as the docker backend. I’m getting the following error after the containers are bounced following running Composer:

+ bin/setup magento.test
Stopping new-project_app_1           ...
Stopping new-project_phpfpm_1        ...
Stopping new-project_redis_1         ...
Stopping new-project_db_1            ...
Stopping new-project_elasticsearch_1 ...
Stopping new-project_rabbitmq_1      ...
Stopping new-project_redis_1         ... done
Stopping new-project_elasticsearch_1 ... done
Stopping new-project_rabbitmq_1      ... done
Stopping new-project_app_1           ... done
Stopping new-project_phpfpm_1        ... done
Stopping new-project_db_1            ... done
Starting new-project_rabbitmq_1 ...
Starting new-project_db_1       ...
Starting new-project_elasticsearch_1 ...
Starting new-project_redis_1         ...
Starting new-project_redis_1         ... done
Starting new-project_db_1            ... done
Starting new-project_phpfpm_1        ...
Starting new-project_elasticsearch_1 ... done
Starting new-project_rabbitmq_1      ... done
Starting new-project_phpfpm_1        ... done
Starting new-project_app_1           ...
Starting new-project_app_1           ... done
Waiting for connection to Elasticsearch...
.Could not connect to the Amqp Server.

When I had a look at the logs for the rabbitmq container (which appears to be starting and running), I see:


2021-03-09 16:55:02.653 [info] <0.9.0> Server startup complete; 3 plugins started.
* rabbitmq_management
* rabbitmq_management_agent
* rabbitmq_web_dispatch
2021-03-09 16:55:07.557 [info] <0.624.0> accepting AMQP connection <0.624.0> (172.23.0.6:36534 -> 172.23.0.4:5672)
2021-03-09 16:55:07.563 [error] <0.624.0> Error on AMQP connection <0.624.0> (172.23.0.6:36534 -> 172.23.0.4:5672, user: 'guest', state: opening): vhost C:/Program Files/Git/ not found
2021-03-09 16:55:07.563 [info] <0.624.0> closing AMQP connection <0.624.0> (172.23.0.6:36534 -> 172.23.0.4:5672, vhost: 'none', user: 'guest')

So it’s trying to run GIT to pull something, but it’s looking for a DOS directory path. I do have GIT installed in C:/Program Files/Git/, but I’m wondering if mount points are confused that it’s looking for a DOS path.

Is the fact that I’m using WSL2 the problem here? Has anyone else got this to work?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 38 (18 by maintainers)

Commits related to this issue

Most upvoted comments

+1 on this error. And yes I have git installed.

I was able to get it fixed by changing the bin/setup command

  --amqp-host=rabbitmq \
  --amqp-port=5672 \
  --amqp-user=admin \
  --amqp-password=YjJiOTY0NDAxNWRkNmI1Y2Yx \
  --amqp-virtualhost=DSrabbitmq \

And also added the environment configuration in the docker image


  rabbitmq:
    image: rabbitmq:3.7-management-alpine
    ports:
      - "15672:15672"
      - "5672:5672"
    volumes:
      - rabbitmqdata:/var/lib/rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=YjJiOTY0NDAxNWRkNmI1Y2Yx
      - RABBITMQ_DEFAULT_VHOST=DSrabbitmq
      - RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1024MB

I’m not sure if the error was because we used a guest account, or it’s because we used the default (no) vhost. Anyhow, try the solution I wrote above if you’re getting the same error.

same error here!

Win 10 Docker version 20.10.7, build f0df350 docker-compose version 1.29.2, build 5becea4c

That worked for me! 😄

@Inbary-s sorry about this! Can you try again now?

I’ll re-open for visibility… is anyone else getting this error?