# Logstash failed to load files with permission denied

**URL:** <https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255>\
**Category:** Logstash\
**Created:** [May 29, 2016, 8:33pm UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255 "2016-05-29T20:33:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![baneshbanna](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@baneshbanna](https://discuss.elastic.co/u/baneshbanna)\
**Post date:** [May 29, 2016, 8:33pm UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/1 "2016-05-29T20:33:17Z")

</div>

Logstash failed to load files with permission denied.  
In my setup Logstash running as service with command of "service logstash start"  
folder also having full permissions  
-rwxrwxrwx..  
Please suggest what can be the cause.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 29, 2016, 9:54pm UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/2 "2016-05-29T21:54:35Z")

</div>

Please provide the full error, the version you are running and your config.

---

<div class="post-metadata">

**Author:** ![baneshbanna](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@baneshbanna](https://discuss.elastic.co/u/baneshbanna)\
**Post date:** [May 30, 2016, 4:40am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/3 "2016-05-30T04:40:40Z")

</div>

Running logstash as a service with these system properties:  
-b3500 -w 20  
Logstash version:2.3.2  
ERROR:  
{:timestamp=\>"2016-05-30T05:37:50.006000+0100", :message=\>"failed to open /log/\_\_302042\_\_\_15482766983234091.log\_10.done.completed: Permission denied - /log/\_\_302042\_\_\_15482766983234091.log\_10.done.completed", :level=\>:warn}  
{:timestamp=\>"2016-05-30T05:37:50.007000+0100", :message=\>"failed to open /log/\_\_302042\_\_\_15850459744045356.log\_1.done.completed: Permission denied - /log/\_\_302042\_\_\_15850459744045356.log\_1.done.completed", :level=\>:warn}  
{:timestamp=\>"2016-05-30T05:37:50.008000+0100", :message=\>"failed to open /log/\_\_302042\_\_\_14980760853726598.log\_5.done.completed: Permission denied - /log/\_\_302042\_\_\_14980760853726598.log\_5.done.completed", :level=\>:warn}leted", :level=\>:warn}

CONFIG FILE:

input {  
file {  
path =\> ["/data/ **302001** \__"]  
start\_position =\> "beginning"  
type=\>"API"  
delimiter=\>"^"  
close\_older=\>"600"  
max\_open\_files=\>"25000"  
discover\_interval=\>5  
ignore\_older=\>2592000  
sincedb\_path=\>"/apps/sincedb/API/api.log"  
}  
}  
filter{  
if [message] =~ /^\s_$/ {  
drop { }  
}  
if[type]=="API"{  
csv {  
quote\_char =\> "`"  
separator=\>""  
autogenerate\_column\_names=\>"false"  
columns=\>["id","cor\_id","key","name","ip","data","state","datetime"]  
}  
if[datetime] and [datetime]!='null' and [datetime]!='NULL'{  
#ruby {  
# code =\> "event['indexdate'] = event['datetime'][0..6]"  
#}  
date {  
match =\> ["datetime", "YYYY-MM-dd HH:mm:ss.SSS","YYYY-MM-dd HH:mm:ss"]  
target =\>"datetime"  
timezone=\>"Europe/London"  
}  
grok {  
match =\> { "datetime" =\> "(?[0-9]{4}-[0-9]{2})"}  
}  
}  
if![datetime] or [datetime]=='null' or [datetime]=='NULL'{  
grok {  
match =\> { "@timestamp" =\> "(?[0-9]{4}-[0-9]{2})"}  
}  
ruby {  
code =\> "event['datetime'] = nil"  
}  
}  
mutate {  
convert =\> { "state" =\> "integer" }  
}  
}  
}  
output {  
if[type]=="API"{  
elasticsearch {  
workers =\>15  
hosts =\> ["localhost:9200","localhost:9201"]  
manage\_template =\> true  
template\_name =\> "template"  
template =\> "/apps/template.json"  
template\_overwrite=\>true  
index=\>"api-%{indexdate}"  
#index=\>"api-%{+[YYYY.MM](http://YYYY.MM)}"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 30, 2016, 4:44am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/4 "2016-05-30T04:44:28Z")

</div>

What are the permissions on the files you are trying to process?

---

<div class="post-metadata">

**Author:** ![baneshbanna](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@baneshbanna](https://discuss.elastic.co/u/baneshbanna)\
**Post date:** [May 30, 2016, 4:54am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/5 "2016-05-30T04:54:51Z")

</div>

these are my file permissions

sh-4.1$ ls -ltr /data/\_\_302001\_\_\_15763039509869681.log\_1.done.completed  
-rwxrwxrwx. 1 root root 256 May 26 16:18 /log/\_\_302001\_\_\_15763039509869681.log\_1.done.completed

Manually i given full permissions with below command chmod -R 777 folder name  
Then also same error came

---

<div class="post-metadata">

**Author:** ![baneshbanna](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@baneshbanna](https://discuss.elastic.co/u/baneshbanna)\
**Post date:** [June 10, 2016, 11:18am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/6 "2016-06-10T11:18:10Z")

</div>

Can you please suggest why logstash behaving like this

---

<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 10, 2016, 11:26am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/7 "2016-06-10T11:26:07Z")

</div>

> [@baneshbanna](#):
>
> /log/\_\_302042\_\_\_15482766983234091.log\_10.done.completed

Logstash seems to complain about files in the `/log` directory rather than the `/data` directory that you have configured. Do you have any other configuration files being picked up?

---

<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:** [July 6, 2017, 4:53am UTC](https://discuss.elastic.co/t/logstash-failed-to-load-files-with-permission-denied/51255/8 "2017-07-06T04:53:40Z")

</div>


