#836 new
shawn (at vegantech)

[production][students#show] NoMethodError: undefined method `id' for nil:NilClass

Reported by shawn (at vegantech) | April 27th, 2015 @ 10:49 AM | in Rails 4 PreUpgrade

See this exception on Errbit

NoMethodError: undefined method `id' for nil:NilClass

Summary

URL

https://madison.simspilot.org/students/1044055832?username=B726051"

Where

students#show

Occured

Apr 27 5:19pm

Similar

0

Params

{
"action" => "show", "controller" => "students", "id" => "1044055832", "username" => "B726051" }

Session

{
"_csrf_token" => "96YxXcHXq1IdMrPTGJRA2DstS94EWQHGPhjzhkHAtkU=", "requested_url" => "https://madison.simspilot.org/students/1044055832?username=B726051", "school_id" => "996335085", "selected_student" => "1044063247", "selected_students" => "[\"1044063247\"]", "session_id" => "4bdecadc5b2b480f0945f050fbf52c27", "warden_user_user_key" => "[\"User\", [\"996360869\"], \"$2a$10$Zdzy5a6xMcVql4zDrEinke\"]" }

Backtrace


82: app/controllers/students_controller.rb -> enforce_session_selections
440: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> run_FRAGMENT__process_action__FRAGMENT__callbacks
405: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> __run_callback
385: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> run_process_actioncallbacks
81: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> run_callbacks
17: [GEM_ROOT]/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb -> process_action
29: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb -> process_action
30: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb -> block in process_action
123: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/notifications.rb -> block in instrument
20: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb -> instrument
123: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/notifications.rb -> instrument
29: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb -> process_action
207: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal/params_wrapper.rb -> process_action
18: [GEM_ROOT]/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb -> process_action
32: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/rails3/action_controller.rb -> block in process_action
366: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/controller_instrumentation.rb -> perform_action_with_newrelic_trace
31: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/rails3/action_controller.rb -> process_action
121: [GEM_ROOT]/gems/actionpack-3.2.21/lib/abstract_controller/base.rb -> process
45: [GEM_ROOT]/gems/actionpack-3.2.21/lib/abstract_controller/rendering.rb -> process
203: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal.rb -> dispatch
14: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal/rack_delegation.rb -> dispatch
246: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_controller/metal.rb -> block in action
73: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb -> call
73: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb -> dispatch
36: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb -> call
68: [GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb -> block in call
56: [GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb -> each
56: [GEM_ROOT]/gems/journey-1.0.4/lib/journey/router.rb -> call
608: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
177: [GEM_ROOT]/gems/omniauth-1.1.3/lib/omniauth/strategy.rb -> call!
157: [GEM_ROOT]/gems/omniauth-1.1.3/lib/omniauth/strategy.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
177: [GEM_ROOT]/gems/omniauth-1.1.3/lib/omniauth/strategy.rb -> call!
157: [GEM_ROOT]/gems/omniauth-1.1.3/lib/omniauth/strategy.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
30: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/rack/agent_hooks.rb -> traced_call
55: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
35: [GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb -> block in call
34: [GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb -> catch
34: [GEM_ROOT]/gems/warden-1.2.1/lib/warden/manager.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
9: lib/best_standards_support.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
23: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/etag.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
25: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/conditionalget.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
14: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/head.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
21: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/params_parser.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
242: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/flash.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
210: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/session/abstract/id.rb -> context
205: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/session/abstract/id.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
341: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/cookies.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
64: [GEM_ROOT]/gems/activerecord-3.2.21/lib/active_record/query_cache.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
479: [GEM_ROOT]/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/connection_pool.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
28: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb -> block in call
405: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> run_FRAGMENT__call__FRAGMENT__callbacks
405: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> __run_callback
385: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> _run_call_callbacks
81: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/callbacks.rb -> run_callbacks
27: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
102: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/sendfile.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
31: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/remote_ip.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
16: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/debug_exceptions.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
56: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/show_exceptions.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
32: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/rack/logger.rb -> call_app
16: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/rack/logger.rb -> block in call
22: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/tagged_logging.rb -> tagged
16: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/rack/logger.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
22: [GEM_ROOT]/gems/actionpack-3.2.21/lib/action_dispatch/middleware/request_id.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
21: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/methodoverride.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
17: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/runtime.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
72: [GEM_ROOT]/gems/activesupport-3.2.21/lib/active_support/cache/strategy/local_cache.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
15: [GEM_ROOT]/gems/rack-1.4.5/lib/rack/lock.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
136: [GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb -> forward
245: [GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb -> fetch
185: [GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb -> lookup
66: [GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb -> call!
51: [GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
484: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/engine.rb -> call
231: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/application.rb -> call
30: [GEM_ROOT]/gems/railties-3.2.21/lib/rails/railtie/configurable.rb -> method_missing
57: [GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb -> call
74: /home/rails/.rvm/gems/ruby-2.0.0-p451@sims_ruby1.9.3/gems/passenger-4.0.50/lib/phusion_passenger/rack/thread_handler_extension.rb -> process_request
141: /home/rails/.rvm/gems/ruby-2.0.0-p451@sims_ruby1.9.3/gems/passenger-4.0.50/lib/phusion_passenger/request_handler/thread_handler.rb -> accept_and_process_next_request
109: /home/rails/.rvm/gems/ruby-2.0.0-p451@sims_ruby1.9.3/gems/passenger-4.0.50/lib/phusion_passenger/request_handler/thread_handler.rb -> main_loop
455: /home/rails/.rvm/gems/ruby-2.0.0-p451@sims_ruby1.9.3/gems/passenger-4.0.50/lib/phusion_passenger/request_handler.rb -> block (3 levels) in start_threads

Environment

SERVER_SOFTWARE: Apache/2.4.7 (Ubuntu)

SERVER_PROTOCOL: HTTP/1.1

SERVER_NAME: madison.simspilot.org

SERVER_ADMIN: [no address given]

SERVER_ADDR: 107.170.213.213

SERVER_PORT: 443

REMOTE_ADDR: 199.197.99.141

REMOTE_PORT: 58883

REQUEST_METHOD: GET

QUERY_STRING: username=B726051

HTTPS: on

DOCUMENT_ROOT: /srv/sims/current/public

REQUEST_URI: /students/1044055832?username=B726051

SCRIPT_NAME:

PATH_INFO: /students/1044055832

HTTP_HOST: madison.simspilot.org

HTTP_CONNECTION: keep-alive

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

HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36

HTTP_REFERER: https://campus.madison.k12.wi.us/campus/nav/externalResource.jsp?co...;

HTTP_ACCEPT_ENCODING: gzip, deflate, sdch

HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8

HTTP_X_FORWARDED_PROTO: https

SCRIPT_URL: /students/1044055832

SCRIPT_URI: https://madison.simspilot.org/students/1044055832

SSL_TLS_SNI: madison.simspilot.org

PASSENGER_STATUS_LINE: false

PASSENGER_APP_ROOT: /srv/sims/current

PASSENGER_APP_GROUP_NAME: /srv/sims/current

PASSENGER_RUBY: /home/rails/.rvm/gems/ruby-2.0.0-p451@sims_ruby1.9.3/wrappers/ruby

PASSENGER_APP_ENV: production

PASSENGER_MIN_PROCESSES: 3

PASSENGER_MAX_PROCESSES: 0

PASSENGER_MAX_REQUESTS: 350

PASSENGER_SPAWN_METHOD: smart

PASSENGER_APP_TYPE: rack

PASSENGER_MAX_PRELOADER_IDLE_TIME: -1

PASSENGER_DEBUGGER: false

PASSENGER_SHOW_VERSION_IN_HEADER: true

PASSENGER_STAT_THROTTLE_RATE: 0

PASSENGER_RESTART_DIR:

PASSENGER_FRIENDLY_ERROR_PAGES: true

PASSENGER_CONNECT_PASSWORD: RZcAFCDeu2sGPaEkmdwYpyCG7DI6zMjBMHWQV47447s

rack_version: ["1", "2"]

rack_multithread: false

rack_multiprocess: true

rack_run_once: false

rack_url_scheme: https

rack_hijack?: true

rack_hijack: #

newrelic_captured_request: true

ORIGINAL_FULLPATH: /students/1044055832?username=B726051

action_dispatch_parameter_filter: ["password"]

action_dispatch_show_exceptions: true

action_dispatch_show_detailed_exceptions: false

rack-cache_cache_key: Rack::Cache::Key

rack-cache_verbose: false

rack-cache_metastore: rails:/

rack-cache_entitystore: rails:/

rack-cache_default_ttl: 0

rack-cache_ignore_headers: ["Set-Cookie"]

rack-cache_private_headers: ["Authorization", "Cookie"]

rack-cache_allow_reload: false

rack-cache_allow_revalidate: false

rack-cache_use_native_ttl: false

action_dispatch_request_id: e805b055aa6b3ca7a0d30076e9e3466f

action_dispatch_remote_ip: 199.197.99.141

warden: Warden::Proxy:70097968364640 @config={:default_scope=>:user, :scope_defaults=>{}, :default_strategies=>{:user=>[:database_authenticatable]}, :intercept_401=>false, :failure_app=>#Devise::Delegator:0x00000005265cc8}

newrelic_agent_hooks_fired: true

action_dispatch_request_path_parameters: {"action"=>"show", "controller"=>"students", "id"=>"1044055832"}

action_dispatch_request_content_type:

action_dispatch_request_request_parameters:

rack_request_query_string: username=B726051

rack_request_query_hash: {"username"=>"B726051"}

action_dispatch_request_query_parameters: {"username"=>"B726051"}

action_dispatch_request_parameters: {"username"=>"B726051", "action"=>"show", "controller"=>"students", "id"=>"1044055832"}

action_dispatch_request_formats: ["text/html"]

Comments and changes to this ticket

  • shawn (at vegantech)

    shawn (at vegantech) April 27th, 2015 @ 10:50 AM

    error happens when user doesn't have access to school where student is enrolled
    should provide a flash notice instead of throwing an exception.

  • shawn (at vegantech)

    shawn (at vegantech) May 5th, 2015 @ 01:20 PM

    Student belongs to groups in School A and B, but is only enrolled in School B
    User has access only to School A, but has access to group containing student.

    So student belongs to user, but user cannot access.
    School auth fails.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Student Intervention Monitoring System

Shared Ticket Bins

People watching this ticket

Tags

Pages