Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin failed with logstash 1.5.0.rc2 #3

Closed
sergakaibis opened this issue Apr 27, 2015 · 18 comments
Closed

Plugin failed with logstash 1.5.0.rc2 #3

sergakaibis opened this issue Apr 27, 2015 · 18 comments

Comments

@sergakaibis
Copy link

Hello!

I'm trying to use this plugin with logstash 1.5.0.rc2.
plugin installed via following command:
cd /opt/logstash; ./bin/plugin install logstash-output-mongodb
It throws following error on start:
The error reported is:
uninitialized constant Mongo::URIParser

My config:

output {
stdout {
codec => rubydebug
}
mongodb {
database => "db"
collection => "logs"
uri => "mongodb://127.0.0.1:27017"
}
}

Is something wrong with config or ?

@mellonbrook
Copy link

I am having this issue as well. I am working on a solution. I have a lead though. So the issue is in this file: (https://github.com/logstash-plugins/logstash-output-mongodb/blob/master/lib/logstash/outputs/mongodb.rb) with the call to Mongo::URIParser. The mongo gem being imported does not have a URIParser class. The following is the uri.rb file from the mongo gem being imported https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/uri.rb. Notice it does not have a URIParser class. I hope this helps somewhat.

@mellonbrook
Copy link

So I fixed the issue. Heres a link to my repo with the fix: master...mellonbrook:fix-update-mongoruby

I removed the authentication code because I dont need it and because I dont have time right now to fix it.

Let me know if you have any questions.

@thermz
Copy link

thermz commented May 25, 2015

I'm facing this issue too... the last version seems broken to me

@cabrinoob
Copy link

Same problem here ... (I'am using logstash 1.5.0 and mongodb 3.0.3)

@mellonbrook
Copy link

I created a fork of the plugin that works for me. Heres the link: https://github.com/mellonbrook/logstash-output-mongodb/tree/fix-update-mongoruby

The fork doesn't use authentication and the URI is hardcoded in the plugin to '129.0.0.1:27017'

Heres the diff: master...mellonbrook:fix-update-mongoruby

@vanhongts
Copy link

:( Same problem with logstash 1.5.0

@ocastx
Copy link

ocastx commented Jun 11, 2015

Same problem with logstash 1.5.0

@inptensib
Copy link

I am facing a problem with logstash 1.4.3 (I am using mongoDb 3.0.3).I am getting thi error message:

Using milestone 2 output plugin 'mongodb'. 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.3/plugin-milestones {:level=>:warn}
NameError: uninitialized constant Mongo::URIParser
const_missing at org/jruby/RubyModule.java:2726
register at /opt/logstash/lib/logstash/outputs/mongodb.rb:38
each at org/jruby/RubyArray.java:1613
outputworker at /opt/logstash/lib/logstash/pipeline.rb:220
start_outputs at /opt/logstash/lib/logstash/pipeline.rb:152

is something wrong with logstash or what?Thank you

@ocastx
Copy link

ocastx commented Jun 17, 2015

The problem occurs because the logstash-output-mongodb plugin requires the mongodb gem without requiring a specific version. When the mongo gem was updated to version 2.0.0, the Mongo:URIParser class was replaced with the URI class.

I supplied a fix in a fork by adding a specific version requirement for the mongo gem.

@inptensib
Copy link

Thank you for you're answer 👍 but it still doesn't work for me.I have this error message :

The error reported is:
uninitialized constant Mongo::URIParser

(I am using the last version of logstash 1.5.1)

@lucashenning
Copy link

I had the same problem with logstash 1.5.1

The error reported is: 
  uninitialized constant Mongo::URIParser
org/jruby/RubyModule.java:2733:in `const_missing'
/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-mongodb-0.1.4/lib/logstash/outputs/mongodb.rb:37:in `register'

I changed a few lines as suggested by @mellonbrook ( master...mellonbrook:fix-update-mongoruby )

It works now 👍 Thank you

@svezzoli
Copy link

I have the same problem with logstash 1.5.2.
But do it will be possible to fix this problem definitively on master branch?
Thanks.

@OMarohn
Copy link

OMarohn commented Jul 28, 2015

+1

1 similar comment
@gitchs
Copy link

gitchs commented Aug 7, 2015

+1

@svezzoli
Copy link

I applied the changes suggested by @mellonbrook but this is only a work around and it is not right for my use case.
Our product uses the authentication to access to mongodb, and so it is not a valid solution to remove the authentication and to make use of an hardcoded value for URI ('127.0.0.1:27017'), the mongodb access via authentication (any mechanism) should be guaranteed at least.

In this situation this plugin is unusable!
Why is there no more maintenance on logstash-output.mongodb plugin?

@purbon
Copy link

purbon commented Aug 31, 2015

Good morning @svezzoli , the mongodb output is a community contributed one, this days with tons of plugins under the umbrella of the logstash-plugins organization and the size of our internal core team, we get the places we can, but certainly not to everywhere.

We'll be more than happy to review and merge as much patches as possible here, with all your help, awesome community, we can make this work. Things like raising importance of fixes, reviewing code, proposing PR, etc ... every small detail is highly welcome.

Sayed that, please feel free to point us how can we fix the issues you guys are having?

/cheers

@purbon
Copy link

purbon commented Sep 7, 2015

This issue should be gone with the new release of the plugin (https://rubygems.org/gems/logstash-output-mongodb), the URI one, did not work on the authentication issue for now.

@svezzoli @mellonbrook @lucashenning as I said this is a community maintained plugin, feel free to contribute ideas and code back! all PR are welcome you guys can step in every time you want, for example doing reviews, raising issues, etc.

/cheers

  • purbon

@purbon
Copy link

purbon commented Sep 7, 2015

I'm going to close this one in benefit of having only one issue for the authentication problem. The problem stated here is the upgrade issue, that is fix for now.

@purbon purbon closed this as completed Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.