Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 6.0: elasticsearch not configured #358

Closed
ggruening opened this issue Jun 27, 2023 · 4 comments
Closed

Version 6.0: elasticsearch not configured #358

ggruening opened this issue Jun 27, 2023 · 4 comments

Comments

@ggruening
Copy link

Infos

  • Podman version: 3.4.4 (the problem is not related to podman, zammad stack v9.0.1 (zammad 5.4.1-29) is working perfectly
  • Podman-compose version: 1.0.3 ((the problem is not related to podman-compose, zammad stack v9.0.1 (zammad 5.4.1-29) is working perfectly
  • Operating system (Docker host): Ubuntu 22.04 LTS

Expected behavior

  • elasticsearch is configured and connected to zammad

Actual behavior

  • elasticsearch seems to be gone after zammad-init is finished. zammad-init does sucessfully rebuilding searchindexes,...
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.                    
  • but when the system is up and running, you can't trigger a rebuild anymore. zammad-elasticsearch is still up and running without errors, but it seems, that elasticsearch is gone somehow:
$ 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.
  • I tried to connect elasticsearch to zammad, it gives me this:
$ podman-compose exec zammad-scheduler rails r "p Setting.set('es_url', 'http://zammad-elasticsearch:9200')"
I, [2023-06-27T20:59:14.397657 #33]  INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-06-27T20:59:14.402765#33-5380]  INFO -- : Using memcached as Rails cache store.
I, [2023-06-27T20:59:14.402811#33-5380]  INFO -- : Using the Redis back end for Zammad's web socket session store.
/opt/zammad/app/models/setting.rb:38:in `set': Can't find config setting 'es_url' (RuntimeError)
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/commands/runner/runner_command.rb:45:in `<main>'
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/commands/runner/runner_command.rb:45:in `eval'
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/commands/runner/runner_command.rb:45:in `perform'
        from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/command/base.rb:69:in `perform'
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/command.rb:48:in `invoke'
        from /usr/local/bundle/gems/railties-6.1.7.3/lib/rails/commands.rb:18:in `<main>'
        from /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from bin/rails:5:in `<main>'

Steps to reproduce the behavior

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

Gregor

@fleverest
Copy link

fleverest commented Jun 28, 2023

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 😄

@fleverest
Copy link

fleverest commented Jun 30, 2023

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
Copy link

Hi there! Recently, there was a small change that could solve the reported behavior here: zammad/zammad@6dc6b0f

@mgruner
Copy link
Collaborator

mgruner commented Aug 23, 2023

Should be fixed by #366

floriankessler pushed a commit to floriankessler/zammad-docker-compose that referenced this issue Jan 5, 2024
…x passing of database credentials to containers

* Fix passing of database credentials to containers.

* Bump Zammad image version in .env.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants