# Logstash is failing when running as a service due to logstash-core-plugin-api.gemspec error

**URL:** <https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385>\
**Category:** Logstash\
**Created:** [April 27, 2021, 1:46pm UTC](https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385 "2021-04-27T13:46:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitarorait82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohitarorait82/32/82981_2.png) [@rohitarorait82](https://discuss.elastic.co/u/rohitarorait82)\
**Post date:** [April 27, 2021, 1:46pm UTC](https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385/1 "2021-04-27T13:46:49Z")

</div>

Hi Team,

My logstash was working completely fine till yesterday and suddenly it stopped working, now when I am trying to restart it using **systemctl start logstash** command , I am getting below error.

```
 Check your env for conflicting versions of SnakeYAML
Apr 27 19:12:50 server logstash[21963]: See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment
Apr 27 19:12:50 server logstash[21963]: [ERROR] 2021-04-27 19:12:50.178 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (GemspecError)
Apr 27 19:12:50 server logstash[21963]: [!] There was an error while loading `logstash-core-plugin-api.gemspec`: load error: psych -- java.lang.RuntimeException: BUG: we can not copy embedded jar to temp directory
Apr 27 19:12:50 server logstash[21963]: Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.
Apr 27 19:12:50 server logstash[21963]: # from /usr/share/logstash/logstash-core-plugin-api/logstash-core-plugin-api.gemspec:23

```

However, it working fine when I am trying to run it from /usr/share/logstash/bin using below command. Can someone please help

**./logstash -f /etc/logstash/conf.d/sample.conf**

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 27, 2021, 2:26pm UTC](https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385/2 "2021-04-27T14:26:23Z")

</div>

it is because you don't have permission on /tmp to create a dir.  
it will try to create a dir called ls\_temp

jvm.options file has this. set this up properly, you can change to different dir if you like

## JVM temporary directory

#-Djava.io.tmpdir=${ES\_TMPDIR}

---

<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:** [May 25, 2021, 2:27pm UTC](https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385/3 "2021-05-25T14:27:18Z")

</div>

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