rails
rails copied to clipboard
Restore manifest is failing on rollback on multiple hosts
I have an issue during rollback on multiple host setup with restoring assets manifest. Currently restoring manifest works like this. It checks manifest name in assets_manifest_backup
dir on one host and then uses this name to check again (assets.rake#L93) on each host if this manifest exists before copying archived manifest to public/assets
dir.
This strategy fails when each host have different manifest (I know it's very unusual) and throws Capistrano::FileNotFound
error (assets.rake#L98).
I propose we should detect manifest name per host.
System configuration
Ruby 2.4.1 capistrano (3.8.2) capistrano-bundler (1.2.0) capistrano-passenger (0.2.0) capistrano-rails (1.2.3) rails (4.2.9) rails-deprecated_sanitizer (1.0.3) rails-dom-testing (1.0.8) rails-html-sanitizer (1.0.3) rake (12.0.0) rspec-rails (3.6.0) rvm1-capistrano3 (1.4.0) sass-rails (5.0.6) sequel-rails (0.9.17) sprockets-rails (3.2.0)
Hi! Thanks for the bug report. Is this still a problem for you?
I am looking at the source code you referenced (see below), and it seems to me that manifest detection happens inside the on
block, and therefore it is executed per host. I am not seeing the place in the code where the name detected on one host is applied to other hosts. Can you clarify?
https://github.com/capistrano/rails/blob/0a655844582517660f46832fc9695524c4abaf41/lib/capistrano/tasks/assets.rake#L88-L102
Probably this problem is similar to the one I just had, due to detect_manifest_path
listing all manifests separated by space, if you have more than one (like we did here by mistake) the target
variable becomes something like: path1 path2
and it breaks the test function (because it becomes [[ -f path1 && -f path2 path3]]
, imo the return from detect_manifest_path
should be different in case there is more than one.