# Sincedb\_path files are not created (logstash 2.4)

**URL:** <https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889>\
**Category:** Logstash\
**Created:** [September 6, 2016, 2:40pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889 "2016-09-06T14:40:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 6, 2016, 2:40pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/1 "2016-09-06T14:40:38Z")

</div>

My config file in logstash/conf.d directory contains a sincedb\_path directive in an input/file section :  
input {  
file  
{  
path =\> "/var/log/myfile"  
sincedb\_path =\> "/root/sincedb/sincedb.db"  
}  
}  
output {  
....  
}

... but no sincedb.db file is not created when logstash runs. The rights are Ok in /root/sincedb directory (logstash:logstash).  
I activated --debug logs in logstash VM :

- With this configuration, a trace saying "file grew : /var/log/myfile: old size 0, new size 330851 ..." is continuously displayed in log file althgough "myfile" does not change ... Probably linked to the fact that no sincedb file are created, ... but nonethelees, logstash does produce any additionnal output (so it knows, don't know how without sincedb file, that no new line have been appended)
- When I append a new line in "myfile", log says "file grew : /var/log/myfile: old size 0, new size 331449 ..." followed by everal log lines "Received line" ... ending by an exception in plugin Logstash::Inputs::File" ... this exception is a ENOENT one,

It seems thats logstash tries to create a file whose name is  
/root/sincedb/sincedb.db.15506.2290.753894 ... and fails to create it ...

2290 is the logstash JVM PID. For each new log, I always have the "15506" value (thought it was the input file inode .. but it is not ...), and "753894" changes for each new log (suppose it is a timestamp at the time it tries to create the file).

Can anyone explain what happens there : why logstash cannot create the file, and explain the values used to build the filename ?

Thnsk,

Guenhaël

---

<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:** [September 7, 2016, 2:20am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/2 "2016-09-07T02:20:32Z")

</div>

What user are you running LS as?

---

<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:** [September 7, 2016, 6:21am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/3 "2016-09-07T06:21:57Z")

</div>

Why would you want to create the sincedb files under /root? What's wrong with the default path? What are the file permissions of /root?

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 7, 2016, 12:24pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/4 "2016-09-07T12:24:53Z")

</div>

Hi, thanks for answering,

well, since this "sincedb\_path" option exists, I suppose I can use it to specify my own path no ? I have chosen the /root/sincedb directory, who has got the rw rights for user "logstash".  
As the documentation says that this option has to specify a file, I have specified "/root/sinced/ myfile in the sincedb\_path option. With that parameter, it tries to create a file but it fails ... probably due to rights problems.  
I start LS connected as root, using the "systemctl start logstash" command on My Centos ...  
By the way, can you tell me what are the 3 figures added after the"myfile" prefix ?

Thanks for your help,

Guenhaël

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 7, 2016, 12:35pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/5 "2016-09-07T12:35:15Z")

</div>

Hi, thanks for answering,

Indeed, the problem is obviously due to rights problems.  
I start LS connected as root, using the "systemctl start logstash" command on My Centos ...  
The init.d script does the appropriate things to start the LS VM as logstasg, since I see, using "ps", that this VM is started with user "logstash".

The sincedb\_path parameter contains /root/sincedb/myfile, and the user "logstash" has got rw rights on /root/sincedb directory, so should be able to create files in that directory no ?  
.. but I see that it cannot create a "/root/sincedb/myfile.xxx.yyy.zzz" file ... and I'm also wondering what are those 3 figures xxx, yyy and zzz (one the the LS VM PID, but whart about the 2 others ?)

Thanks for your help,

Guenhaël

---

<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:** [September 7, 2016, 1:04pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/6 "2016-09-07T13:04:23Z")

</div>

> The sincedb\_path parameter contains /root/sincedb/myfile, and the user "logstash" has got rw rights on /root/sincedb directory, so should be able to create files in that directory no ?

The logstash user needs rwx for /root/sincedb and rx for /root.

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 7, 2016, 1:27pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/7 "2016-09-07T13:27:49Z")

</div>

Ok, I’ll try this tomorrow since I do not have access to this offline system today.  
Can you explain why need the “rx” rights for “root” (I will have to set “rx” for “others” group, not only for root, which not nice …)

---

<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:** [September 7, 2016, 1:33pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/8 "2016-09-07T13:33:53Z")

</div>

Oops, sorry. It doesn't need rx for /root, only x. Why? Because that's how POSIX file system permissions work. In order to access a file in /a/b/c you need execute permission to /a, /a/b, and /a/b/c.

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 7, 2016, 2:51pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/9 "2016-09-07T14:51:22Z")

</div>

OK, I read « root » instead of « /root » (thought you wanted to add specific rights for “root” user, which can only e done on specific Linux distributions …).

---

<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:** [September 8, 2016, 12:33am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/10 "2016-09-08T00:33:34Z")

</div>

Or just don't use /root as the sincedb path, that's a lot smarter.

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 8, 2016, 9:30am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/11 "2016-09-08T09:30:40Z")

</div>

Yes, you’re right, I just chose it because I was the /root directory when I connected ! I have chosen another one in a user directory with the appropriate rights for logstash, including “x” right at each level for “other” users …  
Now it works, but I’m a little bit surprised : logstash uses the file with the exact name I give, I do not see anything appended to his name (I mean the 3 figures I saw in the debug log, one looking like the JVM PID …).

Thanks !

Guenhaël

---

<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:** [September 8, 2016, 10:41am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/12 "2016-09-08T10:41:17Z")

</div>

Well, if you give it a filename path it'll use that exact file.

---

<div class="post-metadata">

**Author:** ![Guenhael](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Guenhael](https://discuss.elastic.co/u/Guenhael)\
**Post date:** [September 8, 2016, 12:03pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/13 "2016-09-08T12:03:34Z")

</div>

Well, as I described in my initial POST, when I had the rights problems, I gave /path/to/myfile in sincedb\_path, … and I saw in the logs that it failed in creating path/to/myfile.xxx.yyy.zzz, so it did not use the exact filename I gave …

---

<div class="post-metadata">

**Author:** ![chromechris](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@chromechris](https://discuss.elastic.co/u/chromechris)\
**Post date:** [October 7, 2016, 11:09pm UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/14 "2016-10-07T23:09:20Z")

</div>

> [@Guenhael](#):
>
> is option has to

I decided to delete my .sincedb files, and they were never created again. They .sincedb files used to be under /root.

---

<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:35am UTC](https://discuss.elastic.co/t/sincedb-path-files-are-not-created-logstash-2-4/59889/15 "2017-07-06T04:35:06Z")

</div>


