Solvedbootsnap Errno::ENOENT - No such file or directory - bs_fetch:atomic_write_cache_file:rename

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:

Errno::ENOENT
No such file or directory - bs_fetch:atomic_write_cache_file:rename

bootsnap/compile_cache/iseq.rb in fetch at line 37
bootsnap/compile_cache/iseq.rb in load_iseq at line 37
bootsnap/load_path_cache/core_ext/kernel_require.rb in require at line 21
bootsnap/load_path_cache/core_ext/kernel_require.rb in block in require_with_bootsnap_lfi at line 21
bootsnap/load_path_cache/loaded_features_index.rb in register at line 65
bootsnap/load_path_cache/core_ext/kernel_require.rb in require_with_bootsnap_lfi at line 20
bootsnap/load_path_cache/core_ext/kernel_require.rb in require at line 29

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!

21 Answers

✔️Accepted Answer

Yea, so our issue was two machines that were trying to load the /app/tmp directory at the same time, we solved it with the following docker-compose config:

volumes:
      - .:/app
      # don't mount tmp directory
      - /app/tmp

Other Answers:

I've been getting this error too. Using docker-compose.

/usr/local/bundle/gems/bootsnap-1.4.3/lib/bootsnap/compile_cache/iseq.rb:37:in `fetch': No such file or directory - bs_fetch:atomic_write_cache_file:chmod (Errno::ENOENT)

Not sure if this will help, but I found the same issue running a Rails app in Docker. The app has two containers (web and worker), and I think trying to run them at the same time was causing issues.

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

I faced this issue as well. It happens on the blank tmp directory, where both the app and sidekiq are loading at the same time on my docker container. Once there's a cache from bootsnap, the issue seems to be gone.

Yea, so our issue was two machines that were trying to load the /app/tmp directory at the same time, we solved it with the following docker-compose config:

volumes:
      - .:/app
      # don't mount tmp directory
      - /app/tmp

I deploy the Rails app to docker and I don't mount tmp directory but the problem still occurs.

More Issues: