# Unable to load the base.rb file in my plugin

**URL:** <https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219>\
**Category:** Logstash\
**Created:** [May 5, 2015, 1:59pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219 "2015-05-05T13:59:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kebbkh](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kebbkh](https://discuss.elastic.co/u/kebbkh)\
**Post date:** [May 5, 2015, 1:59pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/1 "2015-05-05T13:59:48Z")

</div>

Hello,

Whenever I attempt to run logstash using the --configtest flag this is the message I keep getting:

```
The error reported is: 
Couldn't find any codec plugin named 'transit'. Are you sure this is correct?
Trying to load the transit codec plugin resulted in this error: no such file to load -- logstash/lib/logstash/codecs/base

```

any ideas..?

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 5, 2015, 11:06pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/2 "2015-05-05T23:06:02Z")

</div>

It sounds like you've got `require "logstash/lib/logstash/codecs/base"` in your plugin. I don't think this is right, it should probably be `require "logstash/codecs/base"` (remove the leading `logstash/lib` part)

---

<div class="post-metadata">

**Author:** ![kebbkh](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kebbkh](https://discuss.elastic.co/u/kebbkh)\
**Post date:** [May 6, 2015, 5:02pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/3 "2015-05-06T17:02:55Z")

</div>

Thanks!

However, now when I run logstash using:

```
/opt/logstash/bin/logstash agent --verbose --log /opt/logstash/log/logstash.logs --config /opt/logstash.conf --pluginpath /opt/logstash/lib/ --debug

```

This is the output that I receive:

```
Sending logstash logs to /opt/logstash/log/logstash.logs.
Using milestone 1 input plugin 'lumberjack'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin. For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
Using milestone 1 codec plugin 'transit'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin. For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
Error: Configuration problem.

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 6, 2015, 6:55pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/4 "2015-05-06T18:55:35Z")

</div>

> [@kebbkh](#):
>
> Error: Configuration problem.

Try using the `--debug` flag which should show you a stack trace. Without more information, I'm not sure what is going on.

---

<div class="post-metadata">

**Author:** ![kebbkh](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kebbkh](https://discuss.elastic.co/u/kebbkh)\
**Post date:** [May 6, 2015, 7:29pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/5 "2015-05-06T19:29:50Z")

</div>

I get the same Error message when I run both `--configtest` and `--debug`

---

<div class="post-metadata">

**Author:** ![kebbkh](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kebbkh](https://discuss.elastic.co/u/kebbkh)\
**Post date:** [May 6, 2015, 7:59pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/6 "2015-05-06T19:59:02Z")

</div>

This is the new output I get when I run:

```
/opt/logstash/bin/logstash agent --verbose --log /opt/logstash/log/logstash.logs --config /opt/logstash.conf --pluginpath /opt/logstash/lib

```

Output:

```
Sending logstash logs to /opt/logstash/log/logstash.logs.
Using milestone 1 input plugin 'lumberjack'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin. For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
+---------------------------------------------------------+
| An unexpected error occurred. This is probably a bug. |
| You can find help with this problem in a few places: |
| |
| * chat: #logstash IRC channel on freenode irc. |
| IRC via the web: http://goo.gl/TI4Ro |
| * email: logstash-users@googlegroups.com |
| * bug system: https://logstash.jira.com/ |
| |
+---------------------------------------------------------+
The error reported is: 
  Couldn't find any codec plugin named 'transit'. Are you sure this is correct? Trying to load the transit codec plugin resulted in this error: no such file to load -- logstash/codecs/transit
```

---

<div class="post-metadata">

**Author:** ![kebbkh](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kebbkh](https://discuss.elastic.co/u/kebbkh)\
**Post date:** [May 6, 2015, 8:17pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/7 "2015-05-06T20:17:34Z")

</div>

> [@jordansissel](#):
>
> Try using the --debug flag which should show you a stack trace. Without more information, I'm not sure what is going on.

I am following the instructions located here: [Contributing to Logstash | Logstash Reference [8.11] | Elastic](http://logstash.net/docs/1.4.2/extending/example-add-a-new-filter), the only difference is that I am implementing a codec.

So far, I have tried to place the `transit.rb` file in 2 locations:  
(FYI.: logstash is installed at: `/opt/logstash`)

1. `/opt/logstash/codecs` (I manually created the codecs directory there)
2. `/opt/logstash/lib/logstash/codecs` (there is a list of codecs located here)

When I run these 2 commands, respectively (depending on where I chose to place the transit.rb based on the options above)

1. `/opt/logstash/bin/logstash agent --verbose --log /opt/logstash/log/logstash.logs --config /opt/logstash.conf --pluginpath /opt/logstash/codecs`
2. `/opt/logstash/bin/logstash agent --verbose --log /opt/logstash/log/logstash.logs --config /opt/logstash.conf --pluginpath /opt/logstash/codecs`

I get the same error...however, the 2nd option seems to work a lot better than the first.

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 8, 2015, 7:01pm UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/8 "2015-05-08T19:01:05Z")

</div>

Can you post the code for your plugin?

---

<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:** [July 6, 2017, 5:40am UTC](https://discuss.elastic.co/t/unable-to-load-the-base-rb-file-in-my-plugin/219/9 "2017-07-06T05:40:06Z")

</div>


