Error - Search Index Rebuild not working

  • Used Zammad version: 3.1
  • Operating system: CentOS 7

We can not update our search index anymore.
The command zammad run rake searchindex: rebuild --trace only makes errors.

[root@svsraa0011 ~]# zammad run rake searchindex:rebuild --trace
** Invoke searchindex:rebuild (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute searchindex:rebuild
** Execute searchindex:drop
drop indexes...done
** Execute searchindex:drop_pipeline
delete pipeline (pipeline)... done
** Execute searchindex:create
create indexes...done
** Execute searchindex:create_pipeline
create pipeline (pipeline)... done
** Execute searchindex:reload
reload data...
 reload Ticket
  - started at 2019-11-28 10:50:14 UTC
rake aborted!
Unable to send Ticket.find(1855).search_index_update_backend backend: #<RuntimeError: Unable to process POST request to elasticsearch URL 'http://localhost:9200/zammad_production/Ticket/1855?pipeline=zammad252575312209'. Elasticsearch is not reachable, probably because it's not running or even installed.

Response:
#<UserAgent::Result:0x000055883679f220 @success=false, @body=nil, @data=nil, @code=0, @content_type=nil, @error="#<Errno::ECONNREFUSED: Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for \"localhost\" port 9200)>">

Payload size: 0M
/opt/zammad/lib/search_index_backend.rb:230:in `add'
/opt/zammad/app/models/concerns/has_search_index_backend.rb:66:in `search_index_update_backend'
/opt/zammad/app/models/concerns/has_search_index_backend.rb:140:in `block in search_index_reload'
/opt/zammad/app/models/concerns/has_search_index_backend.rb:134:in `each'
/opt/zammad/app/models/concerns/has_search_index_backend.rb:134:in `search_index_reload'
/opt/zammad/lib/tasks/search_index_es.rake:143:in `block (3 levels) in <main>'
/opt/zammad/lib/tasks/search_index_es.rake:139:in `each'
/opt/zammad/lib/tasks/search_index_es.rake:139:in `block (2 levels) in <main>'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/opt/zammad/lib/tasks/search_index_es.rake:153:in `block (2 levels) in <main>'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/opt/zammad/vendor/bundle/ruby/2.5.0/bin/rake:23:in `load'
/opt/zammad/vendor/bundle/ruby/2.5.0/bin/rake:23:in `<top (required)>'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/opt/zammad/bin/bundle:3:in `load'
/opt/zammad/bin/bundle:3:in `<main>'
Tasks: TOP => searchindex:rebuild

Can someone please help here?

Thanks Marc

Hey Marc,

Well looks like your Elasticsearch is no longer running.
As this happens instandly when touching tickets, I guess you upgraded your Elasticsearch and forgot about the attachment plugin which needs to be updated as well:
https://docs.zammad.org/en/latest/install-elasticsearch.html

Bests

Hello,

thanks for the reply - i checked my system. The only thing i did was a CentOS update with yum update && yum upgrade.

Elasticsearch Version is 5.6.16
[root@svsraa0011 ~]# curl -XGET 127.0.0.1:9200
{
“name” : “YEY4Cb3”,
“cluster_name” : “elasticsearch”,
“cluster_uuid” : “FXVhWIIvTbCg1FBtaaU78Q”,
“version” : {
“number” : “5.6.16”,
“build_hash” : “3a740d1”,
“build_date” : “2019-03-13T15:33:36.565Z”,
“build_snapshot” : false,
“lucene_version” : “6.6.1”
},
“tagline” : “You Know, for Search”
}

Elasticsearch is also up and running
[root@svsraa0011 ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Do 2019-11-28 14:59:03 CET; 5min ago
Docs: http://www.elastic.co
Process: 17039 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 17040 (java)
CGroup: /system.slice/elasticsearch.service
└─17040 /bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupan…

Ingest-Attachment plugin is installed
[root@svsraa0011 ~]# sudo /usr/share/elasticsearch/bin/elasticsearch-plugin list
ingest-attachment

Still not working - any other help ?

Thanks Marc

Still Ticket ID 1855?

Run the following and provide the output (in code tags, please), please:

Ticket.find(1855).search_index_update_backend