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

JRuby failure with 0.15.0 - NoMethodError: undefined method `bitmask' #205

Open
tannalynn opened this issue Oct 19, 2021 · 1 comment
Open

Comments

@tannalynn
Copy link

tannalynn commented Oct 19, 2021

Hello! I'm a maintainer for the ruby agent over at New Relic. We have instrumentation for Typhoeus, and our Typhoeus tests have recently started failing on jruby only (with no changes in the agent prior to the failures beginning). I've narrowed this down to the 0.15.0 release of ethon, as pinning the ethon version to 0.14.0 in our test gemfile prevents the error from occurring. This appears to be a bug specific to jruby, as all MRI versions are not experiencing this failure. Is jruby still supported for typhoeus?

ruby version: jruby-9.2.9.0 and jruby-9.2.19.0

This is the error that causes the failures:

NoMethodError: undefined method `bitmask' for Ethon::Curl:Module
                        <module:Curl> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:74
                       <module:Ethon> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:3
                               <main> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:2
                              require at org/jruby/RubyKernel.java:978
                        <module:Curl> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curl.rb:27
                       <module:Ethon> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curl.rb:14
                               <main> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curl.rb:9
                              require at org/jruby/RubyKernel.java:978
                               <main> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon.rb:16
                              require at org/jruby/RubyKernel.java:978
                               <main> at /Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/typhoeus-1.4.0/lib/typhoeus.rb:2
                              require at org/jruby/RubyKernel.java:978

There are also a significant number of warnings, prior to the error, that do not appear on 0.14.0, only 0.15.0. Not sure why, but I noticed it was only happening on 0.15.0, so I wanted to let you know:

/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:5: warning: already initialized constant VERSION_NOW
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:8: warning: already initialized constant GLOBAL_SSL
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:10: warning: already initialized constant GLOBAL_WIN32
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:12: warning: already initialized constant GLOBAL_ALL
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:14: warning: already initialized constant GLOBAL_DEFAULT
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:17: warning: already initialized constant EasyCode
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:19: warning: already initialized constant MultiCode
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:22: warning: already initialized constant EasyOption
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:24: warning: already initialized constant MultiOption
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:28: warning: already initialized constant DebugInfoType
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:31: warning: already initialized constant InfoType
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:35: warning: already initialized constant Info
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:39: warning: already initialized constant FormOption
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:42: warning: already initialized constant MsgCode
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:44: warning: already initialized constant VERSION_IPV6
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:45: warning: already initialized constant VERSION_KERBEROS4
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:46: warning: already initialized constant VERSION_SSL
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:47: warning: already initialized constant VERSION_LIBZ
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:48: warning: already initialized constant VERSION_NTLM
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:49: warning: already initialized constant VERSION_GSSNEGOTIATE
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:50: warning: already initialized constant VERSION_DEBUG
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:51: warning: already initialized constant VERSION_ASYNCHDNS
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:52: warning: already initialized constant VERSION_SPNEGO
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:53: warning: already initialized constant VERSION_LARGEFILE
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:54: warning: already initialized constant VERSION_IDN
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:55: warning: already initialized constant VERSION_SSPI
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:56: warning: already initialized constant VERSION_CONV
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:57: warning: already initialized constant VERSION_CURLDEBUG
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:58: warning: already initialized constant VERSION_TLSAUTH_SRP
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:59: warning: already initialized constant VERSION_NTLM_WB
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:60: warning: already initialized constant VERSION_HTTP2
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:61: warning: already initialized constant VERSION_GSSAPI
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:63: warning: already initialized constant SOCKET_BAD
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:64: warning: already initialized constant SOCKET_TIMEOUT
/Users/username/.rbenv/versions/jruby-9.2.9.0/lib/ruby/gems/shared/gems/ethon-0.15.0/lib/ethon/curls/constants.rb:66: warning: already initialized constant PollAction
@ivoanjo
Copy link

ivoanjo commented Jan 24, 2022

This is probably a JRuby bug. I was looking into this and versions until 9.2.19.0 are affected, but 9.2.20.0 is not.

The 9.2.20.0 changelog hints at a number of ffi-related fixes (see https://www.jruby.org/2021/11/02/jruby-9-2-20-0.html) which I think also fix the issue with ethon.

TL;DR Just use the latest stable JRuby and you should be good to go.

ivoanjo added a commit to DataDog/dd-trace-rb that referenced this issue Jan 24, 2022
While investigating another JRuby issue (see #1840) I upgraded the
`ethon` gem and ran into a new issue --
typhoeus/ethon#205 .

That `ethon`issue is actually a JRuby bug, and has been fixed in the
latest versions of JRuby 9.2, so instead of adding
yet-another workaround to our Appraisals, let's just upgrade the
JRuby image we use for testing :)

While I was in the neighbourhood, I also bumped the resource class
for JRuby 9.2 testing in CI, to hopefully reduce the time it takes
to run CI with JRuby by giving it a bit more oomph.
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

2 participants