Job for opensearch.service failed because a timeout was exceeded

I tried to try to give more permissions to read and write for the following file /var/log/opensearch/opensearch.log but every time I get the same error.

$ sudo systemctl daemon-reload
$ sudo systemctl enable opensearch.service
Synchronizing state of opensearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable opensearch
$ sudo systemctl start opensearch
Job for opensearch.service failed because a timeout was exceeded.
See "systemctl status opensearch.service" and "journalctl -xeu opensearch.service" for details.
$ sudo systemctl status opensearch.service
Γ— opensearch.service - OpenSearch
     Loaded: loaded (/lib/systemd/system/opensearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Tue 2024-02-27 09:45:19 UTC; 8min ago
       Docs: https://opensearch.org/
    Process: 185867 ExecStart=/usr/share/opensearch/bin/systemd-entrypoint -p ${PID_DIR}/opensearch.pid --quiet (code=ex>
   Main PID: 185867 (code=exited, status=143)
        CPU: 43.135s

Feb 27 09:44:20 graylog systemd-entrypoint[185867]:         at org.opensearch.cli.EnvironmentAwareCommand.execute(Enviro>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]:         at org.opensearch.cli.Command.mainWithoutErrorHandling(Comma>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]:         at org.opensearch.cli.Command.main(Command.java:101)
Feb 27 09:44:20 graylog systemd-entrypoint[185867]:         at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]:         at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: For complete error details, refer to the log at /var/log/opensearch/>
Feb 27 09:45:18 graylog systemd[1]: opensearch.service: start operation timed out. Terminating.
Feb 27 09:45:19 graylog systemd[1]: opensearch.service: Failed with result 'timeout'.
Feb 27 09:45:19 graylog systemd[1]: Failed to start OpenSearch.
Feb 27 09:45:19 graylog systemd[1]: opensearch.service: Consumed 43.135s CPU time.
lines 1-18/18 (END)

Hey @KamiKaramazov

What does journalctl -xeu opensearch.service show?

$ journalctl -xeu opensearch.service
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.ja>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.cli.EnvironmentAwareCommand.execute(Enviro>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.cli.Command.mainWithoutErrorHandling(Comma>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.cli.Command.main(Command.java:101)
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]:         at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: For complete error details, refer to the log at /var/log/opensearch/>
Feb 28 07:56:44 graylog systemd[1]: opensearch.service: start operation timed out. Terminating.
Feb 28 07:56:45 graylog systemd[1]: opensearch.service: Failed with result 'timeout'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ The unit opensearch.service has entered the 'failed' state with result 'timeout'.
Feb 28 07:56:45 graylog systemd[1]: Failed to start OpenSearch.
β–‘β–‘ Subject: A start job for unit opensearch.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ A start job for unit opensearch.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 1018759 and the job result is failed.
Feb 28 07:56:45 graylog systemd[1]: opensearch.service: Consumed 47.640s CPU time.
β–‘β–‘ Subject: Resources consumed by unit runtime
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ The unit opensearch.service completed and consumed the indicated resources.

You may need to scroll up on journalctl. Looks like the tail end of the log. If you could show any configurations that would help. How did you install opensearch?

Those are the command I used to install opensearch:

wget --inet4-only https://artifacts.opensearch.org/releases/bundle/opensearch/2.5.0/opensearch-2.5.0-linux-x64.deb

sudo dpkg -i opensearch-2.5.0-linux-x64.deb

sudo nano /etc/opensearch/opensearch.yml

action.auto_create_index: false
plugins.security.disable: true

sudo systemctl daemon-reload
sudo systemctl enable opensearch.service
sudo systemctl start opensearch
sudo systemctl status opensearch

Also I followed this video : https://youtu.be/O83aKtv1ZJI?t=388

It should be

plugins.security.disabled: true
1 Like

Thanks for help! Following your solution, it got fixed. I really don’t understand how I missed something like that. From now on, I’ll pay attention to everything I write :smile:

1 Like