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

Undefined method add_file add_file - protobuf 3 #41

Closed
pelalartategui opened this issue Apr 16, 2019 · 6 comments
Closed

Undefined method add_file add_file - protobuf 3 #41

pelalartategui opened this issue Apr 16, 2019 · 6 comments

Comments

@pelalartategui
Copy link

pelalartategui commented Apr 16, 2019

I use protobuf 3, compiled with official google compiler as codec in Kakfa input.
Logstash version: 6.7.1
plugin version: 1.1.0

ERROR:

Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"NoMethodError", :message=>"undefined method add_file' for #<Google::Protobuf::Builder:0x29a7906f>", :backtrace=>["/usr/share/logstash/proto/table_pb.rb:7:in block in <main>'"

Kakfa input:

 input { 
  kafka {
    bootstrap_servers  => {{ kafka_instances | to_json }}
    topics => {{ kafka_topics | to_json }}
    key_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
    value_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
    codec => protobuf
     {
       class_name => {{ class_name }}
       include_path => ['/usr/share/logstash/proto/table_pb.rb', '/usr/share/logstash/proto/xs_pb.rb']
       protobuf_version => 3

     }
  }
}

Thank you a lot.

@IngaFeick
Copy link
Collaborator

Hi!
This error is caused by an incompatibility between your protoc version (probably 3.7?) and the rather old jruby implementation that is shipped with this codec. The problem is that the jruby version is not well maintained and we cannot easily update it ourselves. We're looking into this though.
In the meantime you can workaround this by using the 3.5.0 version of protoc.

@pelalartategui
Copy link
Author

Thank you!

@jthack
Copy link

jthack commented May 6, 2020

Any traction on this @IngaFeick (ie a better fix than just "use an old version")

@IngaFeick
Copy link
Collaborator

@jthack we depend on the last released version of the jruby protobuf gem, which is not part of our project. There is nothing we can do about this. You might want to voice your interest here: protocolbuffers/protobuf#1594

@treykasada
Copy link

Just hit this error as well. Unfortunately, using protoc 3.5.0 isn't an option in our case as our Protobuf definitions make use of proto3's new optional keyword, and support for that was only added in protoc 3.15.0.

@IngaFeick It looks like protocolbuffers/protobuf#1594 was recently closed. Does that mean a fix for this is now feasible?

@gr790
Copy link

gr790 commented Feb 11, 2023

I tried to use google-protobuf 3.5.0 pre version also, but still same error, working on fix it...

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

No branches or pull requests

5 participants