Rebuild Index fails on Organizations

Infos:

  • Used Zammad version: 5.1.1
  • Used Zammad installation type: package from apt-repo
  • Operating system: debian bullseye
  • Browser + version: Firefox 100

zammad run rake searchindex:rebuild --trace fails when it tries to reindex Organizations.
** Invoke searchindex:rebuild (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke searchindex:configured (first_time)
** Invoke environment
** Execute searchindex:configured
** Invoke searchindex:version_supported (first_time)
** Invoke environment
** Execute searchindex:version_supported
** 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 User

  • started at 2022-05-13 08:45:31 UTC
    100/2723
    200/2723
    300/2723
    400/2723
    500/2723
    zammad run rake searchindex:rebuild --trace 600/2723
    700/2723
    800/2723
    900/2723
    1000/2723
    1100/2723
    1200/2723
    1300/2723
    1400/2723
    1500/2723
    1600/2723
    1700/2723
    1800/2723
    1900/2723
    2000/2723
    2100/2723
    2200/2723
    2300/2723
    2400/2723
    2500/2723
    2600/2723
    2700/2723
    2723/2723
  • took 19 seconds
    reload Cti::Log
  • started at 2022-05-13 08:45:50 UTC
  • took 0 seconds
    reload Group
  • started at 2022-05-13 08:45:50 UTC
    2/2
  • took 0 seconds
    reload Organization
  • started at 2022-05-13 08:45:50 UTC
    rake aborted!
    Unable to send Organization.find(2327).search_index_update_backend backend: #<NoMethodError: undefined method lookup' for TrueClass:Class> /opt/zammad/app/models/concerns/has_search_index_backend.rb:231:in rescue in block in search_index_reload’
    /opt/zammad/app/models/concerns/has_search_index_backend.rb:225:in block in search_index_reload' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.8/lib/active_record/relation/delegation.rb:88:in each’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.8/lib/active_record/relation/delegation.rb:88:in each' /opt/zammad/config/initializers/active_record_as_batches.rb:27:in as_batches’
    /opt/zammad/config/initializers/active_record_as_batches.rb:44:in as_batches' /opt/zammad/app/models/concerns/has_search_index_backend.rb:223:in search_index_reload’
    /opt/zammad/lib/tasks/search_index_es.rake:50:in block (3 levels) in <main>' /opt/zammad/lib/tasks/search_index_es.rake:46:in each’
    /opt/zammad/lib/tasks/search_index_es.rake:46:in block (2 levels) in <main>' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in block in execute’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in each' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in execute’
    /opt/zammad/lib/tasks/search_index_es.rake:65:in block (2 levels) in <main>' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in block in execute’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in each' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in execute’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in block in invoke_with_call_chain' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in synchronize’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in invoke_with_call_chain' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in invoke’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in invoke_task' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in block (2 levels) in top_level’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in each' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in block in top_level’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in run_with_threads' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in top_level’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in block in run' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in standard_exception_handling’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in run' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in <top (required)>’
    /opt/zammad/vendor/bundle/ruby/2.7.0/bin/rake:23:in load' /opt/zammad/vendor/bundle/ruby/2.7.0/bin/rake:23:in <top (required)>’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in load' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in kernel_load’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:23:in run' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:479:in exec’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:31:in dispatch’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:25:in start’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/exe/bundle:49:in block in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/friendly_errors.rb:103:in with_friendly_errors’
    /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/exe/bundle:37:in <top (required)>' /opt/zammad/bin/bundle:121:in load’
    /opt/zammad/bin/bundle:121:in `’

Caused by:
NoMethodError: undefined method lookup' for TrueClass:Class /opt/zammad/app/models/application_model/can_lookup_search_index_attributes.rb:104:in search_index_value_by_attribute’
/opt/zammad/app/models/application_model/can_lookup_search_index_attributes.rb:66:in block in search_index_attribute_lookup' /opt/zammad/app/models/application_model/can_lookup_search_index_attributes.rb:41:in each’
/opt/zammad/app/models/application_model/can_lookup_search_index_attributes.rb:41:in search_index_attribute_lookup' /opt/zammad/app/models/organization/search_index.rb:8:in search_index_attribute_lookup’
/opt/zammad/app/models/concerns/has_search_index_backend.rb:178:in search_index_update_backend' /opt/zammad/app/models/concerns/has_search_index_backend.rb:226:in block in search_index_reload’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.8/lib/active_record/relation/delegation.rb:88:in each' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.8/lib/active_record/relation/delegation.rb:88:in each’
/opt/zammad/config/initializers/active_record_as_batches.rb:27:in as_batches' /opt/zammad/config/initializers/active_record_as_batches.rb:44:in as_batches’
/opt/zammad/app/models/concerns/has_search_index_backend.rb:223:in search_index_reload' /opt/zammad/lib/tasks/search_index_es.rake:50:in block (3 levels) in ’
/opt/zammad/lib/tasks/search_index_es.rake:46:in each' /opt/zammad/lib/tasks/search_index_es.rake:46:in block (2 levels) in ’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in block in execute' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in each’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in execute' /opt/zammad/lib/tasks/search_index_es.rake:65:in block (2 levels) in ’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in block in execute' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in each’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in execute' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in block in invoke_with_call_chain’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in synchronize' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in invoke_with_call_chain’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in invoke' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in invoke_task’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in block (2 levels) in top_level' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in each’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in block in top_level' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in run_with_threads’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in top_level' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in block in run’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in standard_exception_handling' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in run’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.7.0/bin/rake:23:in load’
/opt/zammad/vendor/bundle/ruby/2.7.0/bin/rake:23:in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in load’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in kernel_load' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:23:in run’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:479:in exec' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:31:in dispatch' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/cli.rb:25:in start' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/exe/bundle:49:in block in <top (required)>’
/opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/lib/bundler/friendly_errors.rb:103:in with_friendly_errors' /opt/zammad/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.33/exe/bundle:37:in <top (required)>’
/opt/zammad/bin/bundle:121:in load' /opt/zammad/bin/bundle:121:in
Tasks: TOP => searchindex:rebuild

I can’t reproduce that.
Please upgrade to the latest possible stable version and try again. Possibly was magically fixed in the mean time. Couldn’t find an issue as well.