Elasticsearch is not configured

Infos:

  • Used Zammad version: 6.1.0-58
  • Used Zammad installation type: docker-compose
  • Operating system: Debian 11 Buster
  • Browser + version: Chrome

Expected behavior:

Elasticsearch should be working as default setup

Actual behavior:

Searching, auto-suggest email addresses isnt working

Hi,

I was updating from latest Zammad v5 to 6.1.0. I’ve thought this is the right time to clean up the docker-compose file, so I’ve used the default one from github (zammad-docker-compose/docker-compose.yml at master · zammad/zammad-docker-compose · GitHub), so I re-wrote my config (I had a custom Traefik configured) as soon as I’ve launched up the compose file, the search function didn’t work. I’ve entered into the elasticsearch container, tried to re-index everything, but:

root@ce329f2d99c8:/opt/zammad# rake zammad:searchindex:rebuild
I, [2023-11-27T11:33:08.768537 #80] INFO – : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-11-27T11:33:08.781466#80-6320] INFO – : Using memcached as Rails cache store.
I, [2023-11-27T11:33:08.781611#80-6320] INFO – : Using the Redis back end for Zammad’s web socket session store.
Elasticsearch is not configured.

My .env file has the following settings for elasticsearch:

ELASTICSEARCH_VERSION=8.8.0
ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOST=zammad-elasticsearch
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_REINDEX=true

And my container (from docker-compose.yml) settings:

zammad-elasticsearch:
container_name: zammad-elasticsearch
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION}
restart: ${RESTART}
environment:
- discovery.type=single-node
- “ES_JAVA_OPTS=-Xms8192m -Xmx8192m”
user: 0:0
volumes:
- /var/zammad-elasticsearch-data:/bitnami/elasticsearch/data
networks:
- zammad_network

What am I doing wrong?
I didn’ try

rake zammad:searchindex:create

because I wasn’t sure if it would mess up my instance.
Any help appriciated! :slight_smile:

@Bence98007 did the zammad-init container start properly? Can you please post its output? It’s supposed to pick up the ES variables and configure Zammad’s database settings for ES from them.

Indeed, the init container does set the correct url which I’ve tested via Curl:

zammad-init | I, [2023-11-27T11:17:17.944527#23-5540] INFO – : Using memcached as Rails cache store.
zammad-init | I, [2023-11-27T11:17:17.944638#23-5540] INFO – : Using the Redis back end for Zammad’s web socket session store.
zammad-init | I, [2023-11-27T11:17:22.026145#23-5540] INFO – : Setting.set(‘es_url’, “http://zammad-elasticsearch:9200”)

Can you then please check if the ES container has all the relevant ENV passed to it? My next suspicion is that it does not have (all) database information and thus keeps using the nulldb driver which means the DB is empty, and can therefore not even connect to ES.

Please see the x-shared section in zammad-docker-compose for a definition of settings that should be visible to all containers running the Zammad Rails stack.

Hi mgruner,
I didnt modify the x-shared part of the compose file from github, it looks like this for me:

version: ‘3.8’

x-shared:
zammad-service: &zammad-service
environment: &zammad-environment
MEMCACHE_SERVERS: ${MEMCACHE_SERVERS}
POSTGRESQL_DB: ${POSTGRES_DB}
POSTGRESQL_HOST: ${POSTGRES_HOST}
POSTGRESQL_USER: ${POSTGRES_USER}
POSTGRESQL_PASS: ${POSTGRES_PASS}
POSTGRESQL_PORT: ${POSTGRES_PORT}
REDIS_URL: ${REDIS_URL}
# Allow passing in these variables via .env:
AUTOWIZARD_JSON:
AUTOWIZARD_RELATIVE_PATH:
ELASTICSEARCH_ENABLED:
ELASTICSEARCH_HOST:
ELASTICSEARCH_PORT:
ELASTICSEARCH_SCHEMA:
ELASTICSEARCH_NAMESPACE:
ELASTICSEARCH_REINDEX:
ELASTICSEARCH_SSL_VERIFY:
NGINX_PORT:
NGINX_SERVER_NAME:
NGINX_SERVER_SCHEME:
POSTGRESQL_DB_CREATE:
POSTGRESQL_OPTIONS:
RAILS_TRUSTED_PROXIES:
ZAMMAD_WEB_CONCURRENCY:
ZAMMAD_SESSION_JOBS:
ZAMMAD_PROCESS_SCHEDULED:
ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS:
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
user: 0:0
volumes:
- /var/zammad/zammad-storage:/opt/zammad/storage
- /var/zammad/zammad-var:/opt/zammad/var
depends_on:
- zammad-memcached
- zammad-postgresql
- zammad-redis

services:

zammad-backup:

Just fyi who has the same issue, I"ve fixed it by removing all elasticsearch data mounted on the host.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.