Issue with omniauth-oauth2 #401

Closed
JimW opened this Issue Feb 10, 2017 · 22 comments

Comments

Projects
None yet
5 participants
@JimW

JimW commented Feb 10, 2017

"There was an error while trying to load the gem 'omniauth-oauth2'. (Bundler::GemRequireError)"
Gem Load Error is: private method warn' called for nil:NilClass Backtrace for gem load error is: ....../vendor/bundle/ruby/2.2.0/gems/hashie-3.5.2/lib/hashie/mash.rb:334:inlog_built_in_message'

Locked hashie gem back to 3.5.1 and it fixed it.

@dblock

This comment has been minimized.

Show comment
Hide comment
@dblock

dblock Feb 10, 2017

Contributor

I tried to reproduce this in #402, but wasn't successful.

Which versions of omniauth-oauth2 are you using? Is this in Rails?

Contributor

dblock commented Feb 10, 2017

I tried to reproduce this in #402, but wasn't successful.

Which versions of omniauth-oauth2 are you using? Is this in Rails?

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

Also, what version of Omniauth? The recent 1.4.1 version should fix this issue.

Contributor

michaelherold commented Feb 10, 2017

Also, what version of Omniauth? The recent 1.4.1 version should fix this issue.

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold I get the same with 1.4.1

rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'omniauth-facebook'.
Gem Load Error is: private method `warn' called for nil:NilClass
Backtrace for gem load error is:
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:334:in `log_built_in_message'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:139:in `custom_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:207:in `block in deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `each_pair'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:115:in `initialize'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth/auth_hash.rb:24:in `new'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth/auth_hash.rb:24:in `regular_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:140:in `custom_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:207:in `block in deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `each_pair'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:115:in `initialize'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:45:in `new'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:45:in `defaults'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:50:in `initialize'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:142:in `new'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:142:in `block in instance'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:140:in `synchronize'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:140:in `instance'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:119:in `config'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-oauth2-1.4.0/lib/omniauth/strategies/oauth2.rb:127:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth/strategies/facebook.rb:1:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth/facebook.rb:2:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth-facebook.rb:1:in `<top (required)>'
Contributor

matthewrudy commented Feb 10, 2017

@michaelherold I get the same with 1.4.1

rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'omniauth-facebook'.
Gem Load Error is: private method `warn' called for nil:NilClass
Backtrace for gem load error is:
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:334:in `log_built_in_message'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:139:in `custom_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:207:in `block in deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `each_pair'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:115:in `initialize'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth/auth_hash.rb:24:in `new'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth/auth_hash.rb:24:in `regular_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:140:in `custom_writer'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:207:in `block in deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `each_pair'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:200:in `deep_update'
/home/rof/cache/bundler/ruby/2.4.0/gems/hashie-3.5.2/lib/hashie/mash.rb:115:in `initialize'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:45:in `new'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:45:in `defaults'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:50:in `initialize'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:142:in `new'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:142:in `block in instance'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:140:in `synchronize'
/home/rof/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/singleton.rb:140:in `instance'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-1.4.1/lib/omniauth.rb:119:in `config'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-oauth2-1.4.0/lib/omniauth/strategies/oauth2.rb:127:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth/strategies/facebook.rb:1:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth/facebook.rb:2:in `<top (required)>'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/rof/cache/bundler/ruby/2.4.0/bundler/gems/rails-4d9c591a91c3/activesupport/lib/active_support/dependencies.rb:293:in `require'
/home/rof/cache/bundler/ruby/2.4.0/gems/omniauth-facebook-4.0.0/lib/omniauth-facebook.rb:1:in `<top (required)>'
@JimW

This comment has been minimized.

Show comment
Hide comment
@JimW

JimW Feb 10, 2017

oauth2 (1.3.0)
  faraday (>= 0.8, < 0.11)
  jwt (~> 1.0)
  multi_json (~> 1.3)
  multi_xml (~> 0.5)
  rack (>= 1.2, < 3)
omniauth (1.4.1)
  hashie (>= 1.2, < 3.5.2)
  rack (>= 1.0, < 3)
omniauth-google-oauth2 (0.4.1)
  jwt (~> 1.5.2)
  multi_json (~> 1.3)
  omniauth (>= 1.1.1)
  omniauth-oauth2 (>= 1.3.1)
omniauth-oauth2 (1.3.1)
  oauth2 (~> 1.0)
  omniauth (~> 1.2)

This is Rails 4.2.7.1

JimW commented Feb 10, 2017

oauth2 (1.3.0)
  faraday (>= 0.8, < 0.11)
  jwt (~> 1.0)
  multi_json (~> 1.3)
  multi_xml (~> 0.5)
  rack (>= 1.2, < 3)
omniauth (1.4.1)
  hashie (>= 1.2, < 3.5.2)
  rack (>= 1.0, < 3)
omniauth-google-oauth2 (0.4.1)
  jwt (~> 1.5.2)
  multi_json (~> 1.3)
  omniauth (>= 1.1.1)
  omniauth-oauth2 (>= 1.3.1)
omniauth-oauth2 (1.3.1)
  oauth2 (~> 1.0)
  omniauth (~> 1.2)

This is Rails 4.2.7.1

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

@matthewrudy Are you in a Rails app or a plain old Rack app?

Contributor

michaelherold commented Feb 10, 2017

@matthewrudy Are you in a Rails app or a plain old Rack app?

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

@JimW Can you try bumping up to 3.5.2 and see if the problem persists for you?

Contributor

michaelherold commented Feb 10, 2017

@JimW Can you try bumping up to 3.5.2 and see if the problem persists for you?

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold it's rails 5.0.1 with a few extra bits for ruby 2.4.0 support

gem 'rails', '~> 5.0.0', github: 'rails/rails',
                         branch: '5-0-stable',
                         ref: '4d9c591a91c3' # January 2nd 2017
Contributor

matthewrudy commented Feb 10, 2017

@michaelherold it's rails 5.0.1 with a few extra bits for ruby 2.4.0 support

gem 'rails', '~> 5.0.0', github: 'rails/rails',
                         branch: '5-0-stable',
                         ref: '4d9c591a91c3' # January 2nd 2017
@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold the only omniauth configuration I have is via devise

config.omniauth :facebook, Settings.facebook.key, Settings.facebook.secret
Contributor

matthewrudy commented Feb 10, 2017

@michaelherold the only omniauth configuration I have is via devise

config.omniauth :facebook, Settings.facebook.key, Settings.facebook.secret
@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

Hmm ...

@matthewrudy Can you open a Rails console and see what Hashie.logger returns? Also, do you have an entry for Hashie in your Gemfile at all?

Contributor

michaelherold commented Feb 10, 2017

Hmm ...

@matthewrudy Can you open a Rails console and see what Hashie.logger returns? Also, do you have an entry for Hashie in your Gemfile at all?

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold this seems minimal enough to break it without any of my app code.

bundle exec irb
2.4.0 :001 > require 'rails/all'
re => true
2.4.0 :002 > require 'omniauth-facebook'
NoMethodError: private method `warn' called for nil:NilClass

update:

hashie is not in my gemfile

Contributor

matthewrudy commented Feb 10, 2017

@michaelherold this seems minimal enough to break it without any of my app code.

bundle exec irb
2.4.0 :001 > require 'rails/all'
re => true
2.4.0 :002 > require 'omniauth-facebook'
NoMethodError: private method `warn' called for nil:NilClass

update:

hashie is not in my gemfile

@JimW

This comment has been minimized.

Show comment
Hide comment
@JimW

JimW Feb 10, 2017

@michaelherold I had locked it manually to < 3.5.2 to get around the error. 3.5.2 caused the error that I reported.

JimW commented Feb 10, 2017

@michaelherold I had locked it manually to < 3.5.2 to get around the error. 3.5.2 caused the error that I reported.

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

@matthewrudy Thank you, I'll see what I can find with that.

@JimW Gotcha, sorry about that.

Contributor

michaelherold commented Feb 10, 2017

@matthewrudy Thank you, I'll see what I can find with that.

@JimW Gotcha, sorry about that.

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold I think simply at that time in the boot cycle ::Rails is defined, but there is no Rails.logger assigned

So I think log_built_in_message needs to just deal with a nil logger

Hashie.logger.warn(

Contributor

matthewrudy commented Feb 10, 2017

@michaelherold I think simply at that time in the boot cycle ::Rails is defined, but there is no Rails.logger assigned

So I think log_built_in_message needs to just deal with a nil logger

Hashie.logger.warn(

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold or, probably better

register a rails initializer that sets the logger on boot
rather than detecting ::Rails

Contributor

matthewrudy commented Feb 10, 2017

@michaelherold or, probably better

register a rails initializer that sets the logger on boot
rather than detecting ::Rails

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

That's definitely it. Nice debugging!

Contributor

michaelherold commented Feb 10, 2017

That's definitely it. Nice debugging!

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

I'm trying to put something together but it sounds like you have a good handle on it. Would you be able to put together a PR with a Railtie that handles setting the logger?

Contributor

michaelherold commented Feb 10, 2017

I'm trying to put something together but it sounds like you have a good handle on it. Would you be able to put together a PR with a Railtie that handles setting the logger?

@justinmalone

This comment has been minimized.

Show comment
Hide comment
@justinmalone

justinmalone Feb 10, 2017

@matthewrudy @michaelherold , I appreciate you guys ripping through that, I have the same problem. Is there any chance you can give us a snippet and where to put it, Not sure how to implement your fix. Thanks.

@matthewrudy @michaelherold , I appreciate you guys ripping through that, I have the same problem. Is there any chance you can give us a snippet and where to put it, Not sure how to implement your fix. Thanks.

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold @justinmalone just working on it.

Contributor

matthewrudy commented Feb 10, 2017

@michaelherold @justinmalone just working on it.

@dblock

This comment has been minimized.

Show comment
Hide comment
@dblock

dblock Feb 10, 2017

Contributor

Please try to modify #402 to fail in the same way so that we can have a reliable test for the future.

Contributor

dblock commented Feb 10, 2017

Please try to modify #402 to fail in the same way so that we can have a reliable test for the future.

@michaelherold

This comment has been minimized.

Show comment
Hide comment
@michaelherold

michaelherold Feb 10, 2017

Contributor

I've got a failing test. I'll push it up.

Contributor

michaelherold commented Feb 10, 2017

I've got a failing test. I'll push it up.

@matthewrudy

This comment has been minimized.

Show comment
Hide comment
@matthewrudy

matthewrudy Feb 10, 2017

Contributor

@michaelherold cool

I think my fix is good to go #403
hope it passes your test.

Contributor

matthewrudy commented Feb 10, 2017

@michaelherold cool

I think my fix is good to go #403
hope it passes your test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment