TL;DR - elasticsearch is not reachable in lando after adding elasticsearch versions 7.2, 7.5, or 7.7 as a service in /.platform/services.yaml. Using v7.9 or 7.10 works as expected.
# This file describes an application. You can have multiple applications
# in the same project.
# The name of this app. Must be unique within a project.
name: app
# The type of the application to build.
type: php:7.4
dependencies:
php:
composer/composer: '^2'
build:
flavor: composer
# The hooks that will be performed when the package is deployed.
hooks:
build: |
set -e
deploy: |
set -e
php artisan config:clear
php artisan migrate --force
# The relationships of the application with services or other applications.
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
database: "db:mysql"
essearch: 'es:elasticsearch'
# The size of the persistent disk of the application (in MB).
disk: 2048
# The mounts that will be performed when the package is deployed.
mounts:
"storage/app/public":
source: local
source_path: "public"
"storage/framework/views":
source: local
source_path: "views"
"storage/framework/sessions":
source: local
source_path: "sessions"
"storage/framework/cache":
source: local
source_path: "cache"
"storage/logs":
source: local
source_path: "logs"
"bootstrap/cache":
source: local
source_path: "cache"
"/.config":
source: local
source_path: "config"
# The configuration of app when it is exposed to the web.
web:
locations:
"/":
root: "public"
index:
- index.php
allow: true
passthru: "/index.php"
"/storage":
root: "storage/app/public"
scripts: false
crons:
# Run Laravel's scheduler every 5 minutes, which is often as crons can run.
scheduler:
spec: '*/5 * * * *'
cmd: 'php artisan schedule:run'
# Run Laravel's queue worker task every 9 minutes
queue:
spec: '*/9 * * * *'
# Allow the worker to run for up to 5 minutes. That prevents
# a long-running queue from blocking a deploy for more than 5
# minutes.
cmd: 'php artisan queue:work --max-time=300'
variables:
php:
memory_limit: "1024M"
env:
SCOUT_ELASTIC_HOST: 'essearch.internal'
ELASTICSEARCH_HOST: 'essearch.internal'
Tell us about the command you were running
After bringing up lando (lando start) the application indicated it was unable to contact the elasticsearch service. Verified lando created the service
❯ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1da28e33a491 docker.registry.platform.sh/mariadb-10.4 "/lando-entrypoint.s…" 2 hours ago Up 2 hours 127.0.0.1:56581->3306/tcp daaldertest_db_1
5c9c0c903762 docker.registry.platform.sh/elasticsearch-7.2 "/lando-entrypoint.s…" 2 hours ago Up 2 hours 127.0.0.1:56580->9200/tcp daaldertest_es_1
7b5d98fb3946 docker.registry.platform.sh/php-7.4 "/lando-entrypoint.s…" 2 hours ago Up 2 hours 127.0.0.1:56579->80/tcp daaldertest_app_1
db56ab4a23b6 traefik:2.2.0 "/lando-entrypoint.s…" 2 hours ago Up 2 hours 127.0.0.1:443->443/tcp, 127.0.0.1:8080->80/tcp, 127.0.0.1:56506->8080/tcp landoproxyhyperion5
SSH'ed into the app container via lando ssh and tried to connect to the service:
web@7b5d98fb3946:/app$ curl essearch.internal:9200
curl: (7) Failed to connect to essearch.internal port 9200: Connection refused
web@7b5d98fb3946:/app$ curl es.daaldertest.internal:9200
curl: (7) Failed to connect to es.daaldertest.internal port 9200: Connection refused
Set the version to 7.5, committed, ran lando stop && lando destroy -y && lando start, received the same issue and response from curl.
Did the same above but for version 7.7, received the same results. Did the same but for 7.9, but THIS time got something different:
TL;DR - elasticsearch is not reachable in lando after adding elasticsearch versions 7.2, 7.5, or 7.7 as a service in
/.platform/services.yaml
. Using v7.9 or 7.10 works as expected.Lando version: 3.3.0 OS version: macOS 11.5.2
Contents of
.lando.yml
Contents of
/.platform/services.yml
:Contents of
.platform.app.yml
Tell us about the command you were running
After bringing up lando (
lando start
) the application indicated it was unable to contact the elasticsearch service. Verified lando created the servicedouble-checked the container is up and running:
SSH'ed into the app container via
lando ssh
and tried to connect to the service:Set the version to 7.5, committed, ran
lando stop && lando destroy -y && lando start
, received the same issue and response from curl.Did the same above but for version 7.7, received the same results. Did the same but for 7.9, but THIS time got something different:
If this is a known issue with these versions of elasticsearch, then docs just need to be updated.