'Can't see reason for Compiling… Compilation failed: (Executor::NonZeroExitStatus)
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.
Solution 1:[1]
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.
Solution 2:[2]
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
Solution 3:[3]
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".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | KenneyE |
Solution 2 | lucas |
Solution 3 | Berlin |