instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.52k stars 2.45k forks source link

New install fails #2037

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi,

On a fresh install following the production guide I get failures when running: RAILS_ENV=production bundle exec rake canvas:compile_assets, in the "Generate Assets" section.

Error --------------------- rake aborted! Parallel::UndumpableException: NoMethodError: undefined method `requirements' for nil:NilClass Did you mean? require_dependency

Happens no matter what I do - followed the instructions line per line.

When I look in setup.rb on line 45 the fail is a results of the statement "@route.requirements[:controllers]"

I understand the method is missing; As for how to fix?

Help

Stacktrace:

/opt/canvas/doc/api/method_details/html/setup.rb:45:in get_routes' /opt/canvas/doc/api/method_details/html/setup.rb:21:ininit' /opt/canvas/doc/api/method_details/html/setup.rb:45:in get_routes' /opt/canvas/doc/api/method_details/html/setup.rb:21:ininit' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:193:in initialize' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:131:innew' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:136:in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:372:inrender_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:259:in block (2 levels) in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:ineach' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:in block in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:404:inadd_options' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:255:in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:277:inblock in yieldall' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:412:in with_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:277:inyieldall' /opt/canvas/doc/api/topic/html/method_details_list.erb:5:in block in _erb_cache_6' /opt/canvas/doc/api/topic/html/method_details_list.erb:4:ineach' /opt/canvas/doc/api/topic/html/method_details_list.erb:4:in each_with_index' /opt/canvas/doc/api/topic/html/method_details_list.erb:4:in_erb_cache_6' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:287:in erb' /opt/canvas/doc/api/topic/html/setup.rb:35:inmethod_details_list' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:367:in render_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:259:inblock (2 levels) in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:in each' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:inblock in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:398:in add_options' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:255:inrun' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:136:in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:372:inrender_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:259:in block (2 levels) in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:ineach' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:in block in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:398:inadd_options' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:255:in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:277:inblock in yieldall' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:412:in with_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:277:inyieldall' /opt/canvas/doc/api/layout/html/layout.erb:18:in _erb_cache_0' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:287:inerb' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:369:in render_section' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:259:inblock (2 levels) in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:in each' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:256:inblock in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:398:in add_options' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:255:inrun' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:136:in run' /opt/canvas/doc/api/fulldoc/html/setup.rb:184:inblock in init' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/engine.rb:123:in block in with_serializer' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/logging.rb:82:incapture' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/engine.rb:121:in with_serializer' /opt/canvas/doc/api/fulldoc/html/setup.rb:183:ininit' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:193:in initialize' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:131:innew' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/template.rb:136:in run' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/templates/engine.rb:105:ingenerate' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/cli/yardoc.rb:356:in run_generate' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/cli/yardoc.rb:267:inrun' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/yard-0.9.25/lib/yard/rake/yardoc_task.rb:74:in block in define' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/sentry-ruby-core-5.1.0/lib/sentry/rake.rb:26:inexecute' /opt/canvas/lib/tasks/canvas.rake:84:in block (6 levels) in <top (required)>' /opt/canvas/lib/tasks/canvas.rake:12:inlog_time' /opt/canvas/lib/tasks/canvas.rake:87:in block (5 levels) in <top (required)>' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:515:incall_with_index' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:485:in process_incoming_jobs' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:465:inblock in worker' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:456:in fork' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:456:inworker' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:447:in block in create_workers' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:ineach' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:in each_with_index' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:increate_workers' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:386:in work_in_processes' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:289:inmap' /opt/canvas/lib/tasks/canvas.rake:80:in block (4 levels) in <top (required)>' /opt/canvas/lib/tasks/canvas.rake:79:ineach' /opt/canvas/lib/tasks/canvas.rake:79:in block (3 levels) in <top (required)>' /opt/canvas/lib/tasks/canvas.rake:78:inblock (2 levels) in <top (required)>' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/sentry-ruby-core-5.1.0/lib/sentry/rake.rb:24:in execute' /opt/canvas/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in<top (required)>' Tasks: TOP => canvas:compile_assets (See full trace by running task with --trace)

halt23 commented 2 years ago

hi i have this problem to is there already a pr to fix it?

Musicminion commented 2 years ago

rake aborted problem may happen in prol branch and master branch

my suggestion is try to use another branch to deploy your canvas, like stable/2021 series

an280420 commented 2 years ago

Hello. Try to update yarn. But use command

sudo apt update --fix-missing
sudo apt upgrade
lyhr00ly commented 1 year ago

I have same problem today, for me, i try to add new api controller file and write routes.rb like below: get 'xxx/action' => 'xxx#action' Although it works fine, but yard doc api generate task couldn't find my new route rule, so it's abord. There is two way to solve it:

  1. add route as blow under ApiRouteSet::V1 namespace and then run canvas:compile_assets again
scope(controller: :xxx) do
  get 'xxx/action', action: 'action', as: 'xxxxx'
end  
  1. add env COMPILE_ASSETS_API_DOCS=0 before run canvas:compile_assets, this will do not generate api doc, no bug any more

BTW. I don't know if it's the correct to do this like above, but it work for me, just for reference