User elasticsearch lost after reboot

I have installed Elasticsearch on TrueNAS using dpkg.
I have setup fs2es-indexer to index my files.
I have indexed the files and tested that all works.

After reboot, the user elasticsearch is lost.

id elasticsearch
id: ‘elasticsearch’: no such user

I have reinstall Elasticsearch via dpkg again and run the following commands to get it working.

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

And now if I run id I the results below.

id elasticsearch
uid=128(elasticsearch) gid=132(elasticsearch) groups=132(elasticsearch)

Can someone please guide to fix this issue.

installation file is elasticsearch-8.6.1-amd64.deb

Welcome to our community! :smiley:

FYI Truenas isn't a supported OS, so there may be something it has done. Is there anything in the OS logs that might be related?

Thanks for the quick reply.

Forgot to clarify that this is installed on TrueNAS Scale which is a debian based distribution.

This is what I get from more syslog | grep elasticsearch

elasticsearch.service: Consumed 1min 38.836s CPU time.
Feb  7 10:15:20 truenas systemd-tmpfiles[3859]: /usr/lib/tmpfiles.d/elasticsearch.conf:1: Failed to resolve user 'elasticsearch': No such file or directory
Feb  7 10:15:20 truenas systemd[3922]: elasticsearch.service: Failed to determine user credentials: No such file or directory
Feb  7 10:15:20 truenas systemd[3922]: elasticsearch.service: Failed at step USER spawning /usr/share/elasticsearch/bin/systemd-entrypoint: No such file or directory
Feb  7 10:15:20 truenas systemd[1]: elasticsearch.service: Main process exited, code=exited, status=217/USER
Feb  7 10:15:20 truenas systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

It is debian based, but it behaves like an appliance and you should not use it as it was a normal debian server.

You need to check on with the TrueNAS community, your issue is not with elasticsearch.

As an example, on this post about adding packages you have this comment:

TrueNAS is not intended to be a general purpose system for you to manipulate as you see fit. It is an appliance, and is carefully designed to accomplish a particular function. You are not supposed to be running "apt", or adding packages, or making changes to the system, unless you are able to do this through the GUI's configuration options or the API.

I do not use TrueNAS, but if I got it right you should be able to run elasticsearch using containers.

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