Precompile assets on v1.4.3 error

Hello,

On debian 8 without Docker. I guess I’ve done something wrong:

mastodon@myserver:~/live$ RAILS_ENV=production bundle exec rails assets:precompile
yarn install v0.24.5
[1/4] Resolving packages…
success Already up-to-date.
$ npm rebuild node-sass

node-sass@4.5.3 install /opt/mastodon/live/node_modules/node-sass
node scripts/install.js

node-sass build Binary found at /opt/mastodon/live/node_modules/node-sass/vendor/linux-x64-48/binding.node

node-sass@4.5.3 postinstall /opt/mastodon/live/node_modules/node-sass
node scripts/build.js

Binary found at /opt/mastodon/live/node_modules/node-sass/vendor/linux-x64-48/binding.node
Testing binary
Binary is fine
node-sass@4.5.3 /opt/mastodon/live/node_modules/node-sass
Done in 5.09s.
rails aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /opt/mastodon/live/public/assets/.sprockets-manifest-994ef8c9737eeef46cabf4f4dbc0f410.json.5771729506160.1688.942928
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:278:in initialize' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:278:inopen’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:278:in atomic_write' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:311:insave’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:231:in compile' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:inblock (3 levels) in define’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in with_logger' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:inblock (2 levels) in define’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/railties-5.1.1/lib/rails/commands/rake/rake_command.rb:21:in block in perform' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/railties-5.1.1/lib/rails/commands/rake/rake_command.rb:18:inperform’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/railties-5.1.1/lib/rails/command.rb:46:in invoke' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/railties-5.1.1/lib/rails/commands.rb:16:in<top (required)>’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in require' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:inrequire’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in block in require' /opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:inload_dependency’
/opt/mastodon/live/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in require' bin/rails:4:in'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

I’ve no clue what to do next :sweat:

You’re getting a permissions error. Have you tried running

sudo npm rebuild node-sass

? I feel like it shouldn’t be necessary but maybe it is!

I tried but it didn’t change a thing

You have a permission problem on this folder. I had to manually fix for my docker install to work.

Permissions seems consistent across the asset directory. Everything belongs to www-data.www-data
It’s more like a non existent file

root@server:/opt/mastodon/live# ls -l public/assets/.sprockets*
-rw-r–r-- 1 www-data www-data 27016 mai 29 20:27 public/assets/.sprockets-manifest-994ef8c9737eeef46cabf4f4dbc0f410.json