Error: cannot touch an object that is not persisted at

[2022-01-02T14:26:21.029+00:00][95838][2000][app-server][INFO]: [db_lock] [installation] Status: [Starting] Creating a default Workplace Search organization
    [2022-01-02T14:26:22.023+00:00][95838][2000][app-server][INFO]: [db_lock] [installation] Status: [Failed] Creating a default Workplace Search organization: Error = Actastic::ActasticRecord::ActasticRecordError: cannot touch an object that is not persisted
    [2022-01-02T14:26:22.488+00:00][95838][2158][app-server][WARN]: [db_lock] [installation] Update thread has shut down, skipping the lock update
Unexpected exception while running Enterprise Search:
    Error: cannot touch an object that is not persisted at /server/enterprise-search/lib/war/lib/actastic/actastic_record.class:150:in `touch'
        /server/enterprise-search/lib/war/frito_pie/app/models/frito_pie/group.class:93:in `touch_organization'
/server/enterprise-search/lib/war/gems/gems/activesupport-5.2.6/lib/active_support/callbacks.rb:426:in `block in make_lambda'
        /server/enterprise-search/lib/war/gems/gems/activesupport-5.2.6/lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'
/server/enterprise-search/lib/war/gems/gems/activesupport-5.2.6/lib/active_support/callbacks.rb:517:in `block in invoke_after'
        org/jruby/RubyArray.java:1809:in `each'
/server/enterprise-search/lib/war/gems/gems/activesupport-5.2.6/lib/active_support/callbacks.rb:517:in `invoke_after'
        /server/enterprise-search/lib/war/gems/gems/activesupport-5.2.6/lib/active_support/callbacks.rb:133:in `run_callbacks'
/server/enterprise-search/lib/war/lib/actastic/actastic_record.class:95:in `save'
        /server/enterprise-search/lib/war/lib/actastic/actastic_record.class:107:in `save!'

CentOS 8.3.2011 x86_64(Py3.7.9)

I also got this error in centos 7.6. Ask for help.

[2022-01-05T15:44:38.488+00:00][32433][2002][app-server][INFO]: [db_lock] [installation] Status: [Starting] Creating a default Workplace Search organization
[2022-01-05T15:44:39.419+00:00][32433][2002][app-server][INFO]: [db_lock] [installation] Status: [Failed] Creating a default Workplace Search organization: Error = Actastic::ActasticRecord::ActasticRecordError: cannot touch an object that is not persisted
Unexpected exception while running Enterprise Search:
Error: cannot touch an object that is not persisted at /es/www/wwwroot/server/enterprise-search/lib/war/lib/actastic/actastic_record.class:673:in `touch'

Hi, a few more details would help to investigate your problem:

  • version of Enterprise Search
  • version of Elasticsearch
  • is this self-hosted, or are you running it on Elastic Cloud?

Thank you!

Thank you for your reply

  • Enterprise Search: 7.16.2、7.10.1
  • Elasticsearch: 7.16.2、7.10.1
  • self-hosted
  • The official release version of centos (7.6/8.3).

Elasticsearch can be successfully started and used.
Enterprise Search can successfully connect to Elasticsearch.
However, when it is about to run successfully, Enterprise Search will report an error, causing it to fail to run successfully. Error: cannot touch an object that is not persisted at xxxxx

I tried 7.10.1 and 7.16.1, and both reported the same error. I also tried to switch the SDK to OpenJDK1.8/Oracle 11.0.9.

When the prompt Error: cannot touch an object that is not persisted at xxxxx, I re-run Enterprise Search, it will prompt version conflict, document already exists (current version [2]) index'.ent-search- actastic-clusters'

Hi,

You listed 2 versions of CentOS, then also 2 versions of Elasticsearch and Enterprise Search. Do I understand correctly that you tried it in 2 different configurations?

1st configuration:

  • Centos 7.6
  • Elasticsearch 7.10.1
  • Enterprise Search 7.10.1

2nd configuration:

  • Centos 8.3
  • Elasticsearch 7.16.2
  • Enterprise Search 7.16.2

Do I get this right?

Thank you!

centos 7.6
Elasticsearch 7.10.1 and Enterprise Search 7.10.1
Elasticsearch 7.16.2 and Enterprise Search 7.16.2
centos 8.3
Elasticsearch 7.10.1 and Enterprise Search 7.10.1
Elasticsearch 7.16.2 and Enterprise Search 7.16.2

I have tried them all.

We normally use Open JDK, but you said you tried both Open JDK and Oracle, and the error was the same?

I attempted to reproduce your problem by running Enterprise Search 7.16.2 in docker (using a centos:7 base image), but I couldn't. I created an issue to track it in our internal repository, hopefully we'll find a solution, may require a bit of digging. Thank you for reporting the problem.

One other thing that comes to mind, is it at all possible that more than one Enterprise Search process was running? This sounds like a threading / concurrency issue.

You could try running Enterprise Search with Docker, see if that works:

I can give you the ssh management address and password of my server, so that you can find the reason in the real environment.

I have sent to you my server ssh via private message.