datasektionen / purjo

Datasektionens tidigare hemsida (deprecated)
http://purjo.datasektionen.se
1 stars 0 forks source link

[production][people#show] NoMethodError: undefined method `name' for nil:NilClass #74

Open Frost opened 10 years ago

Frost commented 10 years ago

See this exception on Errbit

NoMethodError: undefined method `name' for nil:NilClass

Summary

URL

http://www.datasektionen.se/personer/simstr"

Where

people#show

Occured

Oct 31 4:20pm

Similar

172

Params

{
  "action" => "show",
  "controller" => "people",
  "id" => "simstr"
}

Session

{
  "_csrf_token" => "OimCbv235wmvTrNhMVsbhKwMmeRgRZEfcmw6q4HBu68=",
  "return_url" => "http://www.datasektionen.se/kontakt/spex",
  "session_id" => "9f07718613701f0840dbca311921e607"
}

Backtrace

74:  app/views/people/show.html.haml -> **_app_views_people_show_html_haml__FRAGMENT__**
13:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/relation.rb -> **each**
13:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/relation.rb -> **__send__**
13:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/relation.rb -> **each**
72:  app/views/people/show.html.haml -> **_app_views_people_show_html_haml__FRAGMENT__**
135:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/template.rb -> **send**
135:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/template.rb -> **render**
54:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications.rb -> **instrument**
127:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/template.rb -> **render**
59:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb -> **_render_template**
52:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications.rb -> **instrument**
21:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications/instrumenter.rb -> **instrument**
52:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications.rb -> **instrument**
56:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb -> **_render_template**
26:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb -> **render_without_haml**
13:  [GEM_ROOT]/gems/haml-3.1.2/lib/haml/helpers/action_view_mods.rb -> **render**
115:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb -> **_render_template**
109:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb -> **render_to_body**
47:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/renderers.rb -> **render_to_body**
55:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/compatibility.rb -> **render_to_body**
102:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb -> **render_to_string**
93:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb -> **render**
17:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/rendering.rb -> **render**
40:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **render**
5:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/core_ext/benchmark.rb -> **ms**
308:  /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/benchmark.rb -> **realtime**
5:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/core_ext/benchmark.rb -> **ms**
40:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **render**
78:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **cleanup_view_runtime**
15:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/railties/controller_runtime.rb -> **cleanup_view_runtime**
15:  [GEM_ROOT]/gems/sunspot_rails-1.3.3/lib/sunspot/rails/railties/controller_runtime.rb -> **cleanup_view_runtime**
39:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **render**
10:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/implicit_render.rb -> **default_render**
5:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/implicit_render.rb -> **send_action**
150:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/base.rb -> **process_action**
11:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/rendering.rb -> **process_action**
18:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/callbacks.rb -> **process_action**
456:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **_run__FRAGMENT__process_action__FRAGMENT__callbacks**
410:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **send**
410:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **_run_process_action_callbacks**
94:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **send**
94:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **run_callbacks**
17:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/callbacks.rb -> **process_action**
30:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **process_action**
52:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications.rb -> **instrument**
21:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications/instrumenter.rb -> **instrument**
52:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/notifications.rb -> **instrument**
29:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb -> **process_action**
17:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/rescue.rb -> **process_action**
34:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/agent/instrumentation/rails3/action_controller.rb -> **process_action**
255:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb -> **perform_action_with_newrelic_trace**
242:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/agent/method_tracer.rb -> **trace_execution_scoped**
250:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb -> **perform_action_with_newrelic_trace**
33:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/agent/instrumentation/rails3/action_controller.rb -> **process_action**
119:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/base.rb -> **process**
41:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb -> **process**
138:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal.rb -> **dispatch**
14:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal/rack_delegation.rb -> **dispatch**
178:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_controller/metal.rb -> **action**
62:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb -> **call**
62:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb -> **dispatch**
27:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.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**
103:  [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.9/lib/action_dispatch/routing/route_set.rb -> **call**
23:  [GEM_ROOT]/gems/newrelic_rpm-3.3.1/lib/new_relic/rack/browser_monitoring.rb -> **call**
54:  [GEM_ROOT]/gems/sass-3.1.6/lib/sass/../sass/plugin/rack.rb -> **call**
17:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/best_standards_support.rb -> **call**
14:  [GEM_ROOT]/gems/actionpack-3.0.9/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.9/lib/action_dispatch/middleware/params_parser.rb -> **call**
182:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/flash.rb -> **call**
149:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/session/abstract_store.rb -> **call**
302:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/cookies.rb -> **call**
32:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/query_cache.rb -> **call**
28:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/query_cache.rb -> **cache**
12:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/query_cache.rb -> **cache**
31:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/query_cache.rb -> **call**
354:  [GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb -> **call**
46:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/callbacks.rb -> **call**
416:  [GEM_ROOT]/gems/activesupport-3.0.9/lib/active_support/callbacks.rb -> **_run_call_callbacks**
44:  [GEM_ROOT]/gems/actionpack-3.0.9/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.9/lib/action_dispatch/middleware/remote_ip.rb -> **call**
47:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/show_exceptions.rb -> **call**
13:  [GEM_ROOT]/gems/railties-3.0.9/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.9/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**
125:  [GEM_ROOT]/gems/refraction-0.2.0/lib/refraction.rb -> **call**
30:  [GEM_ROOT]/gems/actionpack-3.0.9/lib/action_dispatch/middleware/static.rb -> **call**
168:  [GEM_ROOT]/gems/railties-3.0.9/lib/rails/application.rb -> **call**
77:  [GEM_ROOT]/gems/railties-3.0.9/lib/rails/application.rb -> **send**
77:  [GEM_ROOT]/gems/railties-3.0.9/lib/rails/application.rb -> **method_missing**
528:  [GEM_ROOT]/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **process_client**
600:  [GEM_ROOT]/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **worker_loop**
485:  [GEM_ROOT]/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **spawn_missing_workers**
496:  [GEM_ROOT]/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **maintain_worker_count**
270:  [GEM_ROOT]/gems/unicorn-4.1.1/lib/unicorn/http_server.rb -> **join**
121:  [GEM_ROOT]/gems/unicorn-4.1.1/bin/unicorn -> **[unknown method]**
19:  [GEM_ROOT]/bin/unicorn -> **load**
19:  [GEM_ROOT]/bin/unicorn -> **[unknown method]**

Environment

HTTP_HOST: www.datasektionen.se
rack_logger: #
action_dispatch_request_parameters: {"action"=>"show", "id"=>"simstr", "controller"=>"people"}
action_dispatch_request_formats: text/html
rack_session: {"_csrf_token"=>"OimCbv235wmvTrNhMVsbhKwMmeRgRZEfcmw6q4HBu68=", "return_url"=>"http://www.datasektionen.se/kontakt/spex", "session_id"=>"9f07718613701f0840dbca311921e607"}
SERVER_NAME: www.datasektionen.se
HTTP_X_REAL_IP: ::ffff:77.233.225.114
HTTP_USER_AGENT: Mozilla/5.0 (compatible; Abonti/0.91 - http://www.abonti.com)
action_dispatch_remote_ip: ::ffff:77.233.225.114
rack_request_cookie_hash: {"_purjo2_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMU9pbUNidjIzNXdtdlRyTmhNVnNiaEt3TW1lUmdSWkVmY213NnE0SEJ1Njg9Ig9yZXR1cm5fdXJsIi1odHRwOi8vd3d3LmRhdGFzZWt0aW9uZW4uc2Uva29udGFrdC9zcGV4Ig9zZXNzaW9uX2lkIiU5ZjA3NzE4NjEzNzAxZjA4NDBkYmNhMzExOTIxZTYwNw==--09505e37b4d81b319b7e2563ff551875a7542e23"}
rack_url_scheme: http
HTTP_FROM: robot@abonti.com
REQUEST_PATH: /personer/simstr
rack_errors: #
key: rack.request.query_string
action_dispatch_request_unsigned_session_cookie: {"_csrf_token"=>"OimCbv235wmvTrNhMVsbhKwMmeRgRZEfcmw6q4HBu68=", "return_url"=>"http://www.datasektionen.se/kontakt/spex", "session_id"=>"9f07718613701f0840dbca311921e607"}
SERVER_PROTOCOL: HTTP/1.0
REMOTE_ADDR: 127.0.0.1
HTTP_COOKIE2: $Version="1"
rack_version: 11
action_dispatch_secret_token: 8f53924a27ba15125e9242cea92fe326d4c31fe1ec80550836290a364a6004032efcd3566270aadf9b8b20a3e9d9e86a934ec09bbce560153503051bd38f425a
rack_run_once: false
SERVER_SOFTWARE: Unicorn 4.1.1
PATH_INFO: /personer/simstr
rack_request_cookie_string: _purjo2_session=BAh7CCIQX2NzcmZfdG9rZW4iMU9pbUNidjIzNXdtdlRyTmhNVnNiaEt3TW1lUmdSWkVmY213NnE0SEJ1Njg9Ig9yZXR1cm5fdXJsIi1odHRwOi8vd3d3LmRhdGFzZWt0aW9uZW4uc2Uva29udGFrdC9zcGV4Ig9zZXNzaW9uX2lkIiU5ZjA3NzE4NjEzNzAxZjA4NDBkYmNhMzExOTIxZTYwNw%3D%3D--09505e37b4d81b319b7e2563ff551875a7542e23
action_dispatch_request_path_parameters: {"action"=>"show", "controller"=>"people", "id"=>"simstr"}
HTTP_VERSION: HTTP/1.0
rack_multithread: false
action_dispatch_parameter_filter: password
action_dispatch_show_exceptions: true
HTTP_COOKIE: _purjo2_session=BAh7CCIQX2NzcmZfdG9rZW4iMU9pbUNidjIzNXdtdlRyTmhNVnNiaEt3TW1lUmdSWkVmY213NnE0SEJ1Njg9Ig9yZXR1cm5fdXJsIi1odHRwOi8vd3d3LmRhdGFzZWt0aW9uZW4uc2Uva29udGFrdC9zcGV4Ig9zZXNzaW9uX2lkIiU5ZjA3NzE4NjEzNzAxZjA4NDBkYmNhMzExOTIxZTYwNw%3D%3D--09505e37b4d81b319b7e2563ff551875a7542e23
REQUEST_URI: /personer/simstr
action_dispatch_cookies: {"_purjo2_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMU9pbUNidjIzNXdtdlRyTmhNVnNiaEt3TW1lUmdSWkVmY213NnE0SEJ1Njg9Ig9yZXR1cm5fdXJsIi1odHRwOi8vd3d3LmRhdGFzZWt0aW9uZW4uc2Uva29udGFrdC9zcGV4Ig9zZXNzaW9uX2lkIiU5ZjA3NzE4NjEzNzAxZjA4NDBkYmNhMzExOTIxZTYwNw==--09505e37b4d81b319b7e2563ff551875a7542e23"}
rack_multiprocess: true
SERVER_PORT: 80
HTTP_X_FORWARDED_FOR: ::ffff:77.233.225.114
REQUEST_METHOD: GET
action_controller_instance: #
rack_session_options: {"path"=>"/", "secure"=>"false", "key"=>"expire_after", "id"=>"9f07718613701f0840dbca311921e607", "httponly"=>"true"}
HTTP_CONNECTION: close
rack_input: #
HTTP_ACCEPT_ENCODING: gzip
mheine commented 9 years ago

Diskuterade denna bugg idag, den beror troligtvis på att vi försöker visa personer vars funktionärsposter inte längre existerar, typ spexmästare eller Fenixorden

Frost commented 9 years ago

Ah, ja, såklart! Bra grävt.

Det finns uppenbarligen ett problem med att ta bort funktionärsposter, nämligen att man antingen förstör historik, iom att man i stort sett säger att det aldrig funnits någon spexmästare, eller så tar man bort ett mellanled, själva funktionärsposten, men inte tilldelningarna, och det resulterar i att man pajar dataintegriteten i databasen, vilket leder till att sidor 500:ar (dvs, den här buggen).

Jag har för mig att DFunkt inte tillåter att man tar bort funktionärer, men däremot kan man säga att de inte är "aktiva", vilket betyder att de inte dyker upp i listan. Det är nog mer rätt väg att gå. Funktionärssystemet i purjo var aldrig klockrent från början, och jag tror verkligen att vi borde försöka göra oss av med det.

Avemark commented 9 years ago

Jag skulle definitivt rekommendera att byta ut purjos egna funktionärer mot en vy mot dfunkt.

@Frost exponerar dfunkt ett api ännu?

Jag tänker mig att det även kan fullösas med något i stil med FunktionärsTilldelning.where("funktionär is null").destroy_all (översatt till rätt klassnamn och rätt railsversion) Men då förstör vi ju historik, och det är synd. Annars kan man ju sitta och återskapa de saknade posterna och implementera en begränsning av vilka poster som visas, men det låter som jobb(tm)

Frost commented 9 years ago

DFunkt har ännu inget API, nej. Jag ska fixa det nu när jag har lite tid över, och även titta på att få in det i purjo på något vettigt sätt.

Lovisa och jag ska ju sätta oss och kolla på att bygga ett valsystem också, så kan vi riva ut nomineringsbitarna ur purjo sen också.

Det enda vettiga alternativet av de du listar är väl att gå in och återskapa de borttagna posterna (med rätt idn osv), även om det är tråkigt, manuellt pill.

Att ta bort historik är definitivt ett no go.

Avemark commented 9 years ago

why not both?

Som i, spara ned historiken i annat format, ta bort skiten, och senare återskapa historiken i dfunkt