zammad / zammad-docker-compose

Zammad Docker images for docker-compose
https://hub.docker.com/r/zammad/zammad-docker-compose/
GNU Affero General Public License v3.0
271 stars 211 forks source link

Version 6.0: elasticsearch not configured #358

Closed ggruening closed 1 year ago

ggruening commented 1 year ago

Infos

Expected behavior

Actual behavior

rebuilding es searchindex...
I, [2023-06-27T20:39:57.025814 #23]  INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-06-27T20:39:57.048064#23-6180]  INFO -- : Using memcached as Rails cache store.
I, [2023-06-27T20:39:57.048155#23-6180]  INFO -- : Using the Redis back end for Zammad's web socket session store.
W, [2023-06-27T20:39:57.150043#23-6180]  WARN -- : Setting "timezone_default" is empty. Using UTC instead. Please set system timezone.
I, [2023-06-27T20:39:58.551720#23-6180]  INFO -- : Setting.set('models_searchable', ["Chat::Session", "KnowledgeBase::Answer::Translation", "Organization", "Ticket", "User"])
Dropping indexes... done.
Deleting pipeline... done.
Creating indexes... done.
Creating pipeline... I, [2023-06-27T20:40:00.822773#23-6180]  INFO -- : Setting.set('es_pipeline', "zammad0f43dd30-76f2-4e5c-9e9b-f34d2d6c7cbb")
done.
Reloading data... 
  - Chat::Session... 
    done in 0 seconds.                    
  - Cti::Log... 
    done in 0 seconds.                    
  - Group... 
    done in 0 seconds.                    
  - KnowledgeBase::Answer::Translation... 
    done in 0 seconds.                    
  - KnowledgeBase::Category::Translation... 
    done in 0 seconds.                    
  - KnowledgeBase::Translation... 
    done in 0 seconds.                    
  - Organization... 
    done in 0 seconds.                    
  - StatsStore... 
    done in 0 seconds.                    
  - Ticket::Priority... 
    done in 0 seconds.                    
  - Ticket::State... 
    done in 0 seconds.                    
  - Ticket... 
    done in 0 seconds.                    
  - User... 
    done in 0 seconds.                    
$ podman-compose exec zammad-scheduler bundle exec rake zammad:searchindex:rebuild
I, [2023-06-27T20:56:54.746174 #30]  INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-06-27T20:56:54.751568#30-6180]  INFO -- : Using memcached as Rails cache store.
I, [2023-06-27T20:56:54.751618#30-6180]  INFO -- : Using the Redis back end for Zammad's web socket session store.
Elasticsearch is not configured.

Steps to reproduce the behavior

Thanks in advance: for any hint and your fantastic work!

Gregor

fleverest commented 1 year ago

I can confirm this is the case on Ubuntu 22.04/Docker version 24.0.2, build cb74dfc/Docker Compose version v2.18.

However, I notice that accessing the rails console doesn't seem to access the production database:

$ docker compose exec zammad-railsserver rails r "p Ticket.count"
I, [2023-06-28T23:39:27.950173 #2514]  INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-06-28T23:39:27.971176#2514-5380]  INFO -- : Using memcached as Rails cache store.
I, [2023-06-28T23:39:27.971698#2514-5380]  INFO -- : Using the Redis back end for Zammad's web socket session store.
0

I believe this is because the entrypoint doesn't initialize the appropriate environment variables:

$ docker compose exec zammad-railsserver bash -c "echo \$ELASTICSEARCH_HOST"

$

It could be a case of adding an exec "$@" line to the end of docker-entrypoint.sh?

I could be wrong, of course :smile:

fleverest commented 1 year ago

The following seems to work:

docker compose exec zammad-scheduler bash -c "source /docker-entrypoint.sh && rake zammad:searchindex:rebuild
"

So this confirms the console environment doesn't have the required environment variables runs when you add the entrypoint variables manually . I'm not sure if this is the case for previous versions, but I'm certain the following command used to work but now doesn't:

docker compose exec zammad-scheduler rake zammad:searchindex:rebuild
fliebe92 commented 1 year ago

Hi there! Recently, there was a small change that could solve the reported behavior here: https://github.com/zammad/zammad/commit/6dc6b0fae5089a7a81b1a5f107f972b9ca279247

mgruner commented 1 year ago

Should be fixed by #366