'This site can’t be reached' error on fresh MacOS install
See original GitHub issueHi there,
I’ve got a fresh install of macOS Big Sur 11.1 with no alterations (no PHP/nginx/apache configured or even installed!) and I’m getting an error when trying to access a new api platform instance.
The container is running and I get a message saying that I can view the admin in the browser at localhost:3000 or on my network, but when I go there I get "This site can’t be reachedlocalhost refused to connect. ". When I try to access the IP of the network it just hangs and I get “This site can’t be reached172.18.0.7 took too long to respond.”
The output (along with the docker-compose commands ‘pull, up and logs’ is as follows (and I don’t see anything immediately obvious in terms of errors:
macosclean@MacOSs-MacBook-Pro ff-backend-api-platform % docker-compose up -d
Creating network "ff-backend-api-platform_default" with the default driver
Creating volume "ff-backend-api-platform_db-data" with default driver
Creating volume "ff-backend-api-platform_dev-certs" with default driver
Building dev-tls
Step 1/8 : ARG NGINX_VERSION=1.17
Step 2/8 : FROM nginx:${NGINX_VERSION}-alpine
1.17-alpine: Pulling from library/nginx
cbdbe7a5bc2a: Already exists
c554c602ff32: Pull complete
Digest: sha256:763e7f0188e378fef0c761854552c70bbd817555dc4de029681a2e972e25e30e
Status: Downloaded newer image for nginx:1.17-alpine
---> 89ec9da68213
Step 3/8 : RUN apk add --no-cache nss-tools ;
---> Running in 96499b2a881c
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/6) Installing nspr (4.24-r0)
(2/6) Installing libgcc (9.3.0-r0)
(3/6) Installing sqlite-libs (3.30.1-r2)
(4/6) Installing libstdc++ (9.3.0-r0)
(5/6) Installing nss (3.48-r0)
(6/6) Installing nss-tools (3.48-r0)
Executing busybox-1.31.1-r9.trigger
OK: 30 MiB in 43 packages
Removing intermediate container 96499b2a881c
---> f9953b7c7247
Step 4/8 : WORKDIR /certs
---> Running in 285253c20e4f
Removing intermediate container 285253c20e4f
---> 4c44bcbf52cc
Step 5/8 : ARG MKCERT_VERSION=1.4.1
---> Running in bc4fe2658b79
Removing intermediate container bc4fe2658b79
---> 0b92cc3533ec
Step 6/8 : RUN set -eux; wget -O /usr/local/bin/mkcert https://github.com/FiloSottile/mkcert/releases/download/v$MKCERT_VERSION/mkcert-v$MKCERT_VERSION-linux-amd64; chmod +x /usr/local/bin/mkcert; mkcert --cert-file localhost.crt --key-file localhost.key localhost 127.0.0.1 ::1 mercure; cat localhost.key localhost.crt > server.pem; cp "$(mkcert -CAROOT)/rootCA.pem" /certs/localCA.crt
---> Running in bdcceb053ef9
+ wget -O /usr/local/bin/mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64
Connecting to github.com (140.82.114.3:443)
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (52.217.44.180:443)
saving to '/usr/local/bin/mkcert'
mkcert 100% |********************************| 4815k 0:00:00 ETA
'/usr/local/bin/mkcert' saved
+ chmod +x /usr/local/bin/mkcert
+ mkcert --cert-file localhost.crt --key-file localhost.key localhost 127.0.0.1 ::1 mercure
Created a new local CA at "/root/.local/share/mkcert" 💥
Warning: the local CA is not installed in the system trust store! ⚠️
Run "mkcert -install" to avoid verification errors ‼️
Created a new certificate valid for the following names 📜
- "localhost"
- "127.0.0.1"
- "::1"
- "mercure"
The certificate is at "localhost.crt" and the key at "localhost.key" ✅
+ cat localhost.key localhost.crt
+ mkcert -CAROOT
+ cp /root/.local/share/mkcert/rootCA.pem /certs/localCA.crt
Removing intermediate container bdcceb053ef9
---> 4ab01efe3070
Step 7/8 : VOLUME /certs
---> Running in d85352472069
Removing intermediate container d85352472069
---> e1c3a7556fde
Step 8/8 : RUN set -eux; { echo 'server {'; echo ' return 301 https://$host$request_uri;'; echo '}'; } | tee /etc/nginx/conf.d/default.conf
---> Running in eaf416a59843
+ echo 'server {'
+ echo ' return 301 https://$host$request_uri;'
+ echo '}'
+ tee /etc/nginx/conf.d/default.conf
server {
return 301 https://$host$request_uri;
}
Removing intermediate container eaf416a59843
---> b0b29e47c652
Successfully built b0b29e47c652
Successfully tagged ff-backend-api-platform_dev-tls:latest
WARNING: Image for service dev-tls was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating ff-backend-api-platform_dev-tls_1 ... done
Creating ff-backend-api-platform_db_1 ... done
Creating ff-backend-api-platform_admin_1 ... done
Creating ff-backend-api-platform_mercure_1 ... done
Creating ff-backend-api-platform_client_1 ... done
Creating ff-backend-api-platform_php_1 ... done
Creating ff-backend-api-platform_api_1 ... done
Creating ff-backend-api-platform_vulcain_1 ... done
macosclean@MacOSs-MacBook-Pro ff-backend-api-platform % docker-compose logs -f
Attaching to ff-backend-api-platform_vulcain_1, ff-backend-api-platform_api_1, ff-backend-api-platform_php_1, ff-backend-api-platform_admin_1, ff-backend-api-platform_client_1, ff-backend-api-platform_mercure_1, ff-backend-api-platform_dev-tls_1, ff-backend-api-platform_db_1
db_1 | The files belonging to this database system will be owned by user "postgres".
db_1 | This user must also own the server process.
db_1 |
db_1 | The database cluster will be initialized with locale "en_US.utf8".
db_1 | The default database encoding has accordingly been set to "UTF8".
db_1 | The default text search configuration will be set to "english".
db_1 |
db_1 | Data page checksums are disabled.
db_1 |
db_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1 | creating subdirectories ... ok
db_1 | selecting dynamic shared memory implementation ... posix
db_1 | selecting default max_connections ... 100
db_1 | selecting default shared_buffers ... 128MB
db_1 | selecting default time zone ... UTC
db_1 | creating configuration files ... ok
db_1 | running bootstrap script ... ok
db_1 | sh: locale: not found
db_1 | 2020-12-30 16:44:09.839 UTC [31] WARNING: no usable system locales were found
db_1 | performing post-bootstrap initialization ... ok
db_1 | syncing data to disk ... ok
db_1 |
db_1 |
db_1 | Success. You can now start the database server using:
db_1 |
db_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1 |
db_1 | initdb: warning: enabling "trust" authentication for local connections
db_1 | You can change this by editing pg_hba.conf or using the option -A, or
db_1 | --auth-local and --auth-host, the next time you run initdb.
db_1 | waiting for server to start....2020-12-30 16:44:10.644 UTC [36] LOG: starting PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
db_1 | 2020-12-30 16:44:10.648 UTC [36] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2020-12-30 16:44:10.713 UTC [37] LOG: database system was shut down at 2020-12-30 16:44:10 UTC
db_1 | 2020-12-30 16:44:10.719 UTC [36] LOG: database system is ready to accept connections
db_1 | done
db_1 | server started
db_1 | CREATE DATABASE
db_1 |
db_1 |
db_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1 |
db_1 | waiting for server to shut down....2020-12-30 16:44:10.909 UTC [36] LOG: received fast shutdown request
db_1 | 2020-12-30 16:44:10.914 UTC [36] LOG: aborting any active transactions
db_1 | 2020-12-30 16:44:10.916 UTC [36] LOG: background worker "logical replication launcher" (PID 43) exited with exit code 1
db_1 | 2020-12-30 16:44:10.917 UTC [38] LOG: shutting down
db_1 | 2020-12-30 16:44:10.946 UTC [36] LOG: database system is shut down
db_1 | done
db_1 | server stopped
db_1 |
db_1 | PostgreSQL init process complete; ready for start up.
db_1 |
db_1 | 2020-12-30 16:44:11.019 UTC [1] LOG: starting PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
db_1 | 2020-12-30 16:44:11.019 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2020-12-30 16:44:11.020 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_1 | 2020-12-30 16:44:11.022 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2020-12-30 16:44:11.036 UTC [50] LOG: database system was shut down at 2020-12-30 16:44:10 UTC
db_1 | 2020-12-30 16:44:11.052 UTC [1] LOG: database system is ready to accept connections
yarn run v1.22.4
$ react-scripts start
admin_1 | ��� ���wds���: Project is running at https://172.18.0.7/
admin_1 | ��� ���wds���: webpack output is served from
admin_1 | ��� ���wds���: Content not from webpack is served from /usr/src/admin/public
admin_1 | ��� ���wds���: 404s will fallback to /
admin_1 |
Starting the development server...
admin_1 |
yarn run v1.22.5
error Command "dev:ssl" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
mercure_1 | 2020/12/30 16:44:09 WARNING: proto: file "pb.proto" is already registered
mercure_1 | A future release will panic on registration conflicts. See:
mercure_1 | https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict
mercure_1 |
mercure_1 | {"level":"info","ts":1609346649.6280057,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
mercure_1 | {"level":"info","ts":1609346649.6326075,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
mercure_1 | {"level":"info","ts":1609346649.635663,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
mercure_1 | {"level":"info","ts":1609346649.6357148,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
mercure_1 | {"level":"info","ts":1609346649.6361156,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00063c000"}
mercure_1 | {"level":"info","ts":1609346649.647694,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc00063c000"}
mercure_1 | run: loading initial config: loading new config: loading http app module: provision http: server srv0: setting up route handlers: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 1: loading handler modules: position 0: loading module 'mercure': provision http.handlers.mercure: a JWT key for publishers must be provided
vulcain_1 | {"level":"info","ts":1609346651.36084,"caller":"vulcain/server.go:147","msg":"vulcain started","protocol":"https","addr":""}
ff-backend-api-platform_client_1 exited with code 1
php_1 | WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping
php_1 | Loading composer repositories with package information
php_1 | Installing dependencies (including require-dev) from lock file
php_1 |
php_1 | Prefetching 109 packages
php_1 | - Downloading (100%)
php_1 |
php_1 | Package operations: 109 installs, 0 updates, 0 removals
php_1 | - Installing composer/package-versions-deprecated (1.11.99): Loading from cache
php_1 | - Installing symfony/flex (v1.9.2): Loading from cache
php_1 | - Installing willdurand/negotiation (v2.3.1): Loading from cache
php_1 | - Installing psr/link (1.0.0): Loading from cache
php_1 | - Installing symfony/web-link (v5.1.3): Loading from cache
php_1 | - Installing symfony/polyfill-php80 (v1.18.1): Loading from cache
php_1 | - Installing symfony/serializer (v5.1.3): Loading from cache
php_1 | - Installing symfony/polyfill-mbstring (v1.18.1): Loading from cache
php_1 | - Installing symfony/polyfill-intl-normalizer (v1.18.1): Loading from cache
php_1 | - Installing symfony/polyfill-intl-grapheme (v1.18.1): Loading from cache
php_1 | - Installing symfony/string (v5.1.3): Loading from cache
php_1 | - Installing symfony/property-info (v5.1.3): Loading from cache
php_1 | - Installing symfony/property-access (v5.1.3): Loading from cache
php_1 | - Installing symfony/deprecation-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/http-foundation (v5.1.3): Loading from cache
php_1 | - Installing psr/event-dispatcher (1.0.0): Loading from cache
php_1 | - Installing symfony/event-dispatcher-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/event-dispatcher (v5.1.3): Loading from cache
php_1 | - Installing symfony/var-dumper (v5.1.3): Loading from cache
php_1 | - Installing psr/log (1.1.3): Loading from cache
php_1 | - Installing symfony/error-handler (v5.1.3): Loading from cache
php_1 | - Installing symfony/http-kernel (v5.1.3): Loading from cache
php_1 | - Installing psr/container (1.0.0): Loading from cache
php_1 | - Installing psr/cache (1.0.1): Loading from cache
php_1 | - Installing fig/link-util (1.1.1): Loading from cache
php_1 | - Installing doctrine/inflector (1.4.3): Loading from cache
php_1 | - Installing api-platform/core (v2.5.7): Loading from cache
php_1 | - Installing symfony/routing (v5.1.3): Loading from cache
php_1 | - Installing symfony/finder (v5.1.3): Loading from cache
php_1 | - Installing symfony/filesystem (v5.1.3): Loading from cache
php_1 | - Installing symfony/service-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/dependency-injection (v5.1.3): Loading from cache
php_1 | - Installing symfony/config (v5.1.3): Loading from cache
php_1 | - Installing symfony/var-exporter (v5.1.3): Loading from cache
php_1 | - Installing symfony/cache-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/cache (v5.1.3): Loading from cache
php_1 | - Installing symfony/framework-bundle (v5.1.3): Loading from cache
php_1 | - Installing symfony/stopwatch (v5.1.3): Loading from cache
php_1 | - Installing symfony/console (v5.1.3): Loading from cache
php_1 | - Installing webimpress/safe-writer (2.1.0): Loading from cache
php_1 | - Installing laminas/laminas-zendframework-bridge (1.1.0): Loading from cache
php_1 | - Installing laminas/laminas-eventmanager (3.3.0): Loading from cache
php_1 | - Installing laminas/laminas-code (3.4.1): Loading from cache
php_1 | - Installing ocramius/proxy-manager (2.8.0): Loading from cache
php_1 | - Installing doctrine/event-manager (1.1.1): Loading from cache
php_1 | - Installing doctrine/cache (1.10.2): Loading from cache
php_1 | - Installing doctrine/dbal (2.10.2): Loading from cache
php_1 | - Installing doctrine/migrations (3.0.1): Loading from cache
php_1 | - Installing doctrine/lexer (1.2.1): Loading from cache
php_1 | - Installing doctrine/annotations (1.10.4): Loading from cache
php_1 | - Installing doctrine/reflection (1.2.1): Loading from cache
php_1 | - Installing doctrine/collections (1.6.7): Loading from cache
php_1 | - Installing doctrine/persistence (2.0.0): Loading from cache
php_1 | - Installing symfony/doctrine-bridge (v5.1.3): Loading from cache
php_1 | - Installing doctrine/sql-formatter (1.1.1): Loading from cache
php_1 | - Installing doctrine/doctrine-bundle (2.1.2): Loading from cache
php_1 | - Installing doctrine/doctrine-migrations-bundle (3.0.1): Loading from cache
php_1 | - Installing doctrine/instantiator (1.3.1): Loading from cache
php_1 | - Installing doctrine/common (3.0.2): Loading from cache
php_1 | - Installing doctrine/orm (v2.7.3): Loading from cache
php_1 | - Installing psr/http-message (1.0.1): Loading from cache
php_1 | - Installing psr/http-client (1.0.1): Loading from cache
php_1 | - Installing ralouphie/getallheaders (3.0.3): Loading from cache
php_1 | - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
php_1 | - Installing guzzlehttp/promises (v1.3.1): Loading from cache
php_1 | - Installing guzzlehttp/guzzle (7.0.1): Loading from cache
php_1 | - Installing nelmio/cors-bundle (2.1.0): Loading from cache
php_1 | - Installing webmozart/assert (1.9.1): Loading from cache
php_1 | - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
php_1 | - Installing phpdocumentor/type-resolver (1.3.0): Loading from cache
php_1 | - Installing phpdocumentor/reflection-docblock (5.2.1): Loading from cache
php_1 | - Installing symfony/asset (v5.1.3): Loading from cache
php_1 | - Installing symfony/dotenv (v5.1.3): Loading from cache
php_1 | - Installing symfony/expression-language (v5.1.3): Loading from cache
php_1 | - Installing symfony/http-client-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/http-client (v5.1.3): Loading from cache
php_1 | - Installing symfony/mercure (v0.4.0): Loading from cache
php_1 | - Installing symfony/mercure-bundle (v0.2.5): Loading from cache
php_1 | - Installing monolog/monolog (2.1.1): Loading from cache
php_1 | - Installing symfony/monolog-bridge (v5.1.3): Loading from cache
php_1 | - Installing symfony/monolog-bundle (v3.5.0): Loading from cache
php_1 | - Installing symfony/security-core (v5.1.3): Loading from cache
php_1 | - Installing symfony/security-http (v5.1.3): Loading from cache
php_1 | - Installing symfony/security-guard (v5.1.3): Loading from cache
php_1 | - Installing symfony/security-csrf (v5.1.3): Loading from cache
php_1 | - Installing symfony/security-bundle (v5.1.3): Loading from cache
php_1 | - Installing symfony/translation-contracts (v2.1.3): Loading from cache
php_1 | - Installing symfony/validator (v5.1.3): Loading from cache
php_1 | - Installing twig/twig (v3.0.5): Loading from cache
php_1 | - Installing symfony/yaml (v5.1.3): Loading from cache
php_1 | - Installing league/html-to-markdown (4.10.0): Loading from cache
php_1 | - Installing symfony/process (v5.1.3): Loading from cache
php_1 | - Installing symfony/options-resolver (v5.1.3): Loading from cache
php_1 | - Installing php-cs-fixer/diff (v1.3.0): Loading from cache
php_1 | - Installing composer/xdebug-handler (1.4.3): Loading from cache
php_1 | - Installing composer/semver (1.5.1): Loading from cache
php_1 | - Installing friendsofphp/php-cs-fixer (v2.16.4): Loading from cache
php_1 | - Installing easyrdf/easyrdf (0.9.1): Loading from cache
php_1 | - Installing api-platform/schema-generator (v2.2.2): Loading from cache
php_1 | - Installing symfony/dom-crawler (v5.1.3): Loading from cache
php_1 | - Installing symfony/browser-kit (v5.1.3): Loading from cache
php_1 | - Installing symfony/css-selector (v5.1.3): Loading from cache
php_1 | - Installing symfony/twig-bridge (v5.1.3): Loading from cache
php_1 | - Installing symfony/debug-bundle (v5.1.3): Loading from cache
php_1 | - Installing nikic/php-parser (v4.9.0): Loading from cache
php_1 | - Installing symfony/maker-bundle (v1.21.0): Loading from cache
php_1 | - Installing symfony/phpunit-bridge (v5.1.3): Loading from cache
php_1 | - Installing symfony/twig-bundle (v5.1.3): Loading from cache
php_1 | - Installing symfony/web-profiler-bundle (v5.1.3): Loading from cache
php_1 | Generating optimized autoload files
ff-backend-api-platform_mercure_1 exited with code 1
php_1 | Deprecation Notice: Class EasyRdf_Parser_JsonLd located in ./vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLdImplementation.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
php_1 | Deprecation Notice: Class EasyRdf_Serialiser_JsonLd located in ./vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/JsonLd_real.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
php_1 | composer/package-versions-deprecated: Generating version class...
php_1 | composer/package-versions-deprecated: ...done generating version class
php_1 | 78 packages you are using are looking for funding.
php_1 | Use the `composer fund` command to find out more!
php_1 |
php_1 | Run composer recipes at any time to see the status of your Symfony recipes.
php_1 |
admin_1 |
Compiled successfully!
admin_1 |
admin_1 | You can now view admin in the browser.
admin_1 |
admin_1 | Local: https://localhost:3000
admin_1 | On Your Network: https://172.18.0.7:3000
admin_1 |
admin_1 | Note that the development build is not optimized.
admin_1 | To create a production build, use yarn build.
admin_1 |
php_1 | Executing script cache:clear [OK]
php_1 |
php_1 | Executing script assets:install public [OK]
php_1 | Waiting for db to be ready...
php_1 | The db is now ready and reachable
php_1 | [notice] Migrating up to DoctrineMigrations\Version20200828181711
php_1 | [notice] finished in 161.5ms, used 20M memory, 1 migrations executed, 2 sql queries
php_1 |
php_1 | [30-Dec-2020 16:45:29] NOTICE: fpm is running, pid 1
php_1 | [30-Dec-2020 16:45:29] NOTICE: ready to handle connections
php_1 | 127.0.0.1 - 30/Dec/2020:16:45:31 +0000 "GET /ping" 200
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@divine the
docker-compose up -d --build
command solved the issue 🙂 and can now access admin in the browser at https://localhostMany thanks for looking into that, you too @dunglas, and have a happy new year!!
🥳 🎉 🍾 👯
Hello,
Looks like
error Command "dev:ssl" not found.
related to https://github.com/api-platform/api-platform/issues/1686#issuecomment-728373815 might be a fix?Before trying that fix could you please run
docker-compose up -d --build
and see if everything works?Thanks!