Skip to content
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

Unable to load application: Bootsnap::CompileCache::PermissionError #254

Closed
afuno opened this issue Mar 27, 2019 · 9 comments
Closed

Unable to load application: Bootsnap::CompileCache::PermissionError #254

afuno opened this issue Mar 27, 2019 · 9 comments

Comments

@afuno
Copy link

afuno commented Mar 27, 2019

I have a new application on Rails (~> 5.2.2), which I am developing the second day. That is an elementary application.

Today I decided to deploy it on a server for testing. For this I use Dokku.

I have never had a similar problem with Dokku. At the very last deployment step, when the application starts up, I get a huge log with errors. Here is the part (beginning):

       CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
8b42e49d18cd9a956ea239c859a27c5906167b5a9842c0daf85817e4faed70ad
remote: App container failed to start!!
=====> st-qc web container output:
       Starting web...
       web| Puma starting in single mode...
       web| * Version 3.12.1 (ruby 2.6.2-p47), codename: Llamas in Pajamas
       web| * Min threads: 5, max threads: 5
       web| * Environment: production
       web| ! Unable to load application: Bootsnap::CompileCache::PermissionError: bootsnap doesn't have permission to write cache entries in '/app/tmp/cache/bootsnap-compile-cache' (or, less likely, doesn't have permisison to read '/app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache/yaml.rb')
       web| bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.6.0/bin/puma)
       Bootsnap::CompileCache::PermissionError: bootsnap doesn't have permission to write cache entries in '/app/tmp/cache/bootsnap-compile-cache' (or, less likely, doesn't have permisison to read '/app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache/yaml.rb')
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache.rb:28:in `permission_error'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache/iseq.rb:43:in `rescue in load_iseq'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache/iseq.rb:33:in `load_iseq'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
         /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
         /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
         /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache.rb:18:in `setup'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap.rb:30:in `setup'
         /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/setup.rb:27:in `<top (required)>'
         /app/config/boot.rb:4:in `require'
         /app/config/boot.rb:4:in `<top (required)>'
         /app/config/application.rb:1:in `require_relative'
         /app/config/application.rb:1:in `<top (required)>'
         /app/config/environment.rb:2:in `require_relative'
         /app/config/environment.rb:2:in `<top (required)>'
         config.ru:3:in `require_relative'
         config.ru:3:in `block in <main>'
         /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
         /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
         config.ru:in `new'
         config.ru:in `<main>'
         /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
         /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
         /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/configuration.rb:320:in `load_rackup'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/configuration.rb:245:in `app'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/runner.rb:147:in `load_and_bind'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/single.rb:98:in `run'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/launcher.rb:186:in `run'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/cli.rb:80:in `run'
         /app/vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/bin/puma:10:in `<top (required)>'
         /app/vendor/bundle/ruby/2.6.0/bin/puma:23:in `load'
         /app/vendor/bundle/ruby/2.6.0/bin/puma:23:in `<top (required)>'

Etc.

I have other Rails (~> 5.1.6, ~> 5.2.2) applications using Dokku on this server. They are deployed successfully.

Error in full: https://pastebin.com/raw/rw2vS2rk

What could be the problem?

@burke
Copy link
Member

burke commented Mar 27, 2019

The output explains the issue:

   Bootsnap::CompileCache::PermissionError: bootsnap doesn't have permission to write cache entries in '/app/tmp/cache/bootsnap-compile-cache' (or, less likely, doesn't have permisison to read '/app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.2/lib/bootsnap/compile_cache/yaml.rb')

You need to make this directory writable, or configure bootsnap to write its cache to somewhere that you do have write access to.

@burke burke closed this as completed Mar 27, 2019
@afuno
Copy link
Author

afuno commented Mar 27, 2019

@burke How can I make the /tmp directory in /app readable if Rails applications do not have this in the repository. This directory is hidden in .gitignore. Just like all other Rails applications.

But why exactly this application crashes at startup?

@afuno
Copy link
Author

afuno commented Mar 27, 2019

@burke I created a Rails (~> 5.2.2) application for the experiment. It is absolutely clean. There is nothing mine in it.
Next, I created Procfile and app.json for it.

During deployment I get the same error.

@afuno
Copy link
Author

afuno commented Mar 27, 2019

@burke
The problem is in version 1.4.2!
With version 1.4.1 deployment is successful!

Successful deployment with this:

gem 'bootsnap', '>= 1.1.0', '< 1.4.2', require: false

Falls with this:

gem 'bootsnap', '>= 1.1.0', require: false

By default Rails 5.2.2.1 has this line:

gem 'bootsnap', '>= 1.1.0', require: false

@afuno
Copy link
Author

afuno commented Mar 27, 2019

I solved this problem in the following way.
There is a tmp directory in the repository, within which there is only one file: .keep.
The first deployment will not work with version 1.4.2. Need to reset to version 1.4.1.
After the first successful deployment you can return the current version (now it is 1.4.2).
Now everything will be deployed successfully.

@afuno
Copy link
Author

afuno commented Mar 28, 2019

@burke
Yesterday everything was fine. I made several deployments.
Now I have this error again. I don't know and don't understand what else to do. I have a clean Rails (5.2.3) application. There is nothing difficult in terms of configuration.

I will use this:

gem 'bootsnap', '>= 1.1.0', '< 1.4.2', require: false

Version 1.4.2 obviously has some problems (conflicts).

@kpumuk
Copy link
Contributor

kpumuk commented Apr 3, 2019

@afuno Could you try the master version? I believe #255 should have resolved the issue

@mayordwells
Copy link

Trying out the master branch worked for me, thanks @kpumuk hope it will be released soon.

@burke
Copy link
Member

burke commented Apr 8, 2019

1.4.3 is now released with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants