# APT Package: Queue directory not writeable

**URL:** <https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392>\
**Category:** Logstash\
**Created:** [December 19, 2016, 6:39am UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392 "2016-12-19T06:39:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![padyx](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@padyx](https://discuss.elastic.co/u/padyx)\
**Post date:** [December 19, 2016, 6:39am UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/1 "2016-12-19T06:39:26Z")

</div>

Has anyone else experienced the issue when installing Logstash 5.x as an APT-Package, that it won't start:

```
[2016-12-19T07:06:27,418][FATAL][logstash.runner] An unexpected error occurred! {:error=>#<ArgumentError: Path "/usr/share/logstash/data/queue" must be a writable directory. It is not writable.>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:420:in `validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:202:in `validate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:118:in `validate_all'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:117:in `validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:205:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:178:in `run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in `(root)'"]}

```

It seems like directory is being created as root - instead of user logstash, and thus is not writeable.  
This happened to us on two machines already that we installed Logstash 5 on.

```
....:/var/log/logstash$ ls -al /usr/share/logstash/data/queue
total 8
drwxr-xr-x 2 root root 4096 Dec 19 06:48 .
drwxrwxr-x 3 logstash logstash 4096 Dec 19 06:48 ..

```

After chown-ing the directory to the logstash user, it works again.

Is this an issue on my part or shall I open an issue on GitHub?

Also: When requesting the validation of the configuration in this state (-t / --config.test\_and\_exit), it does not terminate or provide the output above!

**Edit:** Changed to pre-formatted text, include the error message properly

---

<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:** [December 19, 2016, 6:46am UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/2 "2016-12-19T06:46:30Z")

</div>

_Always_ format log snippets as preformatted text. If you read what you've posted clearly you'll find that the actual error message is missing.

> Also: When requesting the validation of the configuration in this state (-t / --config.test\_and\_exit), it does not terminate or provide the output above!

You should not expect `-t` to find all problems, especially not problems like this where the configuration files are okay and its the environment that's broken.

---

<div class="post-metadata">

**Author:** ![padyx](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@padyx](https://discuss.elastic.co/u/padyx)\
**Post date:** [December 19, 2016, 7:00am UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/3 "2016-12-19T07:00:45Z")

</div>

Thank you for your feedback.

I reformatted the message and included the error - sorry about that.  
(Interestingly, when editing it and using the "preformatted text"-button in the editor, it used backticks _again_ instead of using the four spaces.

---

<div class="post-metadata">

**Author:** ![jakommo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakommo/32/6716_2.png) [@jakommo](https://discuss.elastic.co/u/jakommo)\
**Post date:** [December 20, 2016, 3:46pm UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/4 "2016-12-20T15:46:40Z")

</div>

The debian package does not create this folder, just checked with  
`dpkg -L logstash | grep queue`  
on Ubuntu 14.04 and 16.04.

The dir was only created after enabling the [persistent queue](https://www.elastic.co/guide/en/logstash/current/persistent-queues.html#configuring-persistent-queues), but with correct permissions.  
Did you run logstash as root for testing something, when you first enabled the persistent queue?

---

<div class="post-metadata">

**Author:** ![padyx](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@padyx](https://discuss.elastic.co/u/padyx)\
**Post date:** [December 20, 2016, 5:53pm UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/5 "2016-12-20T17:53:47Z")

</div>

Thanks for your analysis.

This is quite likely - in our setup, we install the plugins for logstash and then perform the configuration check as root (both via ansible):

```
sudo /usr/share/logstash/bin/logstash-plugin install logstash-filter-de_dot
sudo /usr/share/logstash/bin/logstash -t --path.settings /etc/logstash

```

Both would run as root, and if the check creates this folder as root, we might indeed run into the problem when starting logstash later as a normal service...

I'll try to reproduce this and report back if it's another issue.  
Thanks for the assistance

---

<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:** [January 17, 2017, 5:53pm UTC](https://discuss.elastic.co/t/apt-package-queue-directory-not-writeable/69392/6 "2017-01-17T17:53:50Z")

</div>

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