Unable to load the base.rb file in my plugin


#1

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..?


(Jordan Sissel) #2

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)


#3

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?


(Jordan Sissel) #4

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


#5

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


#6

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

#7

I am following the instructions located here: 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.


(Jordan Sissel) #8

Can you post the code for your plugin?


(system) #9