Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V 1.1.7 causes multiple errors when compiling webpacker assets during Centos 7 deploy #881

Closed
ccasabona opened this issue Aug 18, 2020 · 4 comments
Labels
bug A bug in the library or documentation.

Comments

@ccasabona
Copy link

Encountered two errors using webpacker and Rails 6 alpha when compiling assets onto a Centos 7 system after upgrading concurrent-ruby to v 1.1.7.

OS: Linux Centos 7
Ruby: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
Rails: 6-alpha
concurrent-ruby-ex and concurrent-ruby-edge not installed.

The first problem was NoMethodError: undefined method `+' for nil:NilClass. This error was solved (see below).

      01 yarn install v1.22.4
      01 [1/4] Resolving packages...
      01 [2/4] Fetching packages...
      01 info fsevents@2.1.3: The platform "linux" is incompatible with this module.
      01 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
      01 info fsevents@1.2.13: The platform "linux" is incompatible with this module.
      01 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
      01 [3/4] Linking dependencies...
      01 warning " > webpack-cli@3.3.12" has unmet peer dependency "webpack@4.x.x".
      01 warning " > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
      01 warning " > rails-erb-loader@5.5.2" has unmet peer dependency "webpack@^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0".
      01 warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
      01 warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
      01 [4/4] Building fresh packages...
      01 Done in 50.81s.
      01 I, [2020-08-18T09:06:37.202428 #14072]  INFO -- : Writing /var/www/html/rlewischocolatier.com/public/releases/20200818130454/public/assets/application-a1c5a38e3c43b236877b8caab0b8ca2ca0e8fdda967f897ec500635bcb2be21d.css
      01 I, [2020-08-18T09:06:37.203055 #14072]  INFO -- : Writing /var/www/html/rlewischocolatier.com/public/releases/20200818130454/public/assets/application-a1c5a38e3c43b236877b8caab0b8ca2ca0e8fdda967f897ec500635bcb2be21d.css.gz
      01 I, [2020-08-18T09:06:37.212814 #14072]  INFO -- : Writing /var/www/html/rlewischocolatier.com/public/releases/20200818130454/public/assets/trix/dist/trix-63c18701dc02a653082b8086a3b487ae2e56c3d28782826b10a2f7712ecb6c9a.js
      01 I, [2020-08-18T09:06:37.214384 #14072]  INFO -- : Writing /var/www/html/rlewischocolatier.com/public/releases/20200818130454/public/assets/trix/dist/trix-63c18701dc02a653082b8086a3b487ae2e56c3d28782826b10a2f7712ecb6c9a.js.gz
      01 rake aborted!
      01 NoMethodError: undefined method `+' for nil:NilClass
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/configuration.rb:31:in `additional_paths'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/configuration.rb:35:in `additional_paths_globbed'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/compiler.rb:93:in `default_watched_paths'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/compiler.rb:57:in `watched_files_digest'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/compiler.rb:38:in `fresh?'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/compiler.rb:43:in `stale?'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/compiler.rb:22:in `compile'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker/commands.rb:51:in `compile'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker.rb:35:in `compile'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/tasks/webpacker/compile.rake:23:in `block (4 levels) in <top (required)>'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker.rb:28:in `ensure_log_goes_to_stdout'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/tasks/webpacker/compile.rake:22:in `block (3 levels) in <top (required)>'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/webpacker.rb:20:in `with_node_env'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/tasks/webpacker/compile.rake:21:in `block (2 levels) in <top (required)>'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/webpacker-5.2.1/lib/tasks/webpacker/compile.rake:14:in `block in enhance_assets_precompile'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/bin/ruby_executable_hooks:24:in `eval'
      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/bin/ruby_executable_hooks:24:in `<main>'
      01 Tasks: TOP => webpacker:compile
      01 (See full trace by running task with --trace)

This was solved by adding an additional paths declaration to config/webpacker.yml

additional_paths: []

The next deploy, a segmentation fault error appeared:

      01 /var/www/html/rlewischocolatier.com/public/shared/bundle/ruby/2.7.0/bin/ruby_executable_hooks: [BUG] Segmentation fault at 0x0000000000000480
      01 ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
      01 
      01 -- Machine register context ------------------------------------------------
      01  RIP: 0x00007f2efe74798a
      01  RBP: 0x00007f2efe43c348 RSP: 0x00007f2eef278eb0
      01  RAX: 0x0000000000000000 RBX: 0x00007f2eef279a58 RCX: 0x00007f2edc2fbf00
      01  RDX: 0x00007f2eedb4b240 RDI: 0x00007f2edc2d54b0 RSI: 0x00007f2edc000028
      01 
      01   R8: 0x00007f2eddc82aa0  R9: 0x00007f2edc2fbfe0 R10: 0x00007f2eef278e70
      01  R11: 0x0000000000000206 R12: 0x00007f2edc2d54b0 R13: 0x00007f2efe43c308
      01  R14: 0x0000000000000004 R15: 0x000000000000001c EFL: 0x0000000000010202
      01 
      01 -- C level backtrace information -------------------------------------------
      01 SEGV received in SEGV handler
      01 bash: line 1: 17199 Aborted                 (core dumped) /var/www/html/rlewischocolatier.com/public/rvm1scripts/rvm-auto.sh . bundle exec rake assets:precompile
#<Thread:0x00007fbd252339f0 /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	13: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
	12: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `run'
	11: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
	10: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/capistrano-rails-1.6.1/lib/capistrano/tasks/assets.rake:67:in `block (4 levels) in <top (required)>'
	 9: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:92:in `within'
	 8: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/capistrano-rails-1.6.1/lib/capistrano/tasks/assets.rake:68:in `block (5 levels) in <top (required)>'
	 7: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:100:in `with'
	 6: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/capistrano-rails-1.6.1/lib/capistrano/tasks/assets.rake:69:in `block (6 levels) in <top (required)>'
	 5: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:80:in `execute'
	 4: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
	 3: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `tap'
	 2: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
	 1: from /Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/charlie/.rvm/gems/ruby-2.7.1@ruby27rails6/gems/sshkit-1.21.0/lib/sshkit/command.rb:97:in `exit_status=': rake exit status: 134 (SSHKit::Command::Failed)

The full backtrace is available if relevant. Reverting to 1.1.6 solved this issue.

We have other projects using Rails 6.0.3.2 and the asset pipeline that are not affected by upgrading to 1.1.7.

@pitr-ch pitr-ch added the bug A bug in the library or documentation. label Aug 18, 2020
@pitr-ch
Copy link
Member

pitr-ch commented Aug 18, 2020

Thanks for the report but unfortunately there is nothing to go on. concurrent-ruby is not even in the backtrace. Please keep digging what is wrong.

@ccasabona
Copy link
Author

Thank you for your answer. Before opening the issue, I had gone back and forth between concurrent-ruby 1.1.6 and 1.17 several times, and I was able to reproduce the error.

I took several steps to investigate: I used Rails 6.0.3.2 instead of 6 alpha; I forked concurrent-ruby and reverted #879; I changed several assets to force new compilation; and under all these circumstances I could not duplicate the problem. So it is difficult to say what the cause. So I shall have to apologize for the trouble.

@pitr-ch
Copy link
Member

pitr-ch commented Aug 19, 2020

Thanks. No problem at all. It's good that it was reported for others to find.
What did you do in the end, stayed on 1.1.6?

@ccasabona
Copy link
Author

ccasabona commented Aug 19, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the library or documentation.
Projects
None yet
Development

No branches or pull requests

2 participants