"undefined method `system?' for nil:NilClass" error when pipeline is deleted
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 88
Description
*Original comment by @ycombinator:*
This happens either using centralized config management (i.e. via the Kibana UI) or using the `pipelines.yml` file.
### Steps to reproduce
1. Define two pipelines (either using centralized config management or in the `pipelines.yml` file).
2. Wait for the Logstash instance to pick them up and start running them.
3. Delete one of the pipelines.
### Observed behavior
The Logstash logs show this error message:
```
[2017-09-26T08:04:58,556][ERROR][logstash.agent ] An exception happened when converging configuration {:exception=>NoMethodError, :message=>"undefined method `system?' for nil:NilClass", :backtrace=>["/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/x-pack-6.0.0.rc1-java/lib/monitoring/inputs/metrics.rb:162:in `update_pipeline_state'", "/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/x-pack-6.0.0.rc1-java/lib/monitoring/inputs/metrics.rb:72:in `block in pipeline_started'", "/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/x-pack-6.0.0.rc1-java/lib/license_checker/licensed.rb:76:in `with_license_check'", "/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/x-pack-6.0.0.rc1-java/lib/monitoring/inputs/metrics.rb:71:in `pipeline_started'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/event_dispatcher.rb:34:in `block in fire'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/event_dispatcher.rb:32:in `fire'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/agent.rb:384:in `block in dispatch_events'", "org/jruby/RubyHash.java:1343:in `each'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/agent.rb:377:in `dispatch_events'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/agent.rb:171:in `converge_state_and_update'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/agent.rb:105:in `block in execute'", "/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/interval.rb:18:in `interval'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/agent.rb:94:in `execute'", "/Users/shaunak/logstash-6.0.0-rc1/logstash-core/lib/logstash/runner.rb:362:in `block in execute'", "/Users/shaunak/logstash-6.0.0-rc1/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}
```
Followed by these repeated error messages:
```
[2017-09-26T08:05:04,101][ERROR][logstash.inputs.metrics ] Failed to create monitoring event {:message=>"undefined method `system?' for nil:NilClass", :error=>"NoMethodError"}
```
The error only goes away if a pipeline with the same `id` is created again.
### Expected behavior
I would expect deleting a pipeline should not result in these errors.
Contributor guide
Assessment
This issue has not been assessed yet.