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

Capistrano::FileNotFound: Rails assets manifest file (or backup file) not found : deploy:rollback #224

Open
snkshukla opened this issue Aug 8, 2018 · 4 comments

Comments

@snkshukla
Copy link

I'm trying deploy:rollback to staging from my local machine, everything else is successful, but when it tries to do deploy:assets:restore_manifest it fails saying it cannot find the manifest file.

On further debugging, I found that it uses the ruby kernel's test method to check if the source and destination are present, as in this line here

But the problem is that the file is present in the remote. Then I debugged more by changing the source and target to my local system's file paths, and it seems that the test method to check the file name runs on the local system and not on the remote, only the execute commands are running on the remote, so it fails to find the asset manifest file on my local and fails.

Is there anything I might be missing, What should I do to fix this issue?

Steps to reproduce

Running cap staging deploy:rollback from local machine to a remote server.

Expected behavior

The test method should have run on the remote and should have not returned false, the files are present on the remote server.

Actual behavior

The test method in assets:restore_manifest runs on local and checks the presence of the source and target(the manifest files) on the local and returns false and thus deployment fails.

System configuration

https://gist.github.com/snkshukla/2a3bbb9cbfe8f6e957c5add25c2a055f

@MatteoMat27
Copy link

+1 not working for me neither

@cedricdeschenes
Copy link

If you replace this line (source here)

if test "[[ -f #{source} && -f #{target} ]]"

with the following code

if test(:ls, source) && test(:ls, target)

everything seems to be working, I don't know if this is PR worthy or just an hacky way to fix it.

@raypereda
Copy link

deploy:rollback is broken. We found that the new test "[[" only works on bash, korn, and zsh. See http://mywiki.wooledge.org/BashFAQ/031 Unfortunately, our production servers were using bourne shell. We changed the shell of the user that capistrano used to ssh'ed into the production server. In our case,

chsh -s /bin/bash SSH-USERNAME

That fixed the problem.

@hopewise
Copy link

I have the same issue, and I have bash shell at production server.

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

5 participants