omniauth-evernote
omniauth-evernote copied to clipboard
can't convert nil into String
Hi,
I just added this but something seems to be going wrong in the callback after I authorise the app in evernote sandbox. Any ideas?
Started GET "/users/auth/evernote/callback?oauth_token=mattbeedle.13A06B664E5.687474703A2F2F67657468697265732E6465762F75736572732F617574682F657665726E6F74652F63616C6C6261636B.1AF9E1F3B624DB8F433893961563B803&oauth_verifier=58E0104ECDFDB9C91939DEDC1067DCA3" for 127.0.0.1 at 2012-09-27 09:52:39 +0200
TypeError (can't convert nil into String):
thrift (0.8.0) lib/thrift/transport/http_client_transport.rb:47:in initialize' thrift (0.8.0) lib/thrift/transport/http_client_transport.rb:47:in
new'
thrift (0.8.0) lib/thrift/transport/http_client_transport.rb:47:in flush' thrift_client (0.8.2) lib/thrift_client/server.rb:87:in
flush'
thrift (0.8.0) lib/thrift/client.rb:41:in send_message' evernote (1.2.1) vendor/gen-rb/evernote/edam/user_store.rb:87:in
send_getUser'
evernote (1.2.1) vendor/gen-rb/evernote/edam/user_store.rb:82:in getUser' thrift_client (0.8.2) lib/thrift_client/abstract_thrift_client.rb:148:in
handled_proxy'
thrift_client (0.8.2) lib/thrift_client/abstract_thrift_client.rb:51:in getUser' evernote (1.2.1) lib/evernote/client.rb:14:in
method_missing'
omniauth-evernote (1.1.0) lib/omniauth/strategies/evernote.rb:32:in raw_info' omniauth-evernote (1.1.0) lib/omniauth/strategies/evernote.rb:15:in
block in class:Evernote'
omniauth (1.1.1) lib/omniauth/strategy.rb:102:in instance_eval' omniauth (1.1.1) lib/omniauth/strategy.rb:102:in
block in compile_stack'
omniauth (1.1.1) lib/omniauth/strategy.rb:101:in each' omniauth (1.1.1) lib/omniauth/strategy.rb:101:in
inject'
omniauth (1.1.1) lib/omniauth/strategy.rb:101:in compile_stack' (eval):7:in
uid_stack'
omniauth (1.1.1) lib/omniauth/strategy.rb:311:in uid' omniauth (1.1.1) lib/omniauth/strategy.rb:327:in
auth_hash'
omniauth (1.1.1) lib/omniauth/strategy.rb:355:in callback_phase' omniauth-oauth (1.0.1) lib/omniauth/strategies/oauth.rb:58:in
callback_phase'
omniauth (1.1.1) lib/omniauth/strategy.rb:219:in callback_call' omniauth (1.1.1) lib/omniauth/strategy.rb:175:in
call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in call' warden (1.2.1) lib/warden/manager.rb:35:in
block in call'
warden (1.2.1) lib/warden/manager.rb:34:in catch' warden (1.2.1) lib/warden/manager.rb:34:in
call'
actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:in
call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in
call'
remotipart (1.0.2) lib/remotipart/middleware.rb:30:in call' actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in
call'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in call' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in
context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in call' actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in
call'
dragonfly (0.9.12) lib/dragonfly/cookie_monster.rb:9:in call' activerecord (3.2.8) lib/active_record/query_cache.rb:64:in
call'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in call' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in
block in call'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in _run__788053494452111219__call__295962505587541732__callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in
__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in _run_call_callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:81:in
run_callbacks'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in
call'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in call' actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' railties (3.2.8) lib/rails/rack/logger.rb:26:in
call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in call' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in
call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in call' rack (1.4.1) lib/rack/runtime.rb:17:in
call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.4.1) lib/rack/lock.rb:15:in
call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in call' dragonfly (0.9.12) lib/dragonfly/middleware.rb:13:in
call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:in
fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:in
call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.8) lib/rails/engine.rb:479:in
call'
railties (3.2.8) lib/rails/application.rb:223:in call' railties (3.2.8) lib/rails/railtie/configurable.rb:30:in
method_missing'
Currently I don't have much free time, but I'll try to check it out next week. If you figure out what's wrong please create PR.
It's a bug in thrift 0.8.0. It's already fixed on their trunk branch, but I'm not really sure how to point bundler to it. It's at https://github.com/apache/thrift/tree/trunk/lib/rb
The quick fix would be to add the following code e.g. to config/initializers/thrift.rb
file:
require "thrift"
module Thrift
class HTTPClientTransport
def flush
http = Net::HTTP.new @url.host, @url.port
http.use_ssl = @url.scheme == "https"
resp = http.post(@url.request_uri, @outbuf, @headers)
data = resp.body
@inbuf = StringIO.new data
@outbuf = ""
end
end
end
This code is taken from https://github.com/apache/thrift/blob/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb#L43-50. Let me know if it works for you. I'll add info about this fix for thrift 0.8.0 to the README file, or maybe release a new version of omniauth-evernote gem with this fix.