# Pipeline aborted due to undefined method \`mutex'

**URL:** <https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777>\
**Category:** Logstash\
**Created:** [November 9, 2020, 3:25pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777 "2020-11-09T15:25:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lens](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lens](https://discuss.elastic.co/u/lens)\
**Post date:** [November 9, 2020, 3:25pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/1 "2020-11-09T15:25:28Z")

</div>

I've recently been running into an error when starting logstash. We have several pipelines configured and all will start up without a problem, except for one (not always the same one and there is not a problem every time). The error message is

```auto
Pipeline aborted due to error {:pipeline_id=>"pipeline3", :exception=>#<NoMethodError: undefined method 'mutex' for nil:NilClass>

```

The next time logstash is restarted, it works.  
We're currently on logstash 7.6.2.

Anyone know what causes this or have ideas on what to look into or try?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 9, 2020, 3:51pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/2 "2020-11-09T15:51:31Z")

</div>

Is there a stack trace for that error?

---

<div class="post-metadata">

**Author:** ![lens](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lens](https://discuss.elastic.co/u/lens)\
**Post date:** [November 9, 2020, 4:21pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/3 "2020-11-09T16:21:07Z")

</div>

Here's the complete error for one case:

```auto
[2020-11-07T01:01:50,293][ERROR][logstash.javapipeline] Pipeline aborted due to error {:pipeline_id=>"netsage-ilight", :exception=>#<NoMethodError: undefined method `mutex' for nil:NilClass>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-aggregate-2.9.1/lib/logstash/filters/aggregate.rb:97:in `register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:56:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:200:in `block in register_plugins'", "org/jruby/RubyArray.java:1814:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:199:in `register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:502:in `maybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:212:in `start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:154:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:109:in `block in start'"], "pipeline.sources"=>["/etc/logstash/pipelines/netsage-ilight/01-input-rabbit.conf", "/etc/logstash/pipelines/netsage-ilight/10-preliminaries.conf", "/etc/logstash/pipelines/netsage-ilight/20-add-id.conf", "/etc/logstash/pipelines/netsage-ilight/40-aggregation.conf", "/etc/logstash/pipelines/netsage-ilight/45-geoip-tagging.conf", "/etc/logstash/pipelines/netsage-ilight/50-asn.conf", "/etc/logstash/pipelines/netsage-ilight/53-caida-org.conf", "/etc/logstash/pipelines/netsage-ilight/55-member-orgs.conf", "/etc/logstash/pipelines/netsage-ilight/60-scireg-tagging-fakegeoip.conf", "/etc/logstash/pipelines/netsage-ilight/70-deidentify.conf", "/etc/logstash/pipelines/netsage-ilight/80-privatize-org.conf", "/etc/logstash/pipelines/netsage-ilight/88-preferred-location-org.conf", "/etc/logstash/pipelines/netsage-ilight/90-additional-fields.conf", "/etc/logstash/pipelines/netsage-ilight/95-cleanup.conf", "/etc/logstash/pipelines/netsage-ilight/98-post-process.conf", "/etc/logstash/pipelines/netsage-ilight/99-output-rabbit.conf"], :thread=>"#<Thread:0x5e3cb2e0@/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:37 run>"}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 9, 2020, 4:43pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/4 "2020-11-09T16:43:58Z")

</div>

So the code is getting an exception [here](https://github.com/logstash-plugins/logstash-filter-aggregate/blob/8603b168d93c43a4bbc72ca92a633d6c5276439e/lib/logstash/filters/aggregate.rb#L97).

From what I can see, @current\_pipeline could be only be nil at that point if the value returned by pipeline\_id changed between lines 94 and 95. That could only happen if @execution\_context changed between the two calls to pipeline\_id. I cannot think of anything that could cause that.

---

<div class="post-metadata">

**Author:** ![lens](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lens](https://discuss.elastic.co/u/lens)\
**Post date:** [November 9, 2020, 5:16pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/5 "2020-11-09T17:16:22Z")

</div>

Bizarre!

---

<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:** [December 7, 2020, 5:16pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-undefined-method-mutex/254777/6 "2020-12-07T17:16:25Z")

</div>

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