Closed benhtn closed 1 year ago
docker inspect docker-magento2_web_1. The value of the field "IPAddress" write to the hosts file. For example 172.18.0.3 magento2.docker
Many thanks for the response @Aleksanteris. I tried running inspect on the web container and got this:
"IPAMConfig": null,
"Links": [
"meanbee_db_1:db",
"meanbee_db_1:db_1",
"meanbee_db_1:meanbee_db_1",
"meanbee_fpm_1:fpm",
"meanbee_fpm_1:fpm_1",
"meanbee_fpm_1:meanbee_fpm_1"
],
"Aliases": [
"web",
"613a7b9b08b9"
],
"NetworkID": "5a6d65aa73dedc65fc2eac7ead3231409e4ff38e7626461b1093973441ac66ea",
"EndpointID": "d69da04562536b812caf909b89374fcb1030477ce72ed14c0ceb51546900670e",
"Gateway": "192.168.0.1",
"IPAddress": "192.168.0.6",
"IPPrefixLen": 20,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:c0:a8:00:06",
"DriverOpts": null
So I added this to /etc/hosts:
192.168.0.6 magento2.docker
Checking the docker containers with $ docker ps -a | grep meanbee
$ docker ps -a | grep meanbee
621de4c49d8c meanbee/magento2-varnish:latest "/bin/sh -c /start.sh" 13 minutes ago Up 18 seconds 0.0.0.0:32802->80/tcp meanbee_varnish_1
613a7b9b08b9 meanbee/magento2-nginx:1.9 "/usr/local/bin/dock…" 13 minutes ago Up 19 seconds 443/tcp, 0.0.0.0:32801->80/tcp meanbee_web_1
29f7ea4817b1 meanbee/magento2-php:7.0-cli "/docker-entrypoint.…" 13 minutes ago Up 23 seconds meanbee_cli_1
1b71aeff860e meanbee/magento2-php:7.0-fpm "/docker-entrypoint.…" 13 minutes ago Up 23 seconds 0.0.0.0:32800->9000/tcp meanbee_fpm_1
a39c923eefb2 meanbee/magento2-php:7.0-cli "/docker-entrypoint.…" 13 minutes ago Up 13 seconds meanbee_cron_1
f9ed7e5913b6 meanbee/magento2-php:7.0-cli "/docker-entrypoint.…" About an hour ago Exited (0) 13 minutes ago meanbee_cli_run_1
82ca2bc925a4 mariadb:10 "docker-entrypoint.s…" About an hour ago Up 18 seconds 0.0.0.0:32803->3306/tcp meanbee_db_1
0b7edf773bd9 tianon/true "/true" About an hour ago Exited (0) 23 seconds ago meanbee_dbdata_1
1ede28e8a4ae tianon/true "/true" About an hour ago Exited (0) 23 seconds ago meanbee_appdata_1
Which looks about right doesn't it?
However I got still get "magento2.docker refused to connect. " in my browser from http://magento2.docker and http://magento2.docker:32796/ and "Bad gatway from http://192.168.1.80:32801/ and http://192.168.1.80:32802/
I am getting to the varnish container with http://192.168.1.80:32802/ because I see it in the logs, but how to I diagnose the "Bad Gateway" response please?
Got this from running docker logs on the web container:
2018/08/28 18:19:19 [error] 14#14: *21 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://192.168.0.9:9000", host: "192.168.1.80:32801", referrer: "http://192.168.1.80:32801/
Hey guys, I have the same issue on High Sierra; is there some news on it?
set UPDATE_UID_GID=false in the global.env
Also, have this issue. Tried docker inspect docker-magento2_web_1 and set UPDATE_UID_GID=false in the global.env does not helpred.
I'm not aware of anything specifically wrong with High Sierra. I've been using these images on that version of the OS without problem for a while.
Running Windows 10. Exact same problems as described.
set UPDATE_UID_GID=false in the global.env
This worked for me. Remembering the quickstart asks you to create composer.env
Same error for me
Hi,
seems to be related to the php container version used by default in docker-compose.yml. If you replace 7.0 by 7.1 (meanbee/magento2-php:7.0-xxx->meanbee/magento2-php:7.1-xxx), it will get to work (tested on MacOS Sierra).
Update: php7.1 does not support Mcrypt which causes an error. There are several patches available as the problem is caused only by one file. Like DominicWatts states below magento2/issues/5880 php7.2 is not supported by M2 until 2.3
Good luck,
@benvansteenbergen with 7.1:
Exception: Deprecated Functionality: Function mcrypt_module_open() is deprecated in /var/www/magento/vendor/magento/framework/Encryption/Crypt.php on line 54 in /var/www/magento/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 /var/www/magento/vendor/magento/framework/Encryption/Crypt.php(54): Magento\Framework\App\ErrorHandler->handler(8192, 'Function mcrypt...', '/var/www/magent...', 54, Array) #1 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(401): Magento\Framework\Encryption\Crypt->__construct('7df168579fa9b19...', 'rijndael-256', 'cbc', 'LBpXrigtHVWVcz4...') #2 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('7df168579fa9b19...', 2, 'LBpXrigtHVWVcz4...') #3 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(228): Magento\Framework\Encryption\Encryptor->decrypt('LFMaYNX/ACJBRit...') #4 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(180): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default') #5 /var/www/magento/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...') #6 /var/www/magento/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...') #7 /var/www/magento/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL) #8 /var/www/magento/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...') #9 /var/www/magento/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply() #10 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor)) #11 /var/www/magento/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array) #12 /var/www/magento/vendor/magento/framework/App/Http.php(185): Magento\Framework\App\Response\Http\Interceptor->sendResponse() #13 /var/www/magento/vendor/magento/framework/App/Http.php(156): Magento\Framework\App\Http->handleDeveloperMode(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #14 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #15 /var/www/magento/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #16 {main}
@benvansteenbergen and with 7.2: Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/magento/vendor/colinmollenhour/cache-backend-file/File.php on line 81 Exception: Warning: Use of undefined constant MCRYPT_RIJNDAEL_256 - assumed 'MCRYPT_RIJNDAEL256' (this will throw an Error in a future version of PHP) in /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php on line 394 in /var/www/magento/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(394): Magento\Framework\App\ErrorHandler->handler(2, 'Use of undefine...', '/var/www/magent...', 394, Array) #1 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('7df168579fa9b19...', 2, 'LBpXrigtHVWVcz4...') #2 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(228): Magento\Framework\Encryption\Encryptor->decrypt('LFMaYNX/ACJBRit...') #3 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(180): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default') #4 /var/www/magento/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...') #5 /var/www/magento/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...') #6 /var/www/magento/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use...', 'default', NULL) #7 /var/www/magento/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...') #8 /var/www/magento/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply() #9 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor)) #10 /var/www/magento/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array) #11 /var/www/magento/vendor/magento/framework/App/Http.php(185): Magento\Framework\App\Response\Http\Interceptor->sendResponse() #12 /var/www/magento/vendor/magento/framework/App/Http.php(156): Magento\Framework\App\Http->handleDeveloperMode(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #13 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #14 /var/www/magento/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #15 {main}
Magento 2 itself is not compatible with php 7.2
I believe it's something they're working on as part of 2.3 release
They've got a lot to update though!
@benvansteenbergen with 7.1:
Exception: Deprecated Functionality: Function mcrypt_module_open() is deprecated in /var/www/magento/vendor/magento/framework/Encryption/Crypt.php on line 54 in /var/www/magento/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 /var/www/magento/vendor/magento/framework/Encryption/Crypt.php(54): Magento\Framework\App\ErrorHandler->handler(8192, 'Function mcrypt...', '/var/www/magent...', 54, Array) #1 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(401): Magento\Framework\Encryption\Crypt->__construct('7df168579fa9b19...', 'rijndael-256', 'cbc', 'LBpXrigtHVWVcz4...') #2 /var/www/magento/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('7df168579fa9b19...', 2, 'LBpXrigtHVWVcz4...') #3 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(228): Magento\Framework\Encryption\Encryptor->decrypt('LFMaYNX/ACJBRit...') #4 /var/www/magento/vendor/magento/module-config/App/Config/Type/System.php(180): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default') #5 /var/www/magento/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...') #6 /var/www/magento/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...') #7 /var/www/magento/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL) #8 /var/www/magento/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...') #9 /var/www/magento/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply() #10 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor)) #11 /var/www/magento/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array) #12 /var/www/magento/vendor/magento/framework/App/Http.php(185): Magento\Framework\App\Response\Http\Interceptor->sendResponse() #13 /var/www/magento/vendor/magento/framework/App/Http.php(156): Magento\Framework\App\Http->handleDeveloperMode(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #14 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #15 /var/www/magento/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #16 {main}
Same here. 7.1 is not working on High Sierra.
This is a magento 2 issue
After setting UPDATE_UID_GID=false
in the global.env is it enough to call docker-compose restart
? If so it didn't help... Trying to access IP from docker inspect docker-magento2_web_1
doesn't help either. Running High Sierra (without dinghy - as I red somewhere that this may be helpful but the setup can be run without it as well).
@benhtn did you manage to solve this issue? I have the same problem
@benvansteenbergen I recreated containers using php 7.1 (by setting meanbee/magento2-php:7.0-xxx->meanbee/magento2-php:7.1-xxx) and Magento 2.2 (by setting M2SETUP_VERSION=2.1. -> M2SETUP_VERSION=2.2.). And still I get 502 bad gateway. For me this is network issue, but I don't know how to solve it.
When issuing docker-compose ps
should the container meanbee_appdata_1
be in Up
state?
docker-compose up -d
docker ps
docker-compose run --rm cli magento-command setup:store-config:set --base-url="http://magento2.docker:32785/"
@DominicWatts it looks like this helped, I managed to access magento webpage after setting this magic base-url. Thank you very much!
Also have this problem, how do I fix it?
Console shows fpm_1 | Starting Mail Transport Agent (MTA): sendmail. fpm_1 | [07-Dec-2018 05:39:47] ERROR: [pool www] please specify user and group other than root fpm_1 | [07-Dec-2018 05:39:47] ERROR: [pool www] please specify user and group other than root fpm_1 | [07-Dec-2018 05:39:47] ERROR: FPM initialization failed fpm_1 | [07-Dec-2018 05:39:47] ERROR: FPM initialization failed cli_1 | Starting Mail Transport Agent (MTA): sendmail. cron_1 | Starting Mail Transport Agent (MTA): sendmail. docker-magento2_fpm_1 exited with code 78
docker-compose run --rm cli magento-command setup:store-config:set --base-url="http://magento2.docker:32803/"
Docker ps output.
λ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2f192e02c712 meanbee/magento2-varnish:latest "/bin/sh -c /start.sh" 5 minutes ago Up 5 minutes 0.0.0.0:32804->80/tcp docker-magento2_varnish_1
74e25311650a meanbee/magento2-nginx:1.9 "/usr/local/bin/dock…" 5 minutes ago Up 5 minutes 443/tcp, 0.0.0.0:32803->80/tcp docker-magento2_web_1
2843d38ba5e4 meanbee/magento2-php:7.0-cli "/docker-entrypoint.…" 5 minutes ago Up 5 minutes docker-magento2_cron_1
So to fix I need PHP 7.1 and to apply the mcrypt patch to one file?
I have edited the php version in the docker-compose.yml and ran
docker-compose down
docker-compose up
Still getting this 502 Bad Gateway nginx/1.9.15
Magento 2.2.5
Docker PS output after changing to PHP 7.1.
λ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eeafe90e1806 meanbee/magento2-varnish:latest "/bin/sh -c /start.sh" About a minute ago Up About a minute 0.0.0.0:32809->80/tcp docker-magento2_varnish_1
aae79066c24e meanbee/magento2-nginx:1.9 "/usr/local/bin/dock…" About a minute ago Up About a minute 443/tcp, 0.0.0.0:32808->80/tcp docker-magento2_web_1
84c2e9b9cdf4 meanbee/magento2-php:7.1-cli "/docker-entrypoint.…" About a minute ago Up About a minute docker-magento2_cron_1
docker-compose run --rm cli magento-command setup:store-config:set --base-url="http://magento2.docker:32808/"
Unable to connect on localhost port 80 either.
Edit:
UPDATE_UID_GID=false
ENABLE_SENDMAIL=false
In the global.env
And adding port 80 to varnish resolved.
varnish:
image: meanbee/magento2-varnish:latest
environment:
- VIRTUAL_HOST=magento2.docker
- VIRTUAL_PORT=80
- HTTPS_METHOD=noredirect
ports:
- "80:80"
links:
- web
Try connecting localhost on port 32809 (see docker ps output). Or modify varnish port from 80 to 80:80 in your docker-compose.yml Good luck!
Verstuurd vanaf mijn iPhone
Op 7 dec. 2018 om 06:39 heeft Liam Mitchell notifications@github.com het volgende geschreven:
32809
@LiamKarlMitchell I'm using php 7.1. To avoid mcrypt issue I've just changed in docker-compose.yml line
- M2SETUP_VERSION=2.1.*
to
- M2SETUP_VERSION=2.2.*
because Magento 2.2 seems to be compatible with php 7.1
Same error for me, PHP 7.4 and Magento 2.4
@ndoublehwp did you find a solution?
Hi there, I am running this on a macbook with High Sierra, and Docker CE Version 18.06.0-ce-mac70 (26399).
I completed the quick set-up (all seemed fine with the magento installer), then guessing from the output of docker ps, I visited http://localhost:32798 But I get 502 Bad Gateway - nginx/1.9.15
I also added a /etc/hosts entry to point to 127.0.0.1 magento2.docker And tried visiting http://magento2.docker:32798 But still the same.
I can see varnish running usingthe varnishlog command in the varnish container. I see the 502 error there too. e.g.
I tried disabling varnish (removing the block in docker-compose.yml and add the block for nginx), but after restart I cannot access anything (port 80 - refused to connect). I can see nginx is running in the web container:
Can you give me any ideas/ can I provide further information to assist diagnosis?