NoMethodError after course refresh times out

Open
#425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
backend

Research direction

Start with app/controllers/setup/setup_controller.rb, especially add_phase and print_setup_phases at lines 54-73, then follow the call from app/controllers/setup/course_details_controller.rb:17. Reproduce the custom course setup request after a timed-out refresh and identify why the phase object is nil. Done means the request no longer raises NoMethodError or returns a 500 response.

Written by the indexing model from the issue text.

Description

I, [2016-09-29T12:47:14.656054 #5733]  INFO -- : [D8E87AD6-8642-11E6-B378-7B155001D3F1] Started GET "/staging/setup/hy/course/new/custom" for <snip> at 2016-09-29 12:47:14 +0000
I, [2016-09-29T12:47:14.659769 #5733]  INFO -- : [D8E87AD6-8642-11E6-B378-7B155001D3F1] Processing by Setup::CourseDetailsController#custom as HTML
I, [2016-09-29T12:47:14.659831 #5733]  INFO -- : [D8E87AD6-8642-11E6-B378-7B155001D3F1]   Parameters: {"organization_id"=>"hy"}
I, [2016-09-29T12:47:14.663920 #5733]  INFO -- : [D8E87AD6-8642-11E6-B378-7B155001D3F1] Completed 500 Internal Server Error in 4ms
F, [2016-09-29T12:47:14.665595 #5733] FATAL -- : [D8E87AD6-8642-11E6-B378-7B155001D3F1] 
NoMethodError (undefined method `id' for nil:NilClass):
  app/controllers/setup/setup_controller.rb:73:in `add_phase'
  app/controllers/setup/setup_controller.rb:66:in `block in print_setup_phases'
  app/controllers/setup/setup_controller.rb:54:in `each'
  app/controllers/setup/setup_controller.rb:54:in `each_with_index'
  app/controllers/setup/setup_controller.rb:54:in `print_setup_phases'
  app/controllers/setup/course_details_controller.rb:17:in `custom'
Dominant language
Ruby
Stars
51
Forks
42
Avg merge
1h 27m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testmycode/tmc-server

All issues in testmycode/tmc-server

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.