Can't seem to reindex Zammad docker compose stack

I’m running Zammad 6.4.0-26 using the official docker compose setup.

I can’t seem to initiate a reindex of Elasticsearch from the command line following the instructions here: Install with Docker — Zammad System Documentation documentation

From the host machine running the docker stack, I’m running the following command:

docker exec zammad-docker-compose-zammad-railsserver-1 /docker-entrypoint.sh rails r 'rake zammad:searchindex:rebuild'

I receive the following error in response:

Please specify a valid ruby command or the path of a script to run.
Run 'bin/rails runner -h' for help.

/usr/local/bundle/gems/railties-7.1.4.1/lib/rails/commands/runner/runner_command.rb:46: syntax error, unexpected label, expecting end-of-input
rake zammad:searchindex:rebuild
            ^~~~~~~~~~~~

The other command options in the documentation also return similar errors. Has the way to do this changed recently?

I suppose the other workaround would be to set ELASTICSEARCH_REINDEX to true in my .env but that’s a slightly clunky approach as I’ll have to remove it once the indexing is done and I don’t think I can limit the number of cores it uses.

Solved it.

I found the rebuild command in docker-entrypoint.sh and modified it slightly to run from the host machine terminal. The following command ended up working:

docker exec zammad-docker-compose-zammad-railsserver-1 /docker-entrypoint.sh bundle exec rake zammad:searchindex:rebuild

You can also modify the end of the command to limit the number of CPU cores used so that the application is still usable while indexing is taking place e.g. ...zammad:searchindex:rebuild[8] to limit it to 8 cores for example.

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