# Elasticsearch error in running service JAVA error

**URL:** <https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782>\
**Category:** Elasticsearch\
**Created:** [September 12, 2023, 6:34am UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782 "2023-09-12T06:34:01Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 6:34am UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/1 "2023-09-12T06:34:01Z")

</div>

### systemctl status elasticsearch

```auto
 × elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-09-12 08:24:41 +03; 58min ago
       Docs: https://www.elastic.co
    Process: 2717340 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
   Main PID: 2717340 (code=exited, status=1/FAILURE)
        CPU: 1.479s

12 08:24:41 ubuntu systemd-entrypoint[2717340]: at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
12 08:24:41 ubuntu systemd-entrypoint[2717340]: at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java>
12 08:24:41 ubuntu systemd-entrypoint[2717340]: at java.base/java.nio.file.Files.newInputStream(Files.java:159)
12 08:24:41 ubuntu systemd-entrypoint[2717340]: at java.base/java.nio.file.Files.newBufferedReader(Files.java:2892)
12 08:24:41 ubuntu systemd-entrypoint[2717340]: at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(InternalS>
12 08:24:41 ubuntu systemd-entrypoint[2717340]: ... 6 more
12 08:24:41 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=exited, =1/FAILURE
سبتمبر 12 08:24:41 ubuntu systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
12 08:24:41 ubuntu systemd[1]: Failed to start Elasticsearch.
12 08:24:41 ubuntu systemd[1]: elasticsearch.service: Consumed 1.479s CPU time.

```

### this is the log file

```auto
[2023-09-11T01:30:00,001][INFO][o.e.x.m.MlDailyMaintenanceService] [ubuntu] triggering scheduled [ML] maintenance tasks
[2023-09-11T01:30:00,151][INFO][o.e.x.m.a.TransportDeleteExpiredDataAction] [ubuntu] Deleting expired data
[2023-09-11T01:30:00,154][INFO][o.e.x.m.j.r.UnusedStatsRemover] [ubuntu] Successfully deleted [0] unused stats documents
[2023-09-11T01:30:00,185][INFO][o.e.x.m.a.TransportDeleteExpiredDataAction] [ubuntu] Completed deletion of expired ML data
[2023-09-11T01:30:00,185][INFO][o.e.x.m.MlDailyMaintenanceService] [ubuntu] Successfully completed [ML] maintenance task: triggerDeleteExpiredDataTask
[2023-09-11T03:00:08,782][INFO][o.e.c.m.MetadataCreateIndexService] [ubuntu] [.monitoring-kibana-7-2023.09.11] creating index, cause [auto(bulk api)], templates [.monitoring-kibana], shards [1]/[0]
[2023-09-11T03:00:09,895][INFO][o.e.c.m.MetadataCreateIndexService] [ubuntu] [.monitoring-es-7-2023.09.11] creating index, cause [auto(bulk api)], templates [.monitoring-es], shards [1]/[0]
[2023-09-11T04:29:39,551][INFO][o.e.m.j.JvmGcMonitorService] [ubuntu] [gc][302125] overhead, spent [385ms] collecting in the last [1s]
[2023-09-11T04:30:00,000][INFO][o.e.x.s.SnapshotRetentionTask] [ubuntu] starting SLM retention snapshot cleanup task
[2023-09-11T04:30:00,001][INFO][o.e.x.s.SnapshotRetentionTask] [ubuntu] there are no repositories to fetch, SLM retention snapshot cleanup task complete
[2023-09-11T04:32:32,298][WARN][o.e.c.c.ClusterBootstrapService] [ubuntu] this node is locked into cluster UUID [d_-n9Pq4QduyINJwEgcekQ] but [cluster.initial_master_nodes] is set to [ubuntu]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; for further information see https://www.elastic.co/guide/en/elasticsearch/reference/8.9/important-settings.html#initial_master_nodes
[2023-09-11T08:43:07,468][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.35:49829}
[2023-09-11T09:01:03,011][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.35:50172}
[2023-09-11T09:01:04,078][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.35:50173}
[2023-09-11T09:01:07,336][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.35:50174}
[2023-09-11T10:14:30,922][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52196}
[2023-09-11T10:14:30,926][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52242}
[2023-09-11T10:14:30,928][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52262}
[2023-09-11T10:14:30,927][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52256}
[2023-09-11T10:14:30,923][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52208}
[2023-09-11T10:14:30,929][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52264}
[2023-09-11T10:14:30,925][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52230}
[2023-09-11T10:14:30,924][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52220}
[2023-09-11T10:14:30,953][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52274}
[2023-09-11T10:14:30,954][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52282}
[2023-09-11T10:14:37,551][WARN][o.e.h.AbstractHttpServerTransport] [ubuntu] caught exception while handling client http traffic, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.83:52286}
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:499) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
	at sun.security.ssl.Alert.createSSLException(Alert.java:130) ~[?:?]
	at sun.security.ssl.Alert.createSSLException(Alert.java:117) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:365) ~[?:?]
	at sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:287) ~[?:?]
	at sun.security.ssl.TransportContext.dispatch(TransportContext.java:204) ~[?:?]
	at sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[?:?]
	at sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:736) ~[?:?]
	at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:691) ~[?:?]
	at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:506) ~[?:?]
	at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:482) ~[?:?]
	at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:679) ~[?:?]
	at io.netty.handler.ssl.SslHandler$SslEngineType$3.unwrap(SslHandler.java:297) ~[?:?]
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1353) ~[?:?]
	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1246) ~[?:?]
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1295) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468) ~[?:?]
	... 16 more
[2023-09-11T10:25:37,610][WARN][o.e.h.n.Netty4HttpServerTransport] [ubuntu] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/172.20.10.50:9200, remoteAddress=/172.20.10.35:53018}
[2023-09-11T10:26:23,134][INFO][o.e.n.Node] [ubuntu] stopping ...
[2023-09-11T10:26:23,136][INFO][o.e.c.f.AbstractFileWatchingService] [ubuntu] shutting down watcher thread
[2023-09-11T10:26:23,214][INFO][o.e.c.f.AbstractFileWatchingService] [ubuntu] watcher service stopped
[2023-09-11T10:26:23,217][INFO][o.e.x.w.WatcherService] [ubuntu] stopping watch service, reason [shutdown initiated]
[2023-09-11T10:26:23,218][INFO][o.e.x.w.WatcherLifeCycleService] [ubuntu] watcher has stopped and shutdown
[2023-09-11T10:26:24,239][INFO][o.e.x.m.p.l.CppLogMessageHandler] [ubuntu] [controller/3683359] [Main.cc@176] ML controller exiting
[2023-09-11T10:26:24,494][INFO][o.e.x.m.p.NativeController] [ubuntu] Native controller process has stopped - no new native processes can be started
[2023-09-11T10:26:29,845][INFO][o.e.n.Node] [ubuntu] stopped
[2023-09-11T10:26:29,845][INFO][o.e.n.Node] [ubuntu] closing ...
[2023-09-11T10:26:30,136][INFO][o.e.n.Node] [ubuntu] closed

```

```auto
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: ubuntu
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: Data_Node_1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /var/lib/elasticsearch
path.data: /var/lib/elasticsearch2
#path.data: /var/lib/docker/volumes/docker_esdata/_data/
#path.data: /home/ubuntu/Documents/docker_esdata/_data/
#path.data: /home/ubuntu/Downloads/docker_esdata/_data
#
#action.auto_create_index: +*
#
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
network.host: "localhost"
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["172.20.10.35", "172.20.10.50"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["Master_Node", "Data_Node_1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false

#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 30-08-2023 07:54:47
#
# --------------------------------------------------------------------------------

# Enable security features
xpack.security.enabled: true

xpack.security.enrollment.enabled: true

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
#cluster.initial_master_nodes: ["Master_Node"]

# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0

# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
#transport.host: 0.0.0.0

#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 1:32pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/2 "2023-09-12T13:32:52Z")

</div>

Welcome!

Could you tell what is your question exactly?

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/3 "2023-09-12T13:42:37Z")

</div>

i can't run elasticsearch service

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 1:55pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/4 "2023-09-12T13:55:18Z")

</div>

It seems that it was running until somebody stopped it at `2023-09-11T10:26:29,845`.  
So who stopped it? And why do you think it was not running before that?

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 1:59pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/5 "2023-09-12T13:59:34Z")

</div>

It used to work before yesterday

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 2:11pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/6 "2023-09-12T14:11:10Z")

</div>

I copied the files in data folder and and pasted it in a new elastic instance , when i run the \_cluster/health API got a red status so one or more of my shard does not allocated .  
after reading this document [Cluster Health | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/_cluster_health.html)  
i know the specific shard

how can i change the status of this shard from red to yellow or green  
trying this

```auto
POST /_cluster/reroute?retry_failed=true

```

but does not work  
is there any way to change the cluster health without removing the shard ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 2:15pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/7 "2023-09-12T14:15:40Z")

</div>

So now we are starting to have more details. Thanks. Keep the information coming. The more you share, the easier it will be to help you.

> [@1337](#):
>
> I copied the files in data folder and and pasted it in a new elastic instance

I'm not sure this is supported. You might be missing some files, ownerships....

So apparently, you are now saying that your node is running (as you can post requests to it).  
But this is not conform to:

> i can't run elasticsearch service

So what is the exact status?

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 2:18pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/8 "2023-09-12T14:18:35Z")

</div>

i can't run the elastic as a service so i copied the files in Data folder to another instance and run it now from the elasticsearch-new-instance/bin directory

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 2:42pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/9 "2023-09-12T14:42:14Z")

</div>

Can you help me with this

> [@1337](#):
>
> how can i change the status of this shard from red to yellow or green

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 2:51pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/10 "2023-09-12T14:51:45Z")

</div>

What are the full logs from the new machine?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 2:53pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/11 "2023-09-12T14:53:09Z")

</div>

No. I need first to understand what's the exact status.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 2:53pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/12 "2023-09-12T14:53:52Z")

</div>

> [@1337](#):
>
> i can't run the elastic as a service

Why do you say that?  
It seems that it has been running well.

Could you restart the service? And share the full logs?

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 3:05pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/13 "2023-09-12T15:05:25Z")

</div>

the log after restarting

```auto
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-09-12 18:01:28 +03; 33s ago
       Docs: https://www.elastic.co
    Process: 2803674 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
   Main PID: 2803674 (code=exited, status=1/FAILURE)
        CPU: 2.247s

12 18:01:28 ubuntu systemd-entrypoint[2803674]: at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
12 18:01:28 ubuntu systemd-entrypoint[2803674]: at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.jav>
12 18:01:28 ubuntu systemd-entrypoint[2803674]: at java.base/java.nio.file.Files.newInputStream(Files.java:159)
12 18:01:28 ubuntu systemd-entrypoint[2803674]: at java.base/java.nio.file.Files.newBufferedReader(Files.java:2892)
12 18:01:28 ubuntu systemd-entrypoint[2803674]: at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(Internal>
12 18:01:28 ubuntu systemd-entrypoint[2803674]: ... 6 more
12 18:01:28 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
12 18:01:28 ubuntu systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
12 18:01:28 ubuntu systemd[1]: Failed to start Elasticsearch.
12 18:01:28 ubuntu systemd[1]: elasticsearch.service: Consumed 2.247s CPU time.

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 12, 2023, 3:05pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/14 "2023-09-12T15:05:56Z")

</div>

Could you share Elasticsearch full logs? Not the service logs.

---

<div class="post-metadata">

**Author:** ![1337](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1337/32/125537_2.png) [@1337](https://discuss.elastic.co/u/1337)\
**Post date:** [September 12, 2023, 5:06pm UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/15 "2023-09-12T17:06:14Z")

</div>

Sorry , I'm looking in the var/log/elasticsearch but no logs appear this log from the syslog

```auto
 Starting Elasticsearch...
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: Exception in thread "main" org.elasticsearch.common.settings.SettingsException: Failed to load settings from /etc/elasticsearch/elasticsearch.yml
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(InternalSettingsPreparer.java:128)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:52)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.common.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:110)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.cli.Command.main(Command.java:50)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: Caused by: java.nio.file.AccessDeniedException: /etc/elasticsearch/elasticsearch.yml
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/java.nio.file.Files.newInputStream(Files.java:159)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at java.base/java.nio.file.Files.newBufferedReader(Files.java:2892)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(InternalSettingsPreparer.java:93)
Sep 12 20:03:09 ubuntu systemd-entrypoint[2873212]: #011... 6 more
Sep 12 20:03:09 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Sep 12 20:03:09 ubuntu systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Sep 12 20:03:09 ubuntu systemd[1]: Failed to start Elasticsearch.
Sep 12 20:03:09 ubuntu systemd[1]: elasticsearch.service: Consumed 1.531s CPU time.

```

and this from journalctl

```auto
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: Exception in thread "main" org.elasticsearch.common.settings.SettingsException: Failed to load settings from /etc/elasticsearch/elasticsea>
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(InternalSettingsPreparer.java:128)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:52)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.common.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:110)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.cli.Command.main(Command.java:50)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: Caused by: java.nio.file.AccessDeniedException: /etc/elasticsearch/elasticsearch.yml
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/java.nio.file.Files.newInputStream(Files.java:159)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at java.base/java.nio.file.Files.newBufferedReader(Files.java:2892)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: at org.elasticsearch.node.InternalSettingsPreparer.loadConfigWithSubstitutions(InternalSettingsPreparer.java:93)
 12 19:56:36 ubuntu systemd-entrypoint[2870022]: ... 6 more
 12 19:56:36 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 15, 2023, 4:51am UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/16 "2023-09-15T04:51:26Z")

</div>

```
Failed to load settings from /etc/elasticsearch/elasticsearch.yml

```

Indicates the problem. Check this file and its format. Remember that yaml is very strict in term of indentation for example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 13, 2023, 4:52am UTC](https://discuss.elastic.co/t/elasticsearch-error-in-running-service-java-error/342782/17 "2023-10-13T04:52:02Z")

</div>

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