WARN [SKIPPING] No Matching Host for /usr/bin/env touch /srv/yenta/releases/20140411230746/tmp/restart.txt

StackOverflow https://stackoverflow.com//questions/23024065

Question

I am using capistrano 3. I don't have tmp/restart.txt file in my rails 4.0 app. When I deploy my app, I receive this error:

WARN [SKIPPING] No Matching Host for /usr/bin/env touch /srv/yenta/releases/20140411230746/tmp/restart.txt

In the deployed server, the app doesn't have tmp/restart.txt. I wonder whether I should create a task explicitly, or if I am missing any settings in capistrano. In capistrano 2, I'd create a task to explicitly touch tmp/restart.txt file instead.

Any help is appreciated!

Was it helpful?

Solution

This issue stems from not defining a particular role - the code is using the :app role without that role being defined, which led to a host not found problem.

deploy.rb

desc 'Restart application'
task :restart do
  on roles(:app), in: :sequence, wait: 5 do
    # Your restart mechanism here, for example:
    execute :touch, current_path.join('tmp/restart.txt')
  end
end

deploy/staging.rb

role  :web,       "qa4-yenta"
set   :deploy_to, "/srv/yenta"
set   :rails_env, "staging"
set   :user,      "yenta"
set   :use_sudo,  false
set   :branch,    "staging"
set   :deploy_via, :remote_cache

the :app role needs to be changed to :web, or the :app role needs to be defined.

OTHER TIPS

You're trying to touch in the releases folder - you need to do it in the current folder.

And yes, there's no tmp/restart.txt. I've been told you have to create it, but the version of Passenger we're using (4) seems to just restart the app anyways?

This error usually means that it couldn't find any matching hosts to perform this task.

What is your task like to restart passenger? What roles are you specifying for this task?

If you can provide your restart task code here that would help.

For reference, check out this blog on how to setup restart task that updates the current folder: http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano

Look at step 4.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top