9z0b3t1c / capistrano-resque Goto Github PK
View Code? Open in Web Editor NEWCapistrano integration for Resque
License: MIT License
Capistrano integration for Resque
License: MIT License
Hello!
On Mac osx, rvm. Rails 3.2.12, ruby 1.9.3, i've always this error when i try to use cap task :
/Users/xxx/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/variables.rb:122:in `method_missing_with_variables': undefined method `_cset' for #<Capistrano::Configuration:0x007f995390ef40> (NoMethodError)
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-resque-0.1.0/lib/capistrano-resque/capistrano_integration.rb:9:in `block in load_into'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:97:in `instance_eval'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:97:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:83:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-resque-0.1.0/lib/capistrano-resque/capistrano_integration.rb:7:in `load_into'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-resque-0.1.0/lib/capistrano-resque/capistrano_integration.rb:126:in `<top (required)>'
from /Users/yzack/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/yzack/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-resque-0.1.0/lib/capistrano-resque.rb:2:in `<top (required)>'
from /Users/yzack/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/yzack/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/yzack/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:152:in `require'
from Capfile:4:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/gems/capistrano-2.14.2/bin/cap:4:in `<top (required)>'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/bin/cap:19:in `load'
from /Users/yzack/.rvm/gems/ruby-1.9.3-p194@fnordmetric/bin/cap:19:in `<main>'
Everything working well without capistrano-resque gem
See it ?
environment in: bundle exec rake environment resque:work was not redundant
I tried out this gem with Capistrano 3 and ran into the problem where it was requiring sudo in the resque:stop command. I do not want or need to use sudo to restart the resque processes.
lib/capistrano-resque/tasks/capistrano-resque.rake line 72 calls sudo and I didn't see a way to override it in Cap 3 without monkey-patching (which I ended up doing).
Question: If the resque process is started without sudo (using normal user permissions) why should it need sudo to stop it?! Can't we just remove that four letter word?
See #73, a user was having a problem starting his workers because ./tmp/pids
didn't exist.
Hello
I'm using your gem, last version
I have following strings in deploy.rb:
...
set :workers, { "account_logs_queue" => 1, 'xmpp_worker' => 8, 'mails_queue' => 1, 'operator_logs_queue' => 1, 'send_reports_queue' => 10, "update_dictionaries_queue" => 1, 'closing_tickets_queue' => 1 }
...
Resque workers start normally and as I need, but after I run cap resque:stop processes are still alive. Workers are not shown in resque-web.
On next cap resque:start new processes created.
What can be the problem?
I've got a project which is using Rails 3.0.11 and I've added capistrano-resque to it. When I try and start it using 'cap resque:start' it says it's executing the following line:
cd /home/vps/aad/current && RAILS_ENV=production QUEUE=\"email_queue\" PIDFILE=./tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 bundle exec rake environment resque:work
After it finishes this command I check the resque-web and processes on the server and there are no resque jobs running. However if I ssh into my server and copy that command above I can start a resque process fine.
I can also stop the process I started manually using the 'cap resque:stop' command. So it's half working.
Here are some of the versions of Gems I'm using:
resque (1.23.0)
capistrano (2.13.5)
capistrano-resque (0.0.9)
Here is the setup I have in my deploy.rb
# Resque
role :resque_worker, "<project url>"
role :resque_scheduler, "<project url>"
set :workers, { "email_queue" => 2 }
I have added the following to my Capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
require "capistrano-resque"
load 'config/deploy' # remove this line to skip loading any of the default tasks
I'm using capistrano 3.2.1 with capistrano-resque gem to restart rasque workers on deployment. Always getting this error.
cd /home/azureuser/apps/app_production/current && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env nohup RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 ~/.rbenv/bin/rbenv exec bundle exec rake RACK_ENV=production RAILS_ENV=production QUEUE="mailer" PIDFILE=/home/azureuser/apps/app_production/shared/tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 INTERVAL=5 environment resque:work >> log/resque.log 2>> log/resque.log )
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: nohup exit status: 127
nohup stdout: Nothing written
nohup stderr: Nothing written
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: nohup exit status: 127
If I check my error log at apps/app_production/current/log/resque.log
it shows.
ohup: failed to run command `RBENV_ROOT=/home/azureuser/.rbenv': No such file or directory
I brought the issue to stackoverflow and here is the thread.
[e6956e94] Command: cd /var/www/html/server/current && bundle exec rake RAILS_ENV=production QUEUE="credential" PIDFILE=/var/www/html/server/shared/tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 INTERVAL=5 resque:work >> /dev/null 2>> /dev/null
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user@server: rake exit status: 1
rake stdout: Nothing written
rake stderr: Nothing written
SSHKit::Command::Failed: rake exit status: 1
rake stdout: Nothing written
rake stderr: Nothing written
Tasks: TOP => resque:start
(See full trace by running task with --trace)
In deploy/production.rb:
role :resque_worker, 'server'
role :resque_scheduler, 'server'
set :workers, {:queue => 2}
just saying:
http://stackoverflow.com/questions/10978044/resque-workers-do-not-start-properly
I'm having the already talked about devise/confirmations_controller issue... still.
Hello,
It would be helpful to be able to configure specific sets of workers for specific servers. For example:
role :slow_worker, 'A'
role :fast_worker, 'X'
set :workers, { :slow_worker => { 'easy_task' => 1, 'other_easy_task' => 2 }, :fast_worker => { 'heavy_lifting' => 1, ... } }
For example, in our setup, we have some large servers on which we would like to run resource intensive image processing tasks, and some lighter servers on which we would run easier tasks.
I believe the helper methods (remote_file_exists?, remote_process_exists? and current_pids) should expect a new, optional parameter 'role' and only the start task must be changed to send the role parameter.
Do you believe this would be a useful addition to capistrano-resque ?
Hello,
There is an issue with the capistrano
dependency in the gemspec.
I get this error with capistrano
version 3.0.0
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@ombu/bundler/gems/capistrano-resque-0ec1d45e72c5/lib/capistrano-resque/capistrano_integration.rb:124:in `<top (required)>': uninitialized constant Capistrano::Configuration (NameError)
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@ombu/gems/backports-3.3.5/lib/backports/tools.rb:328:in `require'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@ombu/gems/backports-3.3.5/lib/backports/tools.rb:328:in `require_with_backports'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@ombu/bundler/gems/capistrano-resque-0ec1d45e72c5/lib/capistrano-resque.rb:2:in `<top (required)>'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
from /Users/etagwerker/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
from /Users/etagwerker/Projects/ombu_store/config/application.rb:9:in `<top (required)>'
I suggest a tweak to the project's gemspec and a new release (maybe 0.2.0
?)
I'll send a pull request which should avoid this issue.
Let me know what you think.
Thanks
I don't see any rake tasks provided by resque gem. So cap resque doesn't work at all.
This is the failure I get when I have this hook:
after "deploy:restart", "resque:restart"
and I run deploy:restart for the first time:
* 20:41:34 == Currently executing `resque:stop'
* executing "ls /app/current/tmp/pids/resque_work*.pid"
[hostname] executing command
command finished in 969ms
ls: cannot access /app/current/tmp/pids/resque_work*.pid: No such file or directory
failed: ... -c 'ls /app/current/tmp/pids/resque_work*.pid'
Changing current_pids to this appears to fix the problem:
def current_pids
capture("ls #{current_path}/tmp/pids/resque_work*.pid 2>/dev/null || true").strip.split(/\r{0,1}\n/)
end
Hello!
I found this issue while using capistrano 3.1. After running the command cap staging resque:start
, I got this log: http://pastebin.com/xDVgqrsL (server ip removed). As you can see from the link, the cap task never ends while printing out the logs from the workers.
Is there a setting that I missed to end cap's ssh to the server once resque has confirmed that it has started?
Thanks!
When running cap develop resque:scheduler:restart
, sometimes it doesnt kill active process from pid, instead it spawns new one. Server is running on ubuntu 14
capistrano - 3.4.0
capistrano-resque - 0.2.2
resque - 1.25.2
ps aux | grep resque-scheduler-4.0.0
root 6137 0.0 0.3 1063524 119632 ? Sl Dec16 0:10 resque-scheduler-4.0.0[server_production]: Processing Delayed Items
root 9200 0.0 0.3 1055524 111196 ? Sl 02:34 0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root 13567 0.0 0.3 1055560 111424 ? Sl 02:35 0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root 18716 0.0 0.3 1054792 112568 ? Sl 02:36 0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root 24277 0.0 0.3 1055884 111696 ? Sl 02:31 0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root 24977 0.0 0.3 1055080 110952 ? Sl 02:37 0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root 25345 0.0 0.0 11848 932 pts/4 S+ 02:37 0:00 grep --color=auto resque-scheduler-4.0.0
I am using capistrano (2.15.5), resque (1.24.1) and this gem is not working, started without any error messages but workers are not working
So when I deploy, the resque workers code base are not being updated correctly.
I have a worker that I deployed up and running on Nov 13th. Then I created a new one 5 days ago. Both are registered in my /resque
page.
I also updated worker_1 and redeployed it.
Now. here are the workers that are listed.
host_worker.rb : version Nov 13th (even though I edited and redeployed Nov 27th)
service_worker.rb version Nov 27th
Im using Cap3 and ca-resq. and various other things.
I have recently updated from resque 1.25 to 1.26 and things start to get wired, the workers would appear to be forked but not registered with the Resque.workers
In my case I was supposed to have 10 workers, after running resque:start I only got 5 workers
when entering ps aux | grep resque
the 10 workers appear
but in the terminal using Resque.workers
or resque-web only 5 appears that are accepting jobs
I'm deploying with one user, but would like to run resque as the user the app runs with. It'd be great of capistrano-resque would allow to specify a user to run as. This could be either by setting the ssh user option, or using sudo with a specific user.
A simple solution would be to give the option of prepending the command - a capistrano-resque user could add a sudo :as =>
there.
Would this be a useful feature?
Just added capistrano-resque
from master (2c73a2a)
Gemfile:
gem 'capistrano', '~> 3.0.1'
gem 'capistrano-rails', '~> 1.1.0'
gem 'capistrano-bundler', '~> 1.1.1'
gem 'capistrano-rvm', '~> 0.1.0'
gem "capistrano-resque", github: 'sshingler/capistrano-resque', require: false
Capfile:
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano-resque'
And now I get an error:
cap -vT
cap aborted!
cannot load such file -- capistrano-resque
Hi,
I try to use "resque:scheduler:start" task but I found out that resque scheduler wont run in background:
*** [Resque Scheduler] Resque scheduler not running
* executing `resque:scheduler:start'
* executing "cd /home/homecard/app/production/current && RAILS_ENV=production PIDFILE=./tmp/pids/scheduler.pid BACKGROUND=yes bundle exec rake resque:scheduler"
servers: ["homecard.com.pl"]
[homecard.com.pl] executing command
** [out :: homecard.com.pl] 2012-09-03 00:45:07 Scheduling generate_invoices
... keps hanging
The version of the gem installed from rubygems still provides the following tasks:
resque:start_workers
resque:stop_workers
It looks like a version bump and a rake release
will do the trick.
I didn't see a log/resque-worker0.log file get created after starting my worker.
I also grep'd for LOGFILE in git://github.com/defunkt/resque.git and didn't see any references to it, so I don't think this option has any effect, and should be removed from the capistrano tasks...
I would really like to see the output from resque though. Is there any way to enable logging??
(Maybe if we don't use BACKGROUND=yes it would output to stdout?)
Hi!
In lib/capistrano-resque/capistrano_integration.rb you sometimes use :rails_env and sometimes :app_env. What is the difference? And why not always just :rails_env? My Capistrano didn't have :app_env and i had to create it so i was wondering.
Thank You!
Kai
Rails 3.2, Ruby 1.9.3p392
Gemfile:
group :capistrano do
gem 'capistrano'
gem 'capistrano-resque', '~> 0.1.0'
...
end
Capfile: require 'capistrano-resque'
config/deploy.rb:
set :workers, { "*" => 5 }
role :resque_worker, "box.address"
role :resque_scheduler, "box.address"
I can provide more detail if needed
Default polling interval for Resque is 5 seconds. This should be configurable.
I use this gem to deploy workers.
But I start 10 workers, only 9, 8 is started.
Please help me!
There's no way right now to turn OFF verbose logging!
I don't want to duplicate an issue across repos, but I'm beginning to wonder if an issue I'm seeing with resque log files isn't related to this gem... Thoughts?
Thanks!
The README doesn't make it clear that you can assign specific servers (via roles) to work on completely separate resque queues. For example
role :worker_server_A, <server-ip-A>
role :worker_servers_B_and_C, [<server-ip-B>, <server-ip-C>]
set :workers, {
worker_server_A: {
"queue-1" => 1,
"queue-2" => 5
},
worker_servers_B_and_C: {
"queue-3" => 1,
"queue-4" => 9
}
}
This is a great feature that I'm glad I found by looking through the source. Thanks!
Hey there!
I'm gearing up to work on Resque 2.0, and I'd like to coordinate better with plugin authors to make sure stuff doesn't break.
I'd like to know a few things:
Thanks!
I am also unable to start resque workers in my code. I do not get any error messages but there is no resque worker running in background. I have also posted this question on stack overflow.
capistrano-resque => 0.2.2
resque => 1.25.2
ruby=> 2.1.0
There is no log file created for resque. I even tried creating a log file and then trying to start resque but it didn't work.
set :use_sudo, true
server 'ruby2', user: 'ubuntu', roles: %w{web app db}
set :ssh_options, { forward_agent: true }
set :branch, 'capistrano_test'
set :deploy_to, '/var/www/test_cap'
role :resque_worker, 'ruby2'
set :workers, {
ruby2: {"file_serve"=>1,"*" => 1,"tasks_queue"=>1,"sunspot"=>1}
}
after "deploy:restart", "resque:restart"
lock '3.6.1'
set :application, 'test_app'
set :repo_url, 'sample.git'
set :resque_log_file, "log/resque.log"
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
In logs its clear that resque:restart is called but it does not start a worker.
** Invoke deploy:published (first_time)
** Execute deploy:published
** Invoke resque:restart (first_time)
** Execute resque:restart
** Invoke resque:stop (first_time)
** Execute resque:stop
** Invoke resque:start (first_time)
** Execute resque:start
** Invoke deploy:finishing (first_time)
** Execute deploy:finishing
** Invoke deploy:cleanup (first_time)
** Execute deploy:cleanup
01:23 deploy:cleanup
Keeping 5 of 6 deployed releases on ruby2
01 rm -rf /var/www/test_cap/releases/20161111045128
✔ 01 ubuntu@ruby2 3.018s
** Invoke deploy:finished (first_time)
** Execute deploy:finished
** Invoke deploy:log_revision (first_time)
** Execute deploy:log_revision
01:28 deploy:log_revision
01 echo "Branch capistrano_test (at af938c9c04998d97176886462eac94701292bcfd) deployed as release 20161114030844 by venkat" >> /var/www/test_ca…
✔ 01 ubuntu@ruby2 1.909s
In my deploy.rb I've got:
role :resque_worker, fetch(:stage_url)
set :workers, { 'interaction_scheduler' => 1, 'alarm_raiser' => 1 }
set :resque_environment_task, true
but cap stage resque:stop for instace produces no output when I was expecting it to produce:
No pid files found
No workers are started on resque:start either.
I'm using capistrano 3.2.1.
I have 2 servers and each has 2 workers.
cap production resque:start
It starts 1 worker for each server sometimes, and sometimes 1 worker missing for one server. PID files exist but processes go away. It can be normal after trying a few times.
capistrano (2.14.2)
capistrano-resque (0.1.0)
resque (1.23.0)
rails (3.2.8)
rake (10.0.3)
Anyone have a gist or something showing examples of usage with capistrano 3? '
Here is my snippet from deploy.rb
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join("tmp/restart.txt")
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
within release_path do
end
end
end
after :finishing, 'deploy:cleanup'
after :restart, 'resque:restart'
end
But I don't see any output saying it's executing the workers.
Hey,
The README is not clear about this. What should one do to run a worker who process tasks from all queues (i.e. QUEUE=* rake environment resque:work > /dev/null 2>&1 &
)? It seems to be set :workers, { "*" => 1 }
.
I also have a problem deploying with Rails not in the root the repository. start_command
assumes rails is in the root directory. I hack fix is to change set :current_path, '/subdirectory/rails/path'
I also had to make sure the pids
folder is there: mkdir -p tmp/pids
I'm using https://github.com/kalys/capistrano-nginx-unicorn to setup and deploy nginx & unicorn, would that create a problem?
Because I don't have any problems when using cap resque:restart
, but when doing a full deploy the CPU usage on my server become 100% from Ruby and sometimes Rake under the user deploy
which is the one i'm using to deploy.
Hi,
I'm currently using capistrano 2.12.0, and added require 'capistrano-resque' to my deploy file. Even so, the tasks of this gem don't get loaded. When I type capistrano -vT, I don't see the tasks of this gem.
I see resque:start_workers and resque:stop_workers listed by cap, but I think they're defined elsewhere (prob by cap itself?).
Thanks,
Tiago Franco
How does one prevent resque:stop and and resque:restart from failing a deployment with stale PIDs? It seems that a rm -f resque_work*.pid
or similar would easily remedy this.
ls /var/www/app/current/tmp/pids/resque_work*.pid
; do sudo -p 'sudo password: ' kill -s QUIT cat $f
&& rm $f ;done ;fi"ls /var/www/app/current/tmp/pids/resque_work*.pid
; do sudo -p '''sudo password: ''' kill -s QUIT cat $f
&& rm $f ;done ;fi'" on worker1.server.comHi,
For the moment, adding gem 'capistrano-resque', '~> 0.2.2', require: false
to the Gemfile downloads a version without the resque_extra_env parameter.
Could you bump the gem version so we can have it?
Thanks :)
Has anyone seen the issue...
At startup all my workings are immediately exiting.
In the log file I am getting the following output:
INFO -- : Failed to start worker : #<Errno::EIO: Input/output error - >
Hello, I have a Capistrano set up with the below configuration in my Capfile. When doing a cap staging deploy
things normally work fine. However, upon implementing Capistrano-Resque, I receive an error: "failed to create symbolic link".
Here is my Capfile:
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/rails/console'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/unicorn_nginx'
require 'capistrano/postgresql'
require 'capistrano-db-tasks'
require 'capistrano-resque'
require 'capistrano/clockwork'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
(I'm using Capistrano 3.6.1, and Capistrano-Resque 0.2.2 with require: false, as prescribed)
The backtrace of the error is as follows. Does anyone know what's going on here?
00:11 deploy:symlink:linked_files
01 mkdir -p /home/deploy/apps/myapp_staging/releases/20160909140832/config
✔ 01 [email protected] 0.237s
✔ 01 [email protected] 0.238s
02 ln -s /home/deploy/apps/myapp_staging/shared/config/secrets.yml /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml
✔ 02 [email protected] 0.296s
02 ln: failed to create symbolic link ‘/home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml’
02 : File exists
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: ln exit status: 1
ln stdout: Nothing written
ln stderr: ln: failed to create symbolic link ‘/home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml’: File exists
SSHKit::Command::Failed: ln exit status: 1
ln stdout: Nothing written
ln stderr: ln: failed to create symbolic link ‘/home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml’: File exists
Tasks: TOP => deploy:symlink:linked_files
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: ln exit status: 1
ln stdout: Nothing written
ln stderr: ln: failed to create symbolic link ‘/home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml’: File exists
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
INFO [b89a83c7] Finished in 0.238 seconds with exit status 0 (successful).
DEBUG [ab33b1bd] Running [ -L /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ] as [email protected]
DEBUG [ab33b1bd] Command: [ -L /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ]
DEBUG [7d27abbf] Finished in 0.267 seconds with exit status 1 (failed).
DEBUG [8da38f89] Running [ -f /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ] as [email protected]
DEBUG [8da38f89] Command: [ -f /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ]
DEBUG [ab33b1bd] Finished in 0.267 seconds with exit status 1 (failed).
DEBUG [2a2c0ce7] Running [ -f /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ] as [email protected]
DEBUG [2a2c0ce7] Command: [ -f /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml ]
DEBUG [8da38f89] Finished in 0.245 seconds with exit status 1 (failed).
INFO [7a175e21] Running /usr/bin/env ln -s /home/deploy/apps/myapp_staging/shared/config/secrets.yml /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml as deploy…
DEBUG [7a175e21] Command: ( export RBENV_ROOT="/home/deploy/.rbenv" RBENV_VERSION="2.2.4" ; /usr/bin/env ln -s /home/deploy/apps/myapp_staging/shared/config/secrets.yml /home/deploy/apps/…
DEBUG [2a2c0ce7] Finished in 0.245 seconds with exit status 1 (failed).
INFO [00c3b638] Running /usr/bin/env ln -s /home/deploy/apps/myapp_staging/shared/config/secrets.yml /home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml as deploy…
DEBUG [00c3b638] Command: ( export RBENV_ROOT="/home/deploy/.rbenv" RBENV_VERSION="2.2.4" ; /usr/bin/env ln -s /home/deploy/apps/myapp_staging/shared/config/secrets.yml /home/deploy/apps/…
INFO [00c3b638] Finished in 0.296 seconds with exit status 0 (successful).
DEBUG [3410bee8] Running [ -L /home/deploy/apps/myapp_staging/releases/20160909140832/config/sunspot.yml ] as [email protected]
DEBUG [3410bee8] Command: [ -L /home/deploy/apps/myapp_staging/releases/20160909140832/config/sunspot.yml ]
DEBUG [7a175e21] ln: failed to create symbolic link ‘/home/deploy/apps/myapp_staging/releases/20160909140832/config/secrets.yml’
DEBUG [7a175e21] : File exists
I'm having to pull from github in my gemfile in order to get e0f99f6. If it's not too much trouble, I'd feel a lot better about pulling from the office Rubygems source. Thanks for putting this gem together. It is great.
Getting undefined method
instance' for Capistrano::Configuration:Classwhen I run
cap production deploy` with capistrano v3.
I've put require 'capistrano-resque'
in my Capfile.
I have this in my deploy rb:
role :resque_worker, "10.97.106.134"
role :resque_scheduler, "10.97.106.134"
set :workers, { "attendee_importer" => 2 }
any tips?
capistrano-resque
is hanging every time I issue a resque:start
or resque:restart
.
INFO [f0004d2a] Running ~/.rvm/bin/rvm 2.1.0@content do bundle exec rake RAILS_ENV=staging QUEUE="*" PIDFILE=./tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 INTERVAL=5 environment resque:work on cgapp02
DEBUG [f0004d2a] Command: cd /var/www/vhosts/staging.contentapp.com/current && ~/.rvm/bin/rvm 2.1.0@content do bundle exec rake RAILS_ENV=staging QUEUE="*" PIDFILE=./tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 INTERVAL=5 environment resque:work
DEBUG [5c66b7aa] rspec rake task not loaded
DEBUG [f0004d2a] rspec rake task not loaded
INFO [5c66b7aa] Finished in 6.517 seconds with exit status 0 (successful).
INFO [f0004d2a] Finished in 6.387 seconds with exit status 0 (successful).
# Hangs here until I Ctrl-C
I thought it might be related to the SSHKit problem referenced in #74, but I upgraded SshKit to use gem "sshkit", github: capistrano/sshkit
which didn't help. Also tried added the SSHKit::Backend::Netssh.pool.idle_timeout = 0
statement, which was also unsuccessful.
Any suggestions on where I can start looking?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.