Can' rebuild elasticsearch index

Infos:

  • Used Zammad version: 6.3
  • Used Zammad installation type: source
  • Operating system: Ubuntu
  • Browser + version: 20.04.6 LTS

Expected behavior:

  • Rebuild of ElasticSearch-Indices

Actual behavior:

  • zammad run rake zammad:searchindex:rebuild --trace

** Invoke zammad:searchindex:rebuild (first_time)
** Invoke zammad:searchindex:version_supported (first_time)
** Invoke zammad:searchindex:configured (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute zammad:searchindex:configured
** Execute zammad:searchindex:version_supported
rake aborted!
Unable to process GET request to elasticsearch URL ā€˜[https]://localhost:9200ā€™. Check the response and payload for detailed information:

([https] was modified by me cause of no links in topics)

Response:
#<UserAgent::Result:0x00007f1947f98208 @success=false, @body=nil, @data=nil, @code=0, @content_type=nil, @error=ā€œ#<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 peeraddr=127.0.0.1:9200 state=error: wrong version number>ā€, @header=nil>

Payload:
null

Payload size: 0M
/opt/zammad/lib/search_index_backend.rb:36:in info' /opt/zammad/lib/tasks/zammad/search_index_es.rake:64:in block (3 levels) in ā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:281:in block in execute' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:281:in eachā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:281:in execute' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:219:in block in invoke_with_call_chainā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in synchronize' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in invoke_with_call_chainā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:243:in block in invoke_prerequisites' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:241:in eachā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:241:in invoke_prerequisites' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:218:in block in invoke_with_call_chainā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in synchronize' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in invoke_with_call_chainā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:188:in invoke' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:182:in invoke_taskā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in block (2 levels) in top_level' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in eachā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in block in top_level' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:147:in run_with_threadsā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:132:in top_level' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:83:in block in runā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:208:in standard_exception_handling' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:80:in runā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/exe/rake:27:in <top (required)>' /opt/zammad/vendor/bundle/ruby/3.2.0/bin/rake:25:in loadā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/bin/rake:25:in <top (required)>' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in loadā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in kernel_load' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:23:in runā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli.rb:492:in exec' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/command.rb:28:in runā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor.rb:527:in dispatchā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli.rb:34:in dispatch' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/base.rb:584:in startā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/cli.rb:28:in start' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/exe/bundle:37:in block in <top (required)>ā€™
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/lib/bundler/friendly_errors.rb:117:in with_friendly_errors' /opt/zammad/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.22/exe/bundle:29:in <top (required)>ā€™
/opt/zammad/bin/bundle:121:in load' /opt/zammad/bin/bundle:121:in ā€™
Tasks: TOP => zammad:searchindex:rebuild => zammad:searchindex:version_supported

Steps to reproduce the behavior:

  • zammad run rake zammad:searchindex:rebuild

Currently ElasticSearch does not work anymore.
Tried this: /opt/zammad/contrib/packager.io/postinstall.sh
but without any effort.

The only hint i found was ā€œSSLError: SSL_connect returned=1ā€ and ā€œwrong version foundā€ in the response string.

My Zammad-site is still working with a certificate, does elasticsearch need it again?
How to put it in?

Any hints appreciated.

Regards
Frank

What Elasticsearch version are you using? Quite an important piece of information if you have issues with ES.

elasticsearch/stable,now 7.17.20 amd64 [installed]
zammad/unknown,now 6.3.0-1713332260.1e2f95d3.focal amd64 [installed]

just updated as the complete Ubuntu-Server and Zammd via apt upgrade

Hi @FrankB,

the OpensSSL error message is misleading. Your ES server does not serve via HTTPS.

1 Like

Your issue is caused by a documentation bug:

run rails r "Setting.set('es_url', 'http://localhost:9200') and youā€™ll be fine.

sorry, iā€™m not allowed to answer with urls

how to mask an URL in a post, so that i can do a reply?

You now have permission to. New users are not allowed becauseā€¦ spammer bots love to post URLs.

ok done (i have to edit all URLs in this post, cause real ones are forbidden)
in /etc/elasticsearch/elasticsearch.yml the ip and http-ports are commented out

sudo service elasticsearch restart

verified, its working on http
curl -XGET ā€˜http://localhost:9200ā€™
{
ā€œnameā€ : ā€œzammadā€,
ā€œcluster_nameā€ : ā€œelasticsearchā€,
ā€œcluster_uuidā€ : ā€œyCgxm95uR4-uIIihzHGm0Qā€,
ā€œversionā€ : {
ā€œnumberā€ : ā€œ7.17.20ā€,
ā€œbuild_flavorā€ : ā€œdefaultā€,
ā€œbuild_typeā€ : ā€œdebā€,
ā€œbuild_hashā€ : ā€œb26557f585b7d95c71a5549e571a6bcd2667697dā€,
ā€œbuild_dateā€ : ā€œ2024-04-08T08:34:31.070382898Zā€,
ā€œbuild_snapshotā€ : false,
ā€œlucene_versionā€ : ā€œ8.11.3ā€,
ā€œminimum_wire_compatibility_versionā€ : ā€œ6.8.0ā€,
ā€œminimum_index_compatibility_versionā€ : ā€œ6.0.0-beta1ā€
},
ā€œtaglineā€ : ā€œYou Know, for Searchā€
}

on https is nothing, (thats what we want)
curl -XGET ā€˜https://localhost:9200ā€™
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

but why is this still looking for https?
zammad run rake zammad:searchindex:rebuild
rake aborted!
Unable to process GET request to elasticsearch URL ā€˜https://localhost:9200ā€™. Check the response and payload for detailed information

the post-install-script has written some advices, one is with https:
/opt/zammad/contrib/packager.io/postinstall.sh

# Enforcing Redisā€¦
# Creating Redis bootstart
Synchronizing state of redis-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable redis-server
# Starting Redis server
# Redis server is running.
# (Re)creating init scripts
Nothing to do.
Nothing to do.
Nothing to do.
# Enabling Zammad on boot
# Stopping Zammad
# Clear cacheā€¦
# database.yml found. Updating dbā€¦
# Updating translationsā€¦
# No custom packages detectedā€¦
# Configuring Elasticsearchā€¦
ā†’ removing [ingest-attachment]ā€¦
ā†’ Installing ingest-attachment
ā†’ Downloading ingest-attachment from elastic
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
See Permissions in the JDK
for descriptions of what these permissions allow and the associated risks.
ā†’ Installed ingest-attachment
ā†’ Please restart Elasticsearch to activate any plugins installed
**It seems youā€™re running an external Elasticsearch server on https://localhost:9200
Weā€™ll not touch your Elasticsearch on the local and remote system.
Please get sure to install the ā€˜ingest-attachmentā€™ plugin on your Elasticsearch server by:
/usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment
After this you might need to rebuild the searchindex by:
zammad run rake zammad:searchindex:rebuild
# Enforcing 0600 on database.yml ā€¦
# Starting Zammad
# Creating webserver bootstart
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
# Restarting webserver nginx
####################################################################################
Add your fully qualified domain name or public IP to servername directive of
nginx, if this installation is done on a remote server. You have to change:
/etc/nginx/sites-available/zammad.conf and restart nginx process.
Otherwise just open http://localhost/ in your browser to start using Zammad.
####################################################################################

do i have to edit something else for that rake-command?

Youā€™re mixing topics.
You show curls not a rebuild try.

If youā€™re just run my command I provided, a rebuild should be possible if thatā€™s what you want to do. I canā€™t follow sorry.

Sorry,
curl was used only for verifying

next try:
first (again)
zammad run rails r ā€œSetting.set(ā€˜es_urlā€™, ā€˜http://localhost:9200ā€™)ā€
than
zammad run rake zammad:searchindex:rebuild
Dropping indexesā€¦ done.
Deleting pipelineā€¦ done.
Creating indexesā€¦ done.
Creating pipelineā€¦ 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 2 seconds.
  • KnowledgeBase::Category::Translationā€¦
    done in 0 seconds.
  • KnowledgeBase::Translationā€¦
    done in 0 seconds.
  • Organizationā€¦
    done in 1 seconds.
  • StatsStoreā€¦
    done in 1 seconds.
  • Ticket::Priorityā€¦
    done in 0 seconds.
  • Ticket::Stateā€¦
    done in 0 seconds.
  • Ticketā€¦
    done in 317 seconds.
  • Userā€¦
    done in 16 seconds.

Now it seem to work again.
The Zammad search finds tickets and contacts again.

GREAT and MANY THANKS,
as we say in Germany: you rescued my head

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