instructure / canvas-lms

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

Compile Assets: Undumpable Exception -- #<EOFError: end of file reached> #929

Closed jakesorce closed 7 years ago

jakesorce commented 8 years ago

Summary:

rake aborted! Undumpable Exception -- # /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:63:in work' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:280:inblock (4 levels) in work_in_processes' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:447:in with_instrumentation' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:279:inblock (3 levels) in work_in_processes' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:in loop' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:inblock (2 levels) in work_in_processes' /var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:138:in `block (2 levels) in in_threads'

Steps to reproduce:

  1. git fetch origin stable && git rebase origin/stable
  2. rm -rf node_modules && npm install
  3. bundle update
  4. RAILS_ENV=production bundle exec rake canvas:compile_assets

    Expected behavior:

Compile assets completes successfully

Additional notes:

node version: 6.8.1 npm version: 3.10.8 ubuntu version: 14.04.5 LTS ruby version: 2.1.9p490

jakesorce commented 8 years ago

also getting a bunch of these errors when running canvas:compile_assets as well:

TypeError: Object prototype may only be an Object or null: undefined at module.exports (/var/canvas/gems/canvas_i18nliner/js/scoped_translate_call.js:9:42) at Object. (/var/canvas/gems/canvas_i18nliner/js/scoped_hbs_extractor.js:4:64) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/var/canvas/gems/canvas_i18nliner/bin/prepare_hbs:6:26) /var/canvas/gems/canvas_i18nliner/js/scoped_translate_call.js:9 ScopedTranslateCall.prototype = Object.create(TranslateCall.prototype);

tierra commented 8 years ago

Could you run that compile rake task with --trace to provide more context on what it's doing, and a more detailed call stack? We really can't tell what broke, and where with your posted call stack.

RAILS_ENV=production bundle exec rake --trace canvas:compile_assets

Then we can figure out with sub-task is failing, and try running that separately, and you should have more detailed error messages there.

jakesorce commented 8 years ago

Seems like 1 of the issues is with the jst:compile command

here is more info:

EOFError: end of file reached /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:in readline' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:inprecompile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:97:in compile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:51:incompile_file' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:34:in `block in compile'

tierra commented 8 years ago

Guess you could run each step of that task like so:

bundle exec rake canvas:compile_assets[1,0,0,0]
bundle exec rake canvas:compile_assets[0,1,0,0]
bundle exec rake canvas:compile_assets[0,0,1,0]
bundle exec rake canvas:compile_assets[0,0,0,1]
tierra commented 8 years ago

You could also try just setting the CANVAS_BUILD_CONCURRENCY environment variable to 1 in order to basically disable parallel builds.

CANVAS_BUILD_CONCURRENCY=1 bundle exec rake canvas:compile_assets

Also, I think this is really only used for the js:build and js:webpack tasks, so you could run those separately.

jakesorce commented 8 years ago

npm run build gives me a ton of these errors: TypeError: Object prototype may only be an Object or null: undefined at module.exports (/var/canvas/gems/canvas_i18nliner/js/scoped_translate_call.js:9:42) at Object.<anonymous> (/var/canvas/gems/canvas_i18nliner/js/scoped_hbs_extractor.js:4:64) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/var/canvas/gems/canvas_i18nliner/bin/prepare_hbs:6:26)

and Seems like 1 of the issues is with the jst:compile command

here is more info:

EOFError: end of file reached /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:in readline' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:inprecompile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:97:in compile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:51:incompile_file' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:34:inblock in compile'`

jakesorce commented 8 years ago

running CANVAS_BUILD_CONCURRENCY=1 bundle exec rake canvas:compile_assets didn't give me any more info.

jakesorce commented 8 years ago

running js:weback seems to complete just fine

running js:build gives me this stack

Tracing dependencies for: compiled/tinymce Error: ENOENT: no such file or directory, open '/var/canvas/public/optimized/jst/MediaComments.js' In module tree: compiled/tinymce tinymce_plugins/instructure_record/plugin tinymce_plugins/instructure_record/mediaEditorLoader media_comments

Error: Error: ENOENT: no such file or directory, open '/var/canvas/public/optimized/jst/MediaComments.js' In module tree: compiled/tinymce tinymce_plugins/instructure_record/plugin tinymce_plugins/instructure_record/mediaEditorLoader media_comments

senseiweb commented 8 years ago

@tierra attempt to run each o the task as mentioned above

Task [0.1.0.0] and [0.0.0.1] fails

[0,1,0,0] => eambcee@BceeCanvas:~/canvas$ $GEM_HOME/bin/bundle exec rake canvas:compile_assets[0,1,0,0] --trace ** Invoke canvas:compile_assets (first_time) ** Execute canvas:compile_assets --> Starting: 'Making sure node_modules are up to date' node is: /usr/bin/node v6.8.1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN i18nliner-handlebars@0.2.0 requires a peer of i18nliner@~0.1.5 but none was installed. npm WARN instructure-icons@0.0.8 requires a peer of react@^0.14.7 || ^15.0.0 but none was installed. npm WARN instructure-icons@0.0.8 requires a peer of react-dom@^0.14.7 || ^15.0.0 but none was installed. npm WARN instructure-ui@0.13.3 requires a peer of react@^0.14.7 || ~15.1.0 but none was installed. npm WARN instructure-ui@0.13.3 requires a peer of react-dom@^0.14.7 || ~15.1.0 but none was installed. npm WARN react-addons-css-transition-group@15.1.0 requires a peer of react@^15.1.0 but none was installed. npm WARN react-overlays@0.6.10 requires a peer of react@>=0.14.0 but none was installed. npm WARN react-overlays@0.6.10 requires a peer of react-dom@>=0.14.0 but none was installed. npm WARN react-prop-types@0.4.0 requires a peer of react@>=0.14.0 but none was installed. --> Finished: 'Making sure node_modules are up to date' in 25.706045726 ** Invoke css:compile (first_time) ** Execute css:compile --> Starting: 'compile css (including custom brands)' --> Finished: 'compile css (including custom brands)' in 3.902129003 working in 1 processes --> Starting: 'compile coffee' --> Starting: 'js:generate' ** Invoke js:generate (first_time) ** Execute js:generate ** Invoke js:build_client_apps (first_time) ** Execute js:build_client_apps Building client app 'canvas_quizzes' Running 'npm install'... npm WARN canvas_quizzes@1.0.0 No license field. Running 'npm run build'... Client app 'canvas_quizzes' was built successfully. --> Creating ember app bundles ** Invoke js:bundle_ember_apps (first_time) ** Execute js:bundle_ember_apps --> Pre-compiling ember handlebars templates ** Invoke jst:ember (first_time) ** Execute jst:ember --> Pre-compiling handlebars templates ** Invoke jst:compile (first_time) ** Execute jst:compile --> Compiling React JSX ** Invoke js:jsx (first_time) ** Execute js:jsx --> Generating plugin extensions ** Invoke js:generate_extensions (first_time) ** Execute js:generate_extensions --> Creating ember app bundles finished in 0.156784711 --> Generating plugin extensions finished in 0.175039477 --> Compiling CoffeeScript with 'coffee' binary --> Pre-compiling ember handlebars templates finished in 20.787816951 --> Pre-compiling handlebars templates finished in 32.413906216 --> Compiling React JSX finished in 171.572205257 --> Compiling CoffeeScript finished in 354.847754216 --> Finished: 'js:generate' in 374.11575316 --> Finished: 'compile coffee' in 374.11601106 --> Starting: 'check JavaScript syntax' ** Invoke canvas:check_syntax (first_time) ** Invoke canvas:check_syntax:all (first_time) ** Execute canvas:check_syntax:all --> Checking Syntax.... rake aborted! Undumpable Exception -- #<RuntimeError: jsl needs to be in your $PATH, download from: javascriptlint.com> /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:63:inwork' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:280:in block (4 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:447:inwith_instrumentation' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:279:in block (3 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:273:inloop' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:273:in block (2 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:138:inblock (2 levels) in in_threads' Tasks: TOP => canvas:compile_assets Task [0,0,0,1] ==>Concatenating JavaScript bundles with r.js eambcee@BceeCanvas:~/canvas$ $GEM_HOME/bin/bundle exec rake canvas:compile_assets[0,1,0,0] --trace * Invoke canvas:compile_assets (first_time) * Execute canvas:compile_assets --> Starting: 'Making sure node_modules are up to date' node is: /usr/bin/node v6.8.1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN i18nliner-handlebars@0.2.0 requires a peer of i18nliner@~0.1.5 but none was installed. npm WARN instructure-icons@0.0.8 requires a peer of react@^0.14.7 || ^15.0.0 but none was installed. npm WARN instructure-icons@0.0.8 requires a peer of react-dom@^0.14.7 || ^15.0.0 but none was installed. npm WARN instructure-ui@0.13.3 requires a peer of react@^0.14.7 || ~15.1.0 but none was installed. npm WARN instructure-ui@0.13.3 requires a peer of react-dom@^0.14.7 || ~15.1.0 but none was installed. npm WARN react-addons-css-transition-group@15.1.0 requires a peer of react@^15.1.0 but none was installed. npm WARN react-overlays@0.6.10 requires a peer of react@>=0.14.0 but none was installed. npm WARN react-overlays@0.6.10 requires a peer of react-dom@>=0.14.0 but none was installed. npm WARN react-prop-types@0.4.0 requires a peer of react@>=0.14.0 but none was installed. --> Finished: 'Making sure node_modules are up to date' in 25.706045726 * Invoke css:compile (first_time) * Execute css:compile --> Starting: 'compile css (including custom brands)' --> Finished: 'compile css (including custom brands)' in 3.902129003 working in 1 processes --> Starting: 'compile coffee' --> Starting: 'js:generate' * Invoke js:generate (first_time) * Execute js:generate * Invoke js:build_client_apps (first_time) * Execute js:build_client_apps Building client app 'canvas_quizzes' Running 'npm install'... npm WARN canvas_quizzes@1.0.0 No license field. Running 'npm run build'... Client app 'canvas_quizzes' was built successfully. --> Creating ember app bundles * Invoke js:bundle_ember_apps (first_time) * Execute js:bundle_ember_apps --> Pre-compiling ember handlebars templates * Invoke jst:ember (first_time) * Execute jst:ember --> Pre-compiling handlebars templates * Invoke jst:compile (first_time) * Execute jst:compile --> Compiling React JSX * Invoke js:jsx (first_time) * Execute js:jsx --> Generating plugin extensions * Invoke js:generate_extensions (first_time) * Execute js:generate_extensions --> Creating ember app bundles finished in 0.156784711 --> Generating plugin extensions finished in 0.175039477 --> Compiling CoffeeScript with 'coffee' binary --> Pre-compiling ember handlebars templates finished in 20.787816951 --> Pre-compiling handlebars templates finished in 32.413906216 --> Compiling React JSX finished in 171.572205257 --> Compiling CoffeeScript finished in 354.847754216 --> Finished: 'js:generate' in 374.11575316 --> Finished: 'compile coffee' in 374.11601106 --> Starting: 'check JavaScript syntax' * Invoke canvas:check_syntax (first_time) * Invoke canvas:check_syntax:all (first_time) \ Execute canvas:check_syntax:all --> Checking Syntax.... rake aborted! Undumpable Exception -- #<RuntimeError: jsl needs to be in your $PATH, download from: javascriptlint.com> /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:63:in work' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:280:inblock (4 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:447:in with_instrumentation' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:279:inblock (3 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:273:in loop' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:273:inblock (2 levels) in work_in_processes' /home/teambcee/.gems/gems/parallel-1.4.1/lib/parallel.rb:138:in block (2 levels) in in_threads' Tasks: TOP => canvas:compile_assets

tierra commented 8 years ago

Oh, so it's actually canvas:check_syntax task that's failing... nothing to do with compiling JS assets... that's good news. It means that really, you have everything in working order.

I think the relevant error here is this:

RuntimeError: jsl needs to be in your $PATH, download from: javascriptlint.com

It's kind of weird that running with [0,0,0,1] triggered a syntax check though, because it's supposed to be disabled in that config.

It's also weird that it's failing when you just run canvas:compile_assets because it's supposed to be disabled by default unless you specifically enable it.

claydiffrient commented 8 years ago

There is also a commit working its way through the internal process that removes the outdated JSL check stuff completely.

jakesorce commented 8 years ago

@claydiffrient @tierra: so what is the fix? I have class starting Monday and can't get canvas to compile my assets so the server is up and running but all the pages are failing to load because the assets aren't compiled?

tierra commented 8 years ago

Pages should be loading, because your CSS and JS assets did successfully compile, at least, according to your logs you posted.

jakesorce commented 8 years ago

@tierra are you mixing my logs and @senseiwebs up?

When I run bundle exec rake js:build I get this error:

Tracing dependencies for: compiled/tinymce Error: ENOENT: no such file or directory, open '/var/canvas/public/optimized/jst/MediaComments.js' In module tree: compiled/tinymce tinymce_plugins/instructure_record/plugin tinymce_plugins/instructure_record/mediaEditorLoader media_comments

Error: Error: ENOENT: no such file or directory, open '/var/canvas/public/optimized/jst/MediaComments.js' In module tree: compiled/tinymce tinymce_plugins/instructure_record/plugin tinymce_plugins/instructure_record/mediaEditorLoader media_comments

When I run bundle exec jst:compile I get this error: EOFError: end of file reached /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:in readline' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/template_precompiler.rb:31:inprecompile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:97:in compile_template' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:51:incompile_file' /var/canvas/gems/handlebars_tasks/lib/handlebars_tasks/handlebars.rb:34:in `block in compile'

tierra commented 8 years ago

Sorry, I was mixed up. Do you have any changes off of origin/stable applied on your branch @jakesorce ?

jakesorce commented 8 years ago

no @tierra

simonista commented 7 years ago

Hey @jakesorce 👋 Did you ever get this resolved?

jakesorce commented 7 years ago

@simonista: We have a self hosted version of canvas and I couldn't get passed that error so I just rolled back the pull of the latest changes. I haven't tried to pull master again since we are right in the middle of classes and I don't want our production server to go down.

simonista commented 7 years ago

Gotcha. Sorry we weren't more help, let us know if it's still a problem in the future (or maybe use groups.google.com/forum/#!forum/canvas-lms-users, it can be more helpful for stuff like this).