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?
Same here macos
bin/setup magento.test
Starting mg_db_1 ... done
Starting mg_elasticsearch_1 ... done
Starting mg_redis_1 ... done
Starting mg_rabbitmq_1 ... done
Starting mg_phpfpm_1 ... done
Starting mg_app_1 ... done
Could not connect to the Amqp Server.
I'm getting the same on Windows 10. Issue occurs either way whether I use one line or do it manually instead... so I'm unable to use.
Docker Compose is now in the Docker CLI, try `docker compose up`
Waiting for connection to Elasticsearch...
..Could not connect to the Amqp Server.
In InstallCommand.php line 274:
Parameter validation failed
RabbitMQ container logs also show
2021-05-13 16:40:18.653 [info] <0.9.0> Server startup complete; 3 plugins started.
* rabbitmq_management
* rabbitmq_management_agent
* rabbitmq_web_dispatch
completed with 3 plugins.
2021-05-13 16:40:28.504 [info] <0.607.0> accepting AMQP connection <0.607.0> (172.26.0.6:33140 -> 172.26.0.4:5672)
2021-05-13 16:40:28.523 [error] <0.607.0> Error on AMQP connection <0.607.0> (172.26.0.6:33140 -> 172.26.0.4:5672, user: 'guest', state: opening):
vhost C:/Program Files/Git/ not found
2021-05-13 16:40:28.524 [info] <0.607.0> closing AMQP connection <0.607.0> (172.26.0.6:33140 -> 172.26.0.4:5672, vhost: 'none', user: 'guest')
I'm unable to replicate this. Is this still occurring? I'm on Docker Desktop 20.10.7, Docker Compose v2.0.0-beta.6
I'm on Docker Desktop 20.10.7, Docker Compose v2.0.0-beta.6 and this is still occurring for me.
I tried this on a completely fresh install of Docker Desktop using the same versions as your last comment (and also, on another computer), and I'm still unable to replicate it.
That said, I'm on a Mac, so this is definitely specific to Windows/WSL2. I'll keep this open as I'm unable to test on this platform at the moment, so perhaps someone else can chime in with a fix.
same error here!
Win 10 Docker version 20.10.7, build f0df350 docker-compose version 1.29.2, build 5becea4c
Everyone on this issue... I just noticed the line erroring: "vhost C:/Program Files/Git/ not found"
Do you have Git installed on your Windows machines?
+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.
Thanks a lot @vernard. If anyone can confirm this as a fix (I cannot as I was not previously experiencing a bug), there are little downsides to implement something like this if it resolves your problems.
I was finally able to replicate this! But only once or twice, then it didn't happen again.
That said, the only thing from @vernard's update that would make a difference would be the RABBITMQ_VM_MEMORY_HIGH_WATERMARK setting. This doesn't really appear to have any adverse side-effects, so I added it in at https://github.com/markshust/docker-magento/commit/935a0b7e3f4c6e2082355f28764958f0b6847fb1
I'll be tagging a new version of docker-magento very soon. That said, if this continues to happen with this update in place, please let me know so I can reopen this ticket!
I'm reopening this issue, as I'm still experiencing it randomly.
Ok, so what was happening is that even though the Elasticsearch server is running, the Magento setup was connecting to it too quickly, causing it to throw the error above. I removed all of the suggested RabbitMQ updates, as this seemed to fix this without them. Just by adding a sleep 2 seems to give enough time for Elasticsearch to wake up before Magento attempts the install.
Hello @markshust,
I'm getting errors while installation of Magento in Windows 10 Docker machine
Stopping magento_phpfpm_1 ... Stopping magento_app_1 ... Stopping magento_db_1 ... Stopping magento_mailcatcher_1 ... Stopping magento_redis_1 ... Stopping magento_rabbitmq_1 ... Stopping magento_elasticsearch_1 ... Stopping magento_phpfpm_1 ... done Stopping magento_redis_1 ... done Stopping magento_mailcatcher_1 ... done Stopping magento_elasticsearch_1 ... done Stopping magento_app_1 ... done Stopping magento_db_1 ... done Stopping magento_rabbitmq_1 ... done Starting magento_redis_1 ... Starting magento_mailcatcher_1 ... Starting magento_app_1 ... Starting magento_rabbitmq_1 ... Starting magento_elasticsearch_1 ... Starting magento_phpfpm_1 ... Starting magento_db_1 ... Starting magento_redis_1 ... done Starting magento_mailcatcher_1 ... done Starting magento_phpfpm_1 ... done Starting magento_rabbitmq_1 ... done Starting magento_db_1 ... done Starting magento_elasticsearch_1 ... done Starting magento_app_1 ... done Waiting for connection to Elasticsearch... ....... Waiting for connection to RabbitMQ... ....Could not connect to the Amqp Server.
In InstallCommand.php line 274:
Parameter validation failed
setup:install [--backend-frontname BACKEND-FRONTNAME] [--enable-debug-logging ENABLE-DEBUG-LOGGING] [--enable-syslog-logging ENABLE-SYSLOG-LOGGING] [--remote-storage-driver REMOTE-STORAGE-DRIVER] [--remote-storage-prefix REMOTE-STORAGE-PREFIX] [--remote-storage-bucket REMOTE-STORAGE-BUCKET] [--remote-storage-region REMOTE-STORAGE-REGION] [--remote-storage-key REMOTE-STORAGE-KEY] [--remote-storage-secret REMOTE-STORAGE-SECRET] [--consumers-wait-for-messages CONSUMERS-WAIT-FOR-MESSAGES] [--amqp-host AMQP-HOST] [--amqp-port AMQP-PORT] [--amqp-user AMQP-USER] [--amqp-password AMQP-PASSWORD] [--amqp-virtualhost AMQP-VIRTUALHOST] [--amqp-ssl AMQP-SSL] [--amqp-ssl-options AMQP-SSL-OPTIONS] [--key KEY] [--db-host DB-HOST] [--db-name DB-NAME] [--db-user DB-USER] [--db-engine DB-ENGINE] [--db-password DB-PASSWORD] [--db-prefix DB-PREFIX] [--db-model DB-MODEL] [--db-init-statements DB-INIT-STATEMENTS] [-s|--skip-db-validation] [--http-cache-hosts HTTP-CACHE-HOSTS] [--db-ssl-key DB-SSL-KEY] [--db-ssl-cert DB-SSL-CERT] [--db-ssl-ca DB-SSL-CA] [--db-ssl-verify] [--session-save SESSION-SAVE] [--session-save-redis-host SESSION-SAVE-REDIS-HOST] [--session-save-redis-port SESSION-SAVE-REDIS-PORT] [--session-save-redis-password SESSION-SAVE-REDIS-PASSWORD] [--session-save-redis-timeout SESSION-SAVE-REDIS-TIMEOUT] [--session-save-redis-persistent-id SESSION-SAVE-REDIS-PERSISTENT-ID] [--session-save-redis-db SESSION-SAVE-REDIS-DB] [--session-save-redis-compression-threshold SESSION-SAVE-REDIS-COMPRESSION-THRESHOLD] [--session-save-redis-compression-lib SESSION-SAVE-REDIS-COMPRESSION-LIB] [--session-save-redis-log-level SESSION-SAVE-REDIS-LOG-LEVEL] [--session-save-redis-max-concurrency SESSION-SAVE-REDIS-MAX-CONCURRENCY] [--session-save-redis-break-after-frontend SESSION-SAVE-REDIS-BREAK-AFTER-FRONTEND] [--session-save-redis-break-after-adminhtml SESSION-SAVE-REDIS-BREAK-AFTER-ADMINHTML] [--session-save-redis-first-lifetime SESSION-SAVE-REDIS-FIRST-LIFETIME] [--session-save-redis-bot-first-lifetime SESSION-SAVE-REDIS-BOT-FIRST-LIFETIME] [--session-save-redis-bot-lifetime SESSION-SAVE-REDIS-BOT-LIFETIME] [--session-save-redis-disable-locking SESSION-SAVE-REDIS-DISABLE-LOCKING] [--session-save-redis-min-lifetime SESSION-SAVE-REDIS-MIN-LIFETIME] [--session-save-redis-max-lifetime SESSION-SAVE-REDIS-MAX-LIFETIME] [--session-save-redis-sentinel-master SESSION-SAVE-REDIS-SENTINEL-MASTER] [--session-save-redis-sentinel-servers SESSION-SAVE-REDIS-SENTINEL-SERVERS] [--session-save-redis-sentinel-verify-master SESSION-SAVE-REDIS-SENTINEL-VERIFY-MASTER] [--session-save-redis-sentinel-connect-retries SESSION-SAVE-REDIS-SENTINEL-CONNECT-RETRIES] [--cache-backend CACHE-BACKEND] [--cache-backend-redis-server CACHE-BACKEND-REDIS-SERVER] [--cache-backend-redis-db CACHE-BACKEND-REDIS-DB] [--cache-backend-redis-port CACHE-BACKEND-REDIS-PORT] [--cache-backend-redis-password CACHE-BACKEND-REDIS-PASSWORD] [--cache-backend-redis-compress-data CACHE-BACKEND-REDIS-COMPRESS-DATA] [--cache-backend-redis-compression-lib CACHE-BACKEND-REDIS-COMPRESSION-LIB] [--cache-id-prefix CACHE-ID-PREFIX] [--allow-parallel-generation] [--page-cache PAGE-CACHE] [--page-cache-redis-server PAGE-CACHE-REDIS-SERVER] [--page-cache-redis-db PAGE-CACHE-REDIS-DB] [--page-cache-redis-port PAGE-CACHE-REDIS-PORT] [--page-cache-redis-password PAGE-CACHE-REDIS-PASSWORD] [--page-cache-redis-compress-data PAGE-CACHE-REDIS-COMPRESS-DATA] [--page-cache-redis-compression-lib PAGE-CACHE-REDIS-COMPRESSION-LIB] [--page-cache-id-prefix PAGE-CACHE-ID-PREFIX] [--lock-provider LOCK-PROVIDER] [--lock-db-prefix LOCK-DB-PREFIX] [--lock-zookeeper-host LOCK-ZOOKEEPER-HOST] [--lock-zookeeper-path LOCK-ZOOKEEPER-PATH] [--lock-file-path LOCK-FILE-PATH] [--document-root-is-pub DOCUMENT-ROOT-IS-PUB] [--base-url BASE-URL] [--language LANGUAGE] [--timezone TIMEZONE] [--currency CURRENCY] [--use-rewrites USE-REWRITES] [--use-secure USE-SECURE] [--base-url-secure BASE-URL-SECURE] [--use-secure-admin USE-SECURE-ADMIN] [--admin-use-security-key ADMIN-USE-SECURITY-KEY] [--admin-user [ADMIN-USER]] [--admin-password [ADMIN-PASSWORD]] [--admin-email [ADMIN-EMAIL]] [--admin-firstname [ADMIN-FIRSTNAME]] [--admin-lastname [ADMIN-LASTNAME]] [--search-engine SEARCH-ENGINE] [--elasticsearch-host ELASTICSEARCH-HOST] [--elasticsearch-port ELASTICSEARCH-PORT] [--elasticsearch-enable-auth ELASTICSEARCH-ENABLE-AUTH] [--elasticsearch-username ELASTICSEARCH-USERNAME] [--elasticsearch-password ELASTICSEARCH-PASSWORD] [--elasticsearch-index-prefix ELASTICSEARCH-INDEX-PREFIX] [--elasticsearch-timeout ELASTICSEARCH-TIMEOUT] [--cleanup-database] [--sales-order-increment-prefix SALES-ORDER-INCREMENT-PREFIX] [--use-sample-data] [--enable-modules [ENABLE-MODULES]] [--disable-modules [DISABLE-MODULES]] [--convert-old-scripts [CONVERT-OLD-SCRIPTS]] [-i|--interactive] [--safe-mode [SAFE-MODE]] [--data-restore [DATA-RESTORE]] [--dry-run [DRY-RUN]] [--magento-init-params MAGENTO-INIT-PARAMS]

Can anyone help me on this issue
@aleganesh1993 right after that fails, try running bin/setup yourdomain.test again. Almost every time for me, it succeeded the second time. I'm not sure what is going on with Windows, but if this comes up again I'll re-open the ticket. The timeout was enough for things to start working for me.
Hello @markshust, Thank you for your response.
I tried to run the bin/setup yourdomain.test multiple times but still faced the same issue.

I'll re-open for visibility... is anyone else getting this error?
@markshust , yes I confirm I have the same problem on Win 10 / WSL 2
What I was able to do instead was to modify in the bin/setup the waiting time for rabbitmqi and worked after:
rabbitmqi=10
Thanks @ioancatanoaiaosf! @aleganesh1993 I just updated the RabbitMQ timeout to 10... can you try again?
Hi @markshust - still getting the same issue on windows even after timeout set to 10
Had the same problem on Windows. The solution by @vernard worked.