- Newest
- Most votes
- Most comments
Hi there,
I had the exact same problem with version 4.2.0 and Ruby 3.2 . Everything works fine with the version 4.0.12 but when I upgrade to 4.2.0, the process get stuck at the assets compilation step. Logs show those two line and then nothing happens until deployment timeouts :
2024/12/11 22:28:52.065236 [INFO] Found assets:precompile task in Rakefile
2024/12/11 22:28:52.066338 [INFO] Running command: /bin/su webapp -c bundle exec rake assets:precompile
@AWS , Is there already a known issue about this ?
answered 2 years ago
I work with the guy who posted this. In case anyone is still stuck on the issue, in our case it proved to be https://github.com/amazonlinux/amazon-linux-2023/issues/840#issuecomment-2485615625 . (The people there are talking about pnpm, but all node processes were affected, including yarn install with all yarn versions.) Since the underlying kernel bug is fixed in the last Ruby platform version, we updated to that, and the issue is gone. If you need to be on Amazon Linux 4.2.0 for some reason, there's a workaround behind the link, which I'll repeat here to save you a click: set the environment variable UV_USE_IO_URING to the value 0 when running node, and if your problem is what our problem was, it should disappear.
answered 2 years ago
This issue you're experiencing with your Ruby on Rails application deployment on Elastic Beanstalk is concerning, especially since it's occurring after updating to a newer platform version. Here are some suggestions to help troubleshoot and potentially resolve the problem:
-
Check your application logs: While you mentioned that you don't see errors in /var/log/eb-engine.log, it's worth checking other log files such as /var/log/webapp/production.log or any custom log files your application might be generating. These logs might provide more insight into what's happening during the assets:precompile step.
-
Verify your Gemfile and Gemfile.lock: Ensure that all your gem dependencies are compatible with Ruby 3.2 and the new platform version. Sometimes, gem incompatibilities can cause silent failures during deployment.
-
Test assets:precompile locally: Try running the assets:precompile task on your local machine with the same Ruby version. This might help identify if the issue is specific to your application or the Elastic Beanstalk environment.
-
Increase instance size temporarily: If the asset compilation is resource-intensive, try deploying to a larger instance type temporarily to rule out resource constraints.
-
Check for timeouts: The Elastic Beanstalk deployment might be timing out. You can try increasing the deployment timeout in your configuration files.
-
Use a custom deploy hook: You can create a .ebextensions file with a custom deploy hook to run the assets:precompile task with more verbose output, which might reveal the issue.
-
Roll back to the previous platform version: If possible, try rolling back to the previous platform version (Ruby 3.2 running on 64bit Amazon Linux 2023/4.1.0) to confirm if the issue is indeed related to the platform update.
-
Check for platform-specific changes: Review the Elastic Beanstalk platform changelog to see if there are any significant changes in the new version that might affect your application's deployment process.
If none of these suggestions resolve the issue, you may need to contact AWS support for further assistance, as there could be an underlying problem with the new platform version or how it interacts with your specific application configuration.
Sources
Deploying a rails application to Elastic Beanstalk - AWS Elastic Beanstalk
Elastic Beanstalk supported platforms - AWS Elastic Beanstalk
Notifications and troubleshooting - AWS Elastic Beanstalk
Deploying Ruby applications with Elastic Beanstalk - AWS Elastic Beanstalk
answered 2 years ago
Relevant content
asked 4 years ago
asked 2 years ago

Hi there, here's what I found out so far: For debugging it is helpful to set RAILS_SKIP_ASSET_COMPILATION to true and trigger the asset compilation manually:
Doing this, I noticed:
yarn install, specifically during linking. I was using yarn 1, an upgrade to yarn 3 helped.So I couldn't solve my problem yet, but maybe this is helpful for you.
Glad to finally see some action on this post - I've been experiencing the same thing jumping from 4.0.12 to 4.2.0. I'll give RAILS_SKIP_ASSET_COMPILATION a try tonight and see if I can get through yarn install. @rePost-User-9095603 - which gem was causing your hang up?
in case you don't get notifications when someone posts an answer here (I'm not sure when rePost sends notifications): I posted our solution below.