# Elasticsearch unable to start

**URL:** <https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824>\
**Category:** Elasticsearch\
**Created:** [June 17, 2015, 11:03am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824 "2015-06-17T11:03:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![neethal](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@neethal](https://discuss.elastic.co/u/neethal)\
**Post date:** [June 17, 2015, 11:03am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/1 "2015-06-17T11:03:00Z")

</div>

Hello,  
I am not able to start the elasticsearch 1.4.5 in linux. i get the below error.

log4j:ERROR setFile(null,true) call failed.  
java.io.FileNotFoundException: /var/log/elasticsearch/elasticsearch.log (Permission denied)  
at java.io.FileOutputStream.open(Native Method)  
at java.io.FileOutputStream.(FileOutputStream.java:221)  
at java.io.FileOutputStream.(FileOutputStream.java:142)  
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)  
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)  
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)  
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)  
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)  
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)  
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)  
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)  
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:105)  
at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:94)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:178)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
log4j:ERROR Either File or DatePattern options are not set for appender [file].  
log4j:ERROR setFile(null,true) call failed.  
java.io.FileNotFoundException: /var/log/elasticsearch/elasticsearch\_index\_indexing\_slowlog.log (Permission denied)  
at java.io.FileOutputStream.open(Native Method)  
at java.io.FileOutputStream.(FileOutputStream.java:221)  
at java.io.FileOutputStream.(FileOutputStream.java:142)  
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)  
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)  
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)  
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)  
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)  
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)  
at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672)  
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516)  
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:105)  
at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:94)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:178)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
log4j:ERROR Either File or DatePattern options are not set for appender [index\_indexing\_slow\_log\_file].  
log4j:ERROR setFile(null,true) call failed.  
java.io.FileNotFoundException: /var/log/elasticsearch/elasticsearch\_index\_search\_slowlog.log (Permission denied)  
at java.io.FileOutputStream.open(Native Method)  
at java.io.FileOutputStream.(FileOutputStream.java:221)  
at java.io.FileOutputStream.(FileOutputStream.java:142)  
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)  
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)  
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)  
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)  
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)  
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)  
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)  
at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672)  
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516)  
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:105)  
at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:94)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:178)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
log4j:ERROR Either File or DatePattern options are not set for appender [index\_search\_slow\_log\_file].

Any help ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 17, 2015, 11:36am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/2 "2015-06-17T11:36:45Z")

</div>

> [@neethal](#):
>
> /var/log/elasticsearch/elasticsearch.log (Permission denied)

It seems like Elasticsearch does not have write permissions to its log directory. Can you verify that the user you are running Elasticsearch under have access to that directory?

---

<div class="post-metadata">

**Author:** ![neethal](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@neethal](https://discuss.elastic.co/u/neethal)\
**Post date:** [June 17, 2015, 2:33pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/3 "2015-06-17T14:33:05Z")

</div>

Hello,  
I missed to add tthis info in my first post.

There is no permission issue. I am running as root user and have got full rights to all thos folders.

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [June 17, 2015, 2:42pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/4 "2015-06-17T14:42:46Z")

</div>

How did you install Elasticsearch? Using the tar.gz/zip, the deb or the rpm?

Also what command are you running to start Elasticsearch?

I ask because if you install Elasticsearch using the rpm or the deb and start it as a service then it will probably be running as a user called 'elasticsearch' as the deb/rpm both create a dedicated user to run Elasticsearch. If this is the case it will be throwing the error because the 'elasticsearch' user does not have access to `/var/log/elasticsearch/elasticsearch_index_indexing_slowlog.log`

---

<div class="post-metadata">

**Author:** ![neethal](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@neethal](https://discuss.elastic.co/u/neethal)\
**Post date:** [June 17, 2015, 2:59pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/5 "2015-06-17T14:59:11Z")

</div>

i followed the below steps to install .

1. vi /etc/yum.repos.d/elasticsearch.repo

[elasticsearch-1.4]  
name=Elasticsearch repository for 1.4.x packages  
baseurl=http://packages.elasticsearch.org/elasticsearch/1.4/centos  
gpgcheck=1  
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch  
enabled=1

1. yum install elasticsearch

i start elasticsearch like - " service elasticsearch start "

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [June 17, 2015, 3:12pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/6 "2015-06-17T15:12:48Z")

</div>

Ok so that will have installed the rpm package for Elasticsearch. It will have created an `elasticsearch` user on your linux OS and when you start the Elasticsearch service it will be running as the `elasticsearch` user. The problem you are encountering will be that the `elasticsearch` user does not have permission to write to `/var/log/elasticsearch` or the files inside it.

---

<div class="post-metadata">

**Author:** ![neethal](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@neethal](https://discuss.elastic.co/u/neethal)\
**Post date:** [June 17, 2015, 4:01pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/7 "2015-06-17T16:01:40Z")

</div>

thanks for the info.. it worked now.. after giving the write permission to the folder 😄

---

<div class="post-metadata">

**Author:** ![alvaroca1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@alvaroca1](https://discuss.elastic.co/u/alvaroca1)\
**Post date:** [August 10, 2016, 7:08pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/8 "2016-08-10T19:08:15Z")

</div>

Neetal how did you resolved this issue? can you let me know the commands used?

---

<div class="post-metadata">

**Author:** ![Rinat](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@Rinat](https://discuss.elastic.co/u/Rinat)\
**Post date:** [January 10, 2017, 6:58pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/9 "2017-01-10T18:58:43Z")

</div>

I'm confused. I had elasticsearch running fine. Then after reboot it fails to start. I get errors, but it seems that there is permission issue. I gave /var/log/elasticsearch read/write permissions and it didn't solve the problem. Then I gave /var/log read/write permissions but it still wouldn't start saying permission denied. I'm confused. Any ideas out there?

Thanks

Starting elasticsearch: 2017-01-10 13:42:23,909 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch.log java.io.IOException: Permission denied

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 30, 2017, 6:26am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/11 "2017-01-30T06:26:49Z")

</div>

@ki_ran, please start a new thread for your unrelated question. (And do read the error message. It's pretty clear on what the problem is.)

---

<div class="post-metadata">

**Author:** ![Nanhe\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nanhe_kumar/32/18650_2.png) [@Nanhe\_Kumar](https://discuss.elastic.co/u/Nanhe_Kumar)\
**Post date:** [June 21, 2017, 1:38pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/13 "2017-06-21T13:38:29Z")

</div>

I have solved bellow issue  
main ERROR RollingFileManager (/home/ubuntu/elasticsearch-5.4.1/logs/elasticsearch.log) java.io.FileNotFoundException: /home/ubuntu/elasticsearch-5.4.1/logs/elasticsearch.log (Permission denied) java.io.FileNotFoundException: /home/ubuntu/elasticsearch-5.4.1/logs/elasticsearch.log (Permission denied)

I am running elastic on AWS EC2 and i have loged in through ubuntu user . i am using ubuntu 16.4

The main reason is permission issue

`ubuntu@ip-100-310-111-42:~/elasticsearch-5.4.1$ ls -al`

> total 252  
> drwxr-xr-x 9 ubuntu ubuntu 4096 Jun 13 21:28 .  
> drwxr-xr-x 8 ubuntu ubuntu 4096 Jun 20 16:39 ..  
> drwxr-xr-x 2 ubuntu ubuntu 4096 Jun 13 21:31 bin  
> drwxr-xr-x 3 ubuntu ubuntu 4096 Jun 13 21:28 config  
> drwxrwxr-x 3 ubuntu ubuntu 4096 Jun 13 21:28 data  
> drwxr-xr-x 2 ubuntu ubuntu 4096 May 29 16:08 lib  
> -rw-r--r-- 1 ubuntu ubuntu 11358 May 29 16:03 LICENSE.txt  
> **drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 21 11:13 logs**  
> drwxr-xr-x 12 ubuntu ubuntu 4096 May 29 16:08 modules  
> -rw-rw-r-- 1 ubuntu ubuntu 194187 May 29 16:08 NOTICE.txt  
> drwxr-xr-x 2 ubuntu ubuntu 4096 May 29 16:08 plugins  
> -rw-r--r-- 1 ubuntu ubuntu 9548 May 29 16:03 README.textile

`ubuntu@ip-100-310-111-42:~/elasticsearch-5.4.1$ chmod -R 777 logs/`

` ubuntu@ip-100-310-111-42:~/elasticsearch-5.4.1$ ls -al`  
total 252  
drwxr-xr-x 9 ubuntu ubuntu 4096 Jun 13 21:28 .  
drwxr-xr-x 8 ubuntu ubuntu 4096 Jun 20 16:39 ..  
drwxr-xr-x 2 ubuntu ubuntu 4096 Jun 13 21:31 bin  
drwxr-xr-x 3 ubuntu ubuntu 4096 Jun 13 21:28 config  
drwxrwxr-x 3 ubuntu ubuntu 4096 Jun 13 21:28 data  
drwxr-xr-x 2 ubuntu ubuntu 4096 May 29 16:08 lib  
-rw-r--r-- 1 ubuntu ubuntu 11358 May 29 16:03 LICENSE.txt  
drwxrwxrwx 2 ubuntu ubuntu 4096 Jun 21 11:13 logs  
drwxr-xr-x 12 ubuntu ubuntu 4096 May 29 16:08 modules  
-rw-rw-r-- 1 ubuntu ubuntu 194187 May 29 16:08 NOTICE.txt  
drwxr-xr-x 2 ubuntu ubuntu 4096 May 29 16:08 plugins  
-rw-r--r-- 1 ubuntu ubuntu 9548 May 29 16:03 README.textile

Then i have started elasticsearch working fine:slight\_smile:

`ubuntu@ip-100-310-111-42:~/elasticsearch-5.4.1/bin$ ./elasticsearch -d`

---

<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:** [November 4, 2022, 4:01am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-start/23824/14 "2022-11-04T04:01:30Z")

</div>


