-
Notifications
You must be signed in to change notification settings - Fork 183
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
Bootsnap causes kamal setup to hang in Ruby 3.3.5 #495
Comments
I changed ruby version to 3.2.5. bootsnap precompile is ok! |
Same issue using Ruby 3.3.6 and Rails 8.0.1. I'm on an Intel mac and the build works if I leave the architecture as default. When targeting arm64 however, it hangs with no output from bootsnap. Steps to reproduce
Expected: If I use The problematic line in the dockerfile is:
Breaking it apart into this shows that it's bootsnap, but gives no ouput:
|
Switching to Ruby 3.2.6 fixes it for me too |
Also stuck on ruby 3.3.7. and latest bootsnap release. With the --verbose flag it shows paths being processed, then at some point it just stops outputting. The order of the file paths is not deterministic, so it is hard to pinpoint anything specific. While it says here rails/rails#54039, that the issue is with arm64, I am using amd64 and still getting stuck:
|
from and amd64 machine or from an ARM one? |
Am deploying to a dedicated server using kamal (docker). The machine is an AMD processor running: Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-41-generic x86_64) I have set kamal's instruction to use amd64: deploy.yml:
|
I'm asking about the machine on which you build the image (your dev machine most likely) |
Dev machine is arm64. I am fairly new to docker, are you saying the "docker image" build machine, the machine where the image gets built, is somehow the cause for the bootsnap to stall? |
Right, that's what I suspected.
Yes. From what was reported, my current suspicion is a problem with QEMU. The initial report was building an ARM64 image from an x86 machine, yours is the opposite. When you build an non-native image, docker uses QEMU, and I think that's what cause the hang. |
Yes, so it seems! |
This is Docker desktop? I'm not too sure how Apple Virtualization Framework works, but I think it's just a native (ARM64 in your case) Linux VM, and QEMU is used inside that VM. |
Yes |
I'll try to find some time to try to repro, but I use https://orbstack.dev/ which uses Rosetta under the hood, so I may not run into it. But I guess I can always install Docker Desktop. |
Thanks @byroot Let me know, if I can be of any help. |
Unfortunately, I was unable to repro using either Orbstack or official Docker Desktop. I followed the steps from #495 (comment), but on a M3 mac (so ARM) and using |
I've hit an example of this here in this build which is still hanging. The build usually takes ~1 hour but as of now it's up to 2 hours stuck on the line below. This is a Docker build for amd64 and via QEMU arm64 which is where it hangs on
This is the Dockerfile (ruby:3.4-alpine) and Github workflow file. Background: Builds have been stable for > 1 year but 2 days ago hit this binfmt bug causing random segfaults while compiling extensions. Once I added the work-around, segfaults are fixed but now bootsnap precompile is hanging. :-( I'm not saying this is bootsnap's fault but any input/advice/ideas would be appreciated. Update/FWIW*: I deleted all Github Action caches and kicked off new Docker builds but the problem remains. For the time being, I've disabled the use of QEMU and arm64 builds entirely. bootsnap on native amd64 works without issue. |
I just thought of something. For people who manage to make it hang in local, if you can try to enter the container from another shell, and kill the ruby process with That should hopefully cause Ruby to crash and print a crash report with a backtrace. Short of having a proper repro, that may give clues as to where it's stuck. |
sorry |
I have a new Rails app, There are some env
Dockerfile
When I run kamal setup
The text was updated successfully, but these errors were encountered: