# Logstash: TypeError: no implicit conversion of nil into string

**URL:** https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219
**Category:** Logstash
**Created:** [March 19, 2020, 6:23am UTC](https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219 "2020-03-19T06:23:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![manojkrishna561994](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@manojkrishna561994](https://discuss.elastic.co/u/manojkrishna561994)
#### Post date: [March 19, 2020, 6:23am UTC](https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219/1 "2020-03-19T06:23:55Z")

</div>

I'm new to ELK and trying to input 3rd party REST API to Logstash to feed data into it. I'm getting TypeError: no implicit conversion of nil into string.

I'm using http\_input\_poller plugin to feed data. Here is configuration for it.

```auto
input {
  http_poller {
    urls => {
      test1 => "https://example.com/api/now/table/sys_user?sysparm_limit=1"
    }
    request_timeout => 60
    # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    # A hash of request metadata info (timing, response headers, etc.) will be sent here
    metadata_target => "http_poller_metadata"
  }
}

output {
  stdout {
    codec => rubydebug
  }
}

```

I'm using this command to run

`sudo ./logstash -f logstash_http_poller.conf --path.settings /etc/logstash/ --path.data`

I'm getting this error message

```auto
masteradmin@usr:/usr/share/logstash/bin$ sudo ./logstash -f logstash_http_poller.conf --path.settings /etc/logstash/ --path.data
[FATAL] 2020-03-18 07:07:07.377 [main] runner - An unexpected error occurred! {:error=>#<TypeError: no implicit conversion of nil into String>, :backtrace=>["org/jruby/RubyFileTest.java:96:in `directory?'", "org/jruby/RubyFileTest.java:88:in `directory?'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:510:in `block in value'", "org/jruby/RubyKernel.java:1906:in `tap'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:509:in `value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:97:in `get_value'", "/usr/share/logstash/logstash-core/lib/logstash/environment.rb:94:in `block in LogStash'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:167:in `block in post_process'", "org/jruby/RubyArray.java:1814:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:166:in `post_process'", "/usr/share/logstash/logstash-core/lib/logstash/util/settings_helper.rb:26:in `post_process'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:246:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:242:in `run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:73:in `<main>'"]}
[ERROR] 2020-03-18 07:07:07.386 [main] Logstash - java.lang.IllegalStateException: Logstash 

```

Need help. Thanks

---

<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: [March 22, 2020, 4:14pm UTC](https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219/2 "2020-03-22T16:14:33Z")

</div>

> [@manojkrishna561994](#):
>
> ```
> error=>#<TypeError: no implicit conversion of nil into String>, 
> :backtrace=>["org/jruby/RubyFileTest.java:96:in `directory?'", 
> "org/jruby/RubyFileTest.java:88:in `directory?'", 
> "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:510
> 
> ```

It's nothing to do with your configuration file. logstash is testing to see if a file it needs to use is a file or a directory, but finding the path to the file is actually nil. I would suspect that '--path.data' at the end of your command line. That needs to point to a directory.

---

<div class="post-metadata">

### Author: ![manojkrishna561994](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@manojkrishna561994](https://discuss.elastic.co/u/manojkrishna561994)
#### Post date: [April 7, 2020, 12:48pm UTC](https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219/3 "2020-04-07T12:48:08Z")

</div>

Hello, yes --path.data needs to have a file path. Any random file path will be sufficient to make it run.

`/usr/share/logstash/bin/logstash --path.settings /etc/logstash --path.data /usr/share/logstash/bin/AllLogstashPathData/LogstashLogs3 -f /usr/share/logstash/bin/logstash_http_poller.conf`

---

<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 5, 2020, 12:48pm UTC](https://discuss.elastic.co/t/logstash-typeerror-no-implicit-conversion-of-nil-into-string/224219/4 "2020-05-05T12:48:08Z")

</div>

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