0

Deploying on beanstalk. Using rails with webpacker.

Compiling…
  Compilation failed:

  (Executor::NonZeroExitStatus)

We can't seem to get anymore info as to what caused the compilation fail.

How can we get more info? Is there a debug mode for beanstalk?

These are the most descriptive errors we can see:

Webpacker is installed  
Using /var/app/ondeck/config/webpacker.yml file for setting up webpack paths
Compiling…
Compilation failed:. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed.
monty_lennie
  • 2,871
  • 2
  • 29
  • 49
  • What's [tag:devops] in here? – StephenKing Sep 19 '17 at 11:26
  • Were you ever able to figure this out? I'm running into the same issue. I'm trying to install yarn on a ruby environment and beanstalk isn't providing any reason for the non-zero exit status. – KenneyE Jul 05 '19 at 15:10
  • Same issue here. Can you post your script? Or @KenneyE? – ConfusedCopyPaster Jul 10 '19 at 16:13
  • I'm using `react-rails` (https://github.com/reactjs/react-rails) and everything is working locally. For deploying, I've tried the following solutions but all of them run into the same issue as above. https://github.com/rails/webpacker/issues/118#issuecomment-295594321 https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/elastic-beanstalk.md https://stackoverflow.com/a/42096244/3525808 – KenneyE Jul 10 '19 at 17:25

3 Answers3

0

My issue ended up being that the node_modules directory was being created with root as owner, which caused permissions problems.

To figure this out, I set webpack_compile_output to true in webpacker.yml and then re-deployed. Doing that increases the logging output by webpacker, which revealed the problem.

default: &default
  source_path: app/javascript
  source_entry_path: packs
  public_root_path: public
  public_output_path: packs
  cache_path: tmp/cache/webpacker
  check_yarn_integrity: false
  webpack_compile_output: true

Hope that helps.

KenneyE
  • 353
  • 1
  • 12
0

You can add webpack_compile_output: true to your webpacker.yml to see more details about a failure like this. By default this is turned off.

Source: https://github.com/rails/webpacker/issues/955#issuecomment-503830871

lucas
  • 1,050
  • 12
  • 21
-2

You can use eb logs for tail logs are the last 100 lines of the most commonly used log files.

You can read more about logs here:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html

Also ssh the machine and check/share this log - "/var/log/directory-hooks-executor.log".

Berlin
  • 1,456
  • 1
  • 21
  • 43