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
Errno::ENOENT - No such file or directory - bs_fetch:atomic_write_cache_file:rename #177
Comments
(sorry for the extreme delay in response) I'm looking through the code and there are two reasons I can think of for this. Basically what's happening is:
The error ( This means one of two things:
The two reasons I can think of for this happening are:
Anyone who's experiencing this, issue, do you have extremely long paths? Or do you have some kind of frequently-running cruft-cleanup task? |
Thank you for looking into this! I looked through our logs and we're still seeing this issue sporadically (fortunately, still only in our staging environment!). Here are some data points from the most recent occurrences:
I hope this helps. Let me know if there's anything I can do to gather better information for you 👍 |
Another data point: some of the failures seem to happen when the |
I've been getting this error too. Using docker-compose.
|
@ethicalhack3r @Ferdy89 are either of you hitting this error when running in |
@adamdullenty I don't believe our configuration uses |
we do use |
I faced this issue as well. It happens on the blank |
Yea, so our issue was two machines that were trying to load the
|
I deploy the Rails app to docker and I don't mount tmp directory but the problem still occurs. |
I tried the above fix as well, and it doesn't work either for me. |
Not sure if this will help, but I found the same issue running a Rails app in Docker. The app has two containers ( So far, I've managed to get workaround it by removing bootsnap cache files and restarting the containers separately: $ docker-compose down
$ rm -rf tmp/cache/bootsnap-*
$ docker-compose up -d web # wait for app to boot
$ docker-compose up -d worker |
Have the same problem. Solutions higher do not help. |
@cblunt - I have a similar issue. Changed bootsnaps cache dir
I added virtual volumes
Then add the virtual volume to the services
For some reason now I am getting bootsnap cache files in both the project dir & in
|
I think there's possibly a race condition in https://github.com/Shopify/bootsnap/blob/master/ext/bootsnap/bootsnap.c#L546-L554 Our incident has been caused by these calls (and happens very rarely): time bundle exec rake webdrivers:chromedriver:update &
time bundle exec rake assets:precompile & Somehow the two calls are interfering with each other (very occasionally). We will test a workaround of adding a sleep of a few seconds in between (assuming it is indeed a race condition rather than something else). |
For the time being, a combination of:
and
worked for me. My gut is telling me that @lukaso is on to something with the race condition but this work around is ok for now. |
mkstemp(3) ensures that a unique file is created, but in the previous implementation, there's a possibility that a process uses the temporary file created by another process if mkstemp(3) fails to create a file due to EEXIST. That has the same risk as Shopify#174. This commit will also resolve Shopify#177 if the cause is that multiple processes try to create a file with the same name at the same time.
mkstemp(3) ensures that a unique file is created, but in the previous implementation, there's a possibility that a process uses the temporary file created by another process if mkstemp(3) fails to create a file due to EEXIST. That has the same risk as Shopify#174. This commit will also resolve Shopify#177 if the cause is that multiple processes try to create a file with the same name at the same time.
now this is closed, but no release has been made |
We were getting the following error when running tests An error occurred while loading ./spec/controllers/subnets_controller_spec.rb. Failure/Error: require File.expand_path("../config/environment", __dir__) Errno::ENOENT: No such file or directory - bs_fetch:atomic_write_cache_file:chmod See Shopify/bootsnap#177
We were getting the following error when running tests An error occurred while loading ./spec/controllers/subnets_controller_spec.rb. Failure/Error: require File.expand_path("../config/environment", __dir__) Errno::ENOENT: No such file or directory - bs_fetch:atomic_write_cache_file:chmod See Shopify/bootsnap#177
Just to add to this, we're seeing this when using Based on this, I would assume some kind of race condition is happening like @lukaso mentioned above. I have to disable this in our CI environment for now, which isn't great because we're seeing a 50% decrease in test times when using bootsnap, due to the large number of threads spinning up the Rails environment for testing. |
Ref: #353, more investigation happened there, and at this point we believe it is caused by a race conditions when multiple process use the same cache directory. That other issue also include an experimental fix, that I'd appreciate if people suffering from this problem could experiment with and report back. |
Juste restart Docker engine. |
Hi! We've recently started to use Bootsnap (1.3.0) and we just noticed this error pop up in our Sentry account for our staging server:
Both the caller and the required file are from gems. We run Rails on a single-threaded/single-process Linux environment inside Docker. So far it has only happened once.
I don't have enough knowledge about Bootsnap to dive deeper into the issue, but I'm happy to provide any other information I can. However, we haven't been able to reproduce it.
Thank you!
The text was updated successfully, but these errors were encountered: