Unable to process GET request to elasticsearch URL 'http://127.0.0.1:9200/zammad_production/Ticket/_search'

Good morning,
when I open the statistic page in my zammad GUI, I get the following error message:

{“error”:“Unable to process GET request to elasticsearch URL ‘http://127.0.0.1:9200/zammad_production/Ticket/_search’. Elasticsearch is not reachable, probably because it’s not running or even installed.\n\nResponse:\n#\u003cUserAgent::Result:0x000055edc972e360 @success=false, @Body=nil, @DaTa=nil, @code=0, @content_type=nil, @error=”#\u003cErrno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:9200 (Connection refused - connect(2) for “127.0.0.1” port 9200)\u003e"\u003e\n\nPayload:\n{:query=\u003e{:bool=\u003e{:must=\u003e[{:range=\u003e{“created_at”=\u003e{:from=\u003e"2018-01-01", :to=\u003e"2018-12-31"}}}], :must_not=\u003e[{:term=\u003e{“state”=\u003e"merged"}}]}}, :size=\u003e0, :aggs=\u003e{:time_buckets=\u003e{:date_histogram=\u003e{:field=\u003e"created_at", :interval=\u003e"month"}}}}\n\nPayload size: 0M"}

I’m opening the zammad GUI on my client, zammad is running on a server with IP 192.168.75.63.

When I login to a console as root and enter the following statement:
zammad run rails r “Setting.set(‘es_url’, ‘http://192.168.75.63:9200’)”
everything is working fine and I can open the statistic pages.

But after the next zammad update, it is starting at the beginning and I get the error message again.

Is there a possibility to set es_url to http://192.168.75.63:9200 permanently?

In my /etc/elasticsearch/elasticsearch.yml, I already entered the lines:

---------------------------------- Network -----------------------------------
Set the bind address to a specific IP (IPv4 or IPv6):
network.host: 192.168.75.63

Set a custom port for HTTP:
http.port: 9200

For more information, consult the network module documentation.

Good morning @gunnix

Could you try:
zammad run rake searchindex:rebuild --trace

Greatings

My file has only # comments.
I would like to see your /etc/elasticsearch/elasticsearch.yml,

If you look in
https://docs.zammad.org/en/latest/install-elasticsearch.html

zammad run rails r “Setting.set(‘es_url’, ‘http://localhost:9200’)”

You can try your URL
with

zammad run rails r “Setting.set(‘es_url’, ‘’)”

you disable it.

zammad run rake searchindex:rebuild --trace delivers the same error. elasticsearch is not reachable:

** Invoke searchindex:rebuild (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute searchindex:rebuild
** Execute searchindex:drop
drop indexes…done
** Execute searchindex:drop_pipeline
rake aborted!
Unable to process GET request to elasticsearch URL ‘http://localhost:9200’. Elas ticsearch is not reachable, probably because it’s not running or even installed.

Response:
#<UserAgent::Result:0x000055be5f77a240 @success=false, @body=nil, @data=nil, @co de=0, @content_type=nil, @error="#<Errno::ECONNREFUSED: Failed to open TCP conne ction to localhost:9200 (Connection refused - connect(2) for “localhost” port 9200)>">

Payload:
nil

Payload size: 0M
/opt/zammad/lib/search_index_backend.rb:37:in info' /opt/zammad/lib/tasks/search_index_es.rake:128:inblock (2 levels) in <top (req uired)>’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in b lock in execute' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:ine ach’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in e xecute' /opt/zammad/lib/tasks/search_index_es.rake:14:inblock (2 levels) in <top (requ ired)>’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in b lock in execute' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:ine ach’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in e xecute' /opt/zammad/lib/tasks/search_index_es.rake:165:inblock (2 levels) in <top (req uired)>’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in b lock in execute' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:ine ach’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:251:in e xecute' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:195:inb lock in invoke_with_call_chain’
/opt/zammad/vendor/ruby-2.4.2/lib/ruby/2.4.0/monitor.rb:214:in mon_synchronize' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:188:ini nvoke_with_call_chain’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/task.rb:181:in i nvoke' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:16 0:ininvoke_task’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:11 6:in block (2 levels) in top_level' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:11 6:ineach’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:11 6:in block in top_level' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:12 5:inrun_with_threads’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:11 0:in top_level' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:83 :inblock in run’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:18 6:in standard_exception_handling' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/lib/rake/application.rb:80 :inrun’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/exe/rake:27:in <top (requ ired)>' /opt/zammad/vendor/bundle/ruby/2.4.0/bin/rake:22:inload’
/opt/zammad/vendor/bundle/ruby/2.4.0/bin/rake:22:in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb :74:inload’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb :74:in kernel_load' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb :27:inrun’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:360: in exec' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor /lib/thor/command.rb:27:inrun’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor /lib/thor/invocation.rb:126:in invoke_command' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor /lib/thor.rb:369:indispatch’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:20:i n dispatch' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor /lib/thor/base.rb:444:instart’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:10:i n start' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/exe/bundle:35:inblock in <top (required)>’
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/lib/bundler/friendly_er rors.rb:121:in with_friendly_errors' /opt/zammad/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.1/exe/bundle:27:in<top (required)>’
/opt/zammad/bin/bundle:3:in load' /opt/zammad/bin/bundle:3:in
Tasks: TOP => searchindex:rebuild

After changing the es_url with zammad run rails r “Setting.set(‘es_url’, ‘http://192.168.75.63:9200’)”
it is working:
** 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 Chat::Session

  • started at 2018-04-27 08:28:02 UTC
  • took 0 seconds
    reload Ticket
  • started at 2018-04-27 08:28:02 UTC
  • took 43 seconds
    reload Organization
  • started at 2018-04-27 08:28:46 UTC
  • took 0 seconds
    reload User
  • started at 2018-04-27 08:28:46 UTC
  • took 1 seconds

@Trenga: You was right, after uncommenting the entries in my /etc/elasticsearch/elasticsearch.yml
and setting es_url back to localhost via zammad run rails r “Setting.set(‘es_url’, ‘http://localhost:9200’)”
everything is fine now. Thanks for your support.

You are welcome. Nice weekend.

If you are running Ubuntu 16.04 and get this issue, here is the fix: https://doc.ubuntu-fr.org/elasticsearch

Please let me know what has to be uncomment here.

I have the same problem

In my /etc/elasticsearch/elasticsearch.yml all lines are uncommented. If you changed this, run the command zammad run rails r “Setting.set(‘es_url’, ‘http://localhost:9200’)” as root and elasticsearch should work

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