cr0t/pembaca — Issue #1: [production][users/omniauth_callbacks#facebook] NoMethodError: undefined method `[]' for nil:NilClass
Author: cr0t
Created: 2011-12-26 14:48:08+00:00
State: open

[See this exception on Errbit](http://errbit.summercode.com:80/apps/26fe2dedd5cb240cf4304e66654d3170/errs/4ef887b0dd98232c03000015 "See this exception on Errbit")

# NoMethodError: undefined method `[]' for nil:NilClass #
## Summary ##

### URL ###
[http://pembaca.summercode.com/users/auth/facebook/callback?code=AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc](http://pembaca.summercode.com/users/auth/facebook/callback?code=AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc)"

### Where ###
users/omniauth_callbacks#facebook
### Occured ###
Dec 26 3:41pm
### Similar ###
-1
## Params ##
```
{
"action" => "facebook",
"code" => "AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc",
"controller" => "users/omniauth_callbacks"
}
```
## Session ##
```
{
"_csrf_token" => "t2d4noDAXT5ADgt++3mYrt/pCSJXKZ+/craLXh+IUxU=",
"session_id" => "5dc9e1c30cd0167dc5de3d76c17aecce"
}
```
## Backtrace ##
```
13: /app/models/user.rb -> **find_for_facebook_oauth**
4: /app/controllers/users/omniauth_callback_controller.rb -> **facebook**
4: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb -> **send_action**
4: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb -> **send_action**
150: [GEM_ROOT]/gems/actionpack-3.0.10/lib/abstract_controller/base.rb -> **process_action**
11: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/rendering.rb -> **process_action**
18: [GEM_ROOT]/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb -> **process_action**
441: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **_run__1074442148__process_action__2120514126__callbacks**
410: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **send**
410: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **_run_process_action_callbacks**
94: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **send**
94: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **run_callbacks**
17: [GEM_ROOT]/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb -> **process_action**
17: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/rescue.rb -> **process_action**
30: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb -> **process_action**
52: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/notifications.rb -> **instrument**
21: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/notifications/instrumenter.rb -> **instrument**
52: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/notifications.rb -> **instrument**
29: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb -> **process_action**
119: [GEM_ROOT]/gems/actionpack-3.0.10/lib/abstract_controller/base.rb -> **process**
41: [GEM_ROOT]/gems/actionpack-3.0.10/lib/abstract_controller/rendering.rb -> **process**
138: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal.rb -> **dispatch**
14: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal/rack_delegation.rb -> **dispatch**
178: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_controller/metal.rb -> **action**
62: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb -> **call**
62: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb -> **dispatch**
27: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb -> **call**
39: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/routing/mapper.rb -> **call**
148: [GEM_ROOT]/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb -> **call**
93: [GEM_ROOT]/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb -> **recognize**
68: [GEM_ROOT]/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb -> **optimized_each**
92: [GEM_ROOT]/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb -> **recognize**
139: [GEM_ROOT]/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb -> **call**
493: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb -> **call**
366: [GEM_ROOT]/gems/omniauth-1.0.1/lib/omniauth/strategy.rb -> **call_app!**
330: [GEM_ROOT]/gems/omniauth-1.0.1/lib/omniauth/strategy.rb -> **callback_phase**
64: [GEM_ROOT]/gems/omniauth-oauth2-1.0.0/lib/omniauth/strategies/oauth2.rb -> **callback_phase**
204: [GEM_ROOT]/gems/omniauth-1.0.1/lib/omniauth/strategy.rb -> **callback_call**
166: [GEM_ROOT]/gems/omniauth-1.0.1/lib/omniauth/strategy.rb -> **call!**
148: [GEM_ROOT]/gems/omniauth-1.0.1/lib/omniauth/strategy.rb -> **call**
33: [GEM_ROOT]/gems/mongoid-2.2.5/lib/rack/mongoid/middleware/identity_map.rb -> **call**
130: [GEM_ROOT]/gems/mongoid-2.2.5/lib/mongoid.rb -> **unit_of_work**
33: [GEM_ROOT]/gems/mongoid-2.2.5/lib/rack/mongoid/middleware/identity_map.rb -> **call**
35: [GEM_ROOT]/gems/warden-1.1.0/lib/warden/manager.rb -> **call**
34: [GEM_ROOT]/gems/warden-1.1.0/lib/warden/manager.rb -> **catch**
34: [GEM_ROOT]/gems/warden-1.1.0/lib/warden/manager.rb -> **call**
17: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/best_standards_support.rb -> **call**
14: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/head.rb -> **call**
24: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/methodoverride.rb -> **call**
21: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/params_parser.rb -> **call**
182: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/flash.rb -> **call**
149: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/session/abstract_store.rb -> **call**
302: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/cookies.rb -> **call**
46: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb -> **call**
416: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/callbacks.rb -> **_run_call_callbacks**
44: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb -> **call**
106: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/sendfile.rb -> **call**
48: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/remote_ip.rb -> **call**
47: [GEM_ROOT]/gems/actionpack-3.0.10/lib/action_dispatch/middleware/show_exceptions.rb -> **call**
13: [GEM_ROOT]/gems/railties-3.0.10/lib/rails/rack/logger.rb -> **call**
17: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/runtime.rb -> **call**
72: [GEM_ROOT]/gems/activesupport-3.0.10/lib/active_support/cache/strategy/local_cache.rb -> **call**
11: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/lock.rb -> **call**
11: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/lock.rb -> **synchronize**
11: [GEM_ROOT]/gems/rack-1.2.4/lib/rack/lock.rb -> **call**
168: [GEM_ROOT]/gems/railties-3.0.10/lib/rails/application.rb -> **call**
77: [GEM_ROOT]/gems/railties-3.0.10/lib/rails/application.rb -> **send**
77: [GEM_ROOT]/gems/railties-3.0.10/lib/rails/application.rb -> **method_missing**
528: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **process_client**
600: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **worker_loop**
485: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **spawn_missing_workers**
135: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **start**
209: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/unicorn-4.1.1/bin/unicorn_rails -> ****
19: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/bin/unicorn_rails -> **load**
19: /usr/local/rvm/gems/ree-1.8.7-2011.03@global/bin/unicorn_rails -> ****

```
## Environment ##

rack_request_query_hash:
codeAQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc

rack_run_once:
false

SERVER_NAME:
pembaca.summercode.com

HTTP_HOST:
pembaca.summercode.com

HTTP_ACCEPT:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

rack_request_cookie_string:
last_book_id=4d91a396dd98234eba0000c8; last_page_num=1; __utma=192736296.597917872.1315083388.1324331907.1324467830.15; __utmz=192736296.1323238610.9.6.utmcsr=vimeo.com|utmccn=(referral)|utmcmd=referral|utmcct=/user1705316; __utma=149004983.1612642725.1315489071.1324467130.1324910511.11; __utmb=149004983.1.10.1324910511; __utmc=149004983; __utmz=149004983.1324467130.10.4.utmcsr=errbit.summercode.com|utmccn=(referral)|utmcmd=referral|utmcct=/apps/8dd55cbaeccb633ed5cfff1dc96ef089/errs/4e699098dd98235a8a00002a; _pembaca_session=BAh7CSIQX2NzcmZfdG9rZW4iMXQyZDRub0RBWFQ1QURndCsrM21ZcnQvcENTSlhLWisvY3JhTFhoK0lVeFU9Ig9zZXNzaW9uX2lkIiU1ZGM5ZTFjMzBjZDAxNjdkYzVkZTNkNzZjMTdhZWNjZSIUb21uaWF1dGgub3JpZ2luIiNodHRwOi8vcGVtYmFjYS5zdW1tZXJjb2RlLmNvbS8iFG9tbmlhdXRoLnBhcmFtc3sA--791eaba4ba1abb342fa8a75a1f9a1189747c4612

REQUEST_PATH:
/users/auth/facebook/callback

HTTP_USER_AGENT:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7

rack_multiprocess:
true

omniauth_origin:
http://pembaca.summercode.com/

action_dispatch_request_unsigned_session_cookie:
_csrf_tokent2d4noDAXT5ADgt++3mYrt/pCSJXKZ+/craLXh+IUxU=omniauth_originhttp://pembaca.summercode.com/session_id5dc9e1c30cd0167dc5de3d76c17aeccekeyomniauth.params

SERVER_PROTOCOL:
HTTP/1.0

action_dispatch_request_query_parameters:
codeAQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc

HTTP_ACCEPT_LANGUAGE:
en-US,en;q=0.8

action_dispatch_parameter_filter:
password

REMOTE_ADDR:
127.0.0.1

SERVER_SOFTWARE:
Unicorn 4.1.1

PATH_INFO:
/users/auth/facebook/callback

devise_mapping:
#

HTTP_REFERER:
http://pembaca.summercode.com/

action_dispatch_request_parameters:
codeAQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGcactionfacebookcontrollerusers/omniauth_callbacks

rack_session_options:
httponlytruesecurefalseid5dc9e1c30cd0167dc5de3d76c17aeccepath/keydomain

rack_request_query_string:
code=AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc

HTTP_VERSION:
HTTP/1.0

HTTP_COOKIE:
last_book_id=4d91a396dd98234eba0000c8; last_page_num=1; __utma=192736296.597917872.1315083388.1324331907.1324467830.15; __utmz=192736296.1323238610.9.6.utmcsr=vimeo.com|utmccn=(referral)|utmcmd=referral|utmcct=/user1705316; __utma=149004983.1612642725.1315489071.1324467130.1324910511.11; __utmb=149004983.1.10.1324910511; __utmc=149004983; __utmz=149004983.1324467130.10.4.utmcsr=errbit.summercode.com|utmccn=(referral)|utmcmd=referral|utmcct=/apps/8dd55cbaeccb633ed5cfff1dc96ef089/errs/4e699098dd98235a8a00002a; _pembaca_session=BAh7CSIQX2NzcmZfdG9rZW4iMXQyZDRub0RBWFQ1QURndCsrM21ZcnQvcENTSlhLWisvY3JhTFhoK0lVeFU9Ig9zZXNzaW9uX2lkIiU1ZGM5ZTFjMzBjZDAxNjdkYzVkZTNkNzZjMTdhZWNjZSIUb21uaWF1dGgub3JpZ2luIiNodHRwOi8vcGVtYmFjYS5zdW1tZXJjb2RlLmNvbS8iFG9tbmlhdXRoLnBhcmFtc3sA--791eaba4ba1abb342fa8a75a1f9a1189747c4612

action_dispatch_request_formats:
text/html

rack_session:
_csrf_tokent2d4noDAXT5ADgt++3mYrt/pCSJXKZ+/craLXh+IUxU=session_id5dc9e1c30cd0167dc5de3d76c17aecce

rack_input:
#

action_controller_instance:
#

action_dispatch_request_path_parameters:
actionfacebookcontrollerusers/omniauth_callbacks

action_dispatch_remote_ip:
128.73.85.160

rack_logger:
#

REQUEST_URI:
/users/auth/facebook/callback?code=AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc

HTTP_X_FORWARDED_FOR:
128.73.85.160

rack_multithread:
false

SERVER_PORT:
80

HTTP_ACCEPT_CHARSET:
ISO-8859-1,utf-8;q=0.7,*;q=0.3

REQUEST_METHOD:
GET

omniauth_auth:
uid100000465981340infonameSergey KuznetsovurlsFacebookhttp://www.facebook.com/kuznetsov.sgnicknamekuznetsov.sglast_nameKuznetsovimagehttp://graph.facebook.com/100000465981340/picture?type=squarefirst_nameSergeyemailkuznecov.sg@gmail.comcredentialsexpiresfalsetokenAAABkKtzZBFc0BAE1FbcuEfoBdMsSk0atkGKqAaT76MpY6TNC8hDSH6QR2SzZBBWloZCLkqyWv9OZA4VUANZAxqnFLlPyhGtmRn8KIOCZCbjAZDZDextraraw_infonameSergey Kuznetsovfavorite_athletesnameAimee Mullinsid112011862144951usernamekuznetsov.sggendermaletimezone4id100000465981340last_nameKuznetsovlocaleen_USverifiedtruelinkhttp://www.facebook.com/kuznetsov.sgupdated_time2011-12-19T10:33:52+0000workstart_date2009-10employernameqippoid151020238285618emailkuznecov.sg@gmail.comfirst_nameSergeyproviderfacebook

rack_errors:
#

warden:
Warden::Proxy:32595300 @config={:default_strategies=>{:user=>[:rememberable, :database_authenticatable]}, :intercept_401=>false, :scope_defaults=>{}, :default_scope=>:user, :failure_app=>#}

rack_version:
11

rack_url_scheme:
http

key:
action_dispatch.request.content_type

HTTP_ACCEPT_ENCODING:
gzip,deflate,sdch

action_dispatch_cookies:
last_page_num1__utma192736296.597917872.1315083388.1324331907.1324467830.15last_book_id4d91a396dd98234eba0000c8__utmb149004983.1.10.1324910511__utmc149004983_pembaca_sessionBAh7CSIQX2NzcmZfdG9rZW4iMXQyZDRub0RBWFQ1QURndCsrM21ZcnQvcENTSlhLWisvY3JhTFhoK0lVeFU9Ig9zZXNzaW9uX2lkIiU1ZGM5ZTFjMzBjZDAxNjdkYzVkZTNkNzZjMTdhZWNjZSIUb21uaWF1dGgub3JpZ2luIiNodHRwOi8vcGVtYmFjYS5zdW1tZXJjb2RlLmNvbS8iFG9tbmlhdXRoLnBhcmFtc3sA--791eaba4ba1abb342fa8a75a1f9a1189747c4612__utmz192736296.1323238610.9.6.utmcsr=vimeo.com|utmccn=(referral)|utmcmd=referral|utmcct=/user1705316

omniauth_strategy:
#

rack_request_cookie_hash:
last_page_num1last_book_id4d91a396dd98234eba0000c8__utma192736296.597917872.1315083388.1324331907.1324467830.15__utmb149004983.1.10.1324910511__utmc149004983_pembaca_sessionBAh7CSIQX2NzcmZfdG9rZW4iMXQyZDRub0RBWFQ1QURndCsrM21ZcnQvcENTSlhLWisvY3JhTFhoK0lVeFU9Ig9zZXNzaW9uX2lkIiU1ZGM5ZTFjMzBjZDAxNjdkYzVkZTNkNzZjMTdhZWNjZSIUb21uaWF1dGgub3JpZ2luIiNodHRwOi8vcGVtYmFjYS5zdW1tZXJjb2RlLmNvbS8iFG9tbmlhdXRoLnBhcmFtc3sA--791eaba4ba1abb342fa8a75a1f9a1189747c4612__utmz192736296.1323238610.9.6.utmcsr=vimeo.com|utmccn=(referral)|utmcmd=referral|utmcct=/user1705316

action_dispatch_secret_token:
48377ed2c950cac5fc6fbd88e7de4ffdf426979cc4e4e42bb8c21f29273ce06b8fda8409a5019ac314faf9b9eeeb7701fdc460a5bb192f85bbd5856a5bbb8b4c

action_dispatch_show_exceptions:
true

QUERY_STRING:
code=AQAXmjbqSkND96OTjW2iVfMU2-TpTf_oVQ6btB0nOLvXGhxIgVZFg8lzgXaEg_XBX-lhLRqEG1xt6hswel3u_iJ0VIYdWN8HM6_FX0tNo3NptT8mzsa4iw26VIdsNcaDFqF4B84U19VaxBov4b_81wi08EiUou3H9_jXMLvQXN1239x6cZivX0yTVegSdFrlZGc

HTTP_CONNECTION:
close