My Capfile:
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails/tree/master/assets
# https://github.com/capistrano/rails/tree/master/migrations
#
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'sidekiq/capistrano'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
deploy.rb:
set :application, 'myapp'
set :user, 'deployer'
set :repo_url, "git#bitbucket.org:citicom/#{fetch :application}.git"
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, "/home/#{fetch :user}/apps/#{fetch :application}"
# set :scm, :git
set :format, :pretty
# set :log_level, :debug
set :pty, true
set :linked_files, %w{config/database.yml config/application.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets tmp/sock vendor/bundle public/system}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :keep_releases, 3
# for RoR 4
set :default_env, { rvm_bin_path: '~/.rvm/bin' }
set :bundle_gemfile, -> { release_path.join('Gemfile') }
set :bundle_dir, -> { shared_path.join('bundle') }
set :bundle_flags, ''
set :bundle_without, %w{test development}.join(' ')
set :bundle_binstubs, -> { shared_path.join('bin') }
set :bundle_roles, :all
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
run "cd #{current_path} && /etc/init.d/unicorn_#{fetch :application} restart"
# 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
# execute :rake, 'cache:clear'
# end
end
end
after :finishing, 'deploy:cleanup'
end
Error:
git:(master) ✗ cap production bundler:install
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777
DEBUG [55d61c51] Running if test ! -d /home/deployer/apps/myapp/current; then echo "Directory does not exist '/home/deployer/apps/myapp/current'" 1>&2; false; fi on 134.19.136.197
DEBUG [55d61c51] Command: if test ! -d /home/deployer/apps/myapp/current; then echo "Directory does not exist '/home/deployer/apps/myapp/current'" 1>&2; false; fi
DEBUG [55d61c51] Finished in 0.895 seconds with exit status 0 (successful).
INFO [166054bd] Running /bin/myapp_bundle --gemfile /home/deployer/apps/myapp/current/Gemfile --path /home/deployer/apps/myapp/shared/bundle --binstubs /home/deployer/apps/myapp/shared/bin --without test development on 134.19.136.197
DEBUG [166054bd] Command: cd /home/deployer/apps/myapp/current && ( RVM_BIN_PATH=~/.rvm/bin /bin/myapp_bundle --gemfile /home/deployer/apps/myapp/current/Gemfile --path /home/deployer/apps/myapp/shared/bundle --binstubs /home/deployer/apps/myapp/shared/bin --without test development )
DEBUG [166054bd] zsh:1: no such file or directory: /bin/myapp_bundle
cap aborted!
bundle stdout: Nothing written
bundle stderr: Nothing written
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/command.rb:94:in `exit_status='
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:125:in `block (4 levels) in _execute'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:147:in `block (2 levels) in _execute'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:149:in `block in _execute'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:106:in `tap'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:106:in `_execute'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:54:in `execute'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-bundler-1.0.0/lib/capistrano/tasks/bundler.cap:20:in `block (4 levels) in <top (required)>'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/abstract.rb:81:in `within'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-bundler-1.0.0/lib/capistrano/tasks/bundler.cap:19:in `block (3 levels) in <top (required)>'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:42:in `run'
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => bundler:install
(See full trace by running task with --trace)
I used capistrano 2 but when I updated capistrano to version 3 I have this error with two my ROR 4 app. Why capistrano use '/bin/myapp_bundle'?
----------- UPDATE -----------
#mpapis help me with it:
cap productiom rvm:hook deploy
and it's working, but when I created custom task with mpapis help:
namespace :whenever do
desc "Update application's crontab entries using Whenever"
task :update_crontab do
on roles(:app) do
execute "cd /home/deployer/apps/fxfinvis/current/ && bundle exec whenever -w RAILS_ENV=#{fetch :rails_env}"
end
end
before :update_crontab, 'rvm:hook'
end
before "deploy:finishing", "whenever:update_crontab"
# If anything goes wrong, undo.
after "deploy:finishing_rollback", "whenever:update_crontab"
and I have same error:
cap production whenever:update_crontab
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777
INFO [1372d0e2] Running cd /home/deployer/apps/fxfinvis/current/ && bundle exec whenever -w RAILS_ENV=production on 134.19.136.197
DEBUG [1372d0e2] Command: cd /home/deployer/apps/fxfinvis/current/ && bundle exec whenever -w RAILS_ENV=production
cap aborted!
cd /home/deployer/apps/fxfinvis/current/ && bundle exec whenever -w RAILS_ENV=production stdout: Nothing written
cd /home/deployer/apps/fxfinvis/current/ && bundle exec whenever -w RAILS_ENV=production stderr: Nothing written
/Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/command.rb:94:in `exit_status='
....
you need to run:
cap production rvm:hook bundler:install
also change the whenever:update_cron task to:
within current_path do
execute :bundle, "exec whenever -w RAILS_ENV=#{fetch :rails_env}"
end
I'm not fully sure about the :current_path - but should work.
This worked for me:
ruby
set :default_env, { rvm_bin_path: '~/.rvm/bin' }
Related
It shows wrong number of arguments but I am passing 3 arguments
ScannerWorker.perform_async('bob1','bob2',5)
Here sidekiq worker code
class ScannerWorker
include Sidekiq::Worker
def perform(bob1, bob2, bob3)
puts bob1
end
end
sidekiq version:- 4.2.7
rails 4.2.6
Redis server v=3.0.7
Sidekiq Error:-
2017-01-03T06:29:43.007Z 9547 TID-itjjk WARN: ArgumentError: wrong number of arguments (given 0, expected 2..3)
2017-01-03T06:29:43.007Z 9547 TID-itjjk WARN: /home/smk/14.04/rails/projects/myappname/app/workers/scanner_worker.rb:5:in `test'
/home/smk/14.04/rails/projects/myappname/app/workers/scanner_worker.rb:5:in `perform'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:158:in `execute_job'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:138:in `block (4 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq.rb:36:in `block in <module:Sidekiq>'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:133:in `block (3 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/logging.rb:32:in `with_context'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/logging.rb:7:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:132:in `block (2 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:174:in `stats'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:131:in `block in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq.rb:35:in `block in <module:Sidekiq>'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:126:in `process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:82:in `process_one'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:70:in `run'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/util.rb:17:in `watchdog'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/util.rb:25:in `block in safe_thread'
You need to restart Sidekiq. Live code reloading only works with Sidekiq 4.2+ running Rails 5.0+.
Follow this steps
* Mention the sidekiq version in gemfile
* kill the sidekiq process and restart the sidekiq
You need to restart Sidekiq
To Start:
$ bundle exec sidekiq
To Run in the background:
$ bundle exec sidekiq -d -P tmp/sidekiq.pid -L log/sidekiq.log
where -d demonize, -P pid file, -L log file.
Stop:
$ bundle exec sidekiqctl stop tmp/sidekiq.pid 0
Sidekiq shut down gracefully.
where 0 is number of seconds to wait until Sidekiq exits.
worth noting. I've been working on a similar issue.
SomeWorker.perform_async(#user.id)
class SomeWorker
include Sidekiq::Worker
def perform(user_id)
puts "{user_id}"
end
end
unsure exactly why i was getting the arguments error. Maybe it was an because of an instance variable, maybe a rails bug.
Nevertheless, I receated the worker using
$rails g sidekiq:worker SomeWorker
and saw this *.
class SomeWorker
include Sidekiq::Worker
def perform(*args)
puts #some thing
end
end
by adding the astrix everything worked perfectly.
quick answer:
class SomeWorker
include Sidekiq::Worker
def perform(*user_id)
puts #some thing
end
end
I am using the jenkins cookbook to set up a windows slave on AWS. Locally (vagrant on virtualbox), it converges correctly, but when provisioning a new machine on aws using chef-provisioning and the fog driver, I run into the following error:
================================================================================
Error executing action `create` on resource 'jenkins_windows_slave[build-slave]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "java" -jar "C:\chef\cache/jenkins-cli.jar" -s http://10.0.0.5:8080 groovy C:/Users/ADMINI~1/AppData/Local/Temp/groovy20150312-536-1d2hoy4 ----
STDOUT: Error occurred during initialization of VM
Unable to allocate 61440KB bitmaps for parallel garbage collection for the requested 1966080KB heap.
STDERR: Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
---- End output of "java" -jar "C:\chef\cache/jenkins-cli.jar" -s http://10.0.0.5:8080 groovyC:/Users/ADMINI~1/AppData/Local/Temp/groovy20150312-536-1d2hoy4 ----
Ran "java" -jar "C:\chef\cache/jenkins-cli.jar" -s http://10.0.0.5:8080 groovy C:/Users/ADMINI~1/AppData/Local/Temp/groovy20150312-536-1d2hoy4 returned 1
Resource Declaration:
---------------------
# In C:/chef/cache/cookbooks/xyz_jenkins/recipes/slave_windows.rb
53: jenkins_windows_slave node['jenkins']['node']['name'] do
54: remote_fs node['jenkins']['node']['remote_fs'] # jenkins workspace items stored here
55: group node['jenkins']['node']['group'] # Group with access to remote_fs
56: user node['jenkins']['node']['user'] # user the service runs under (and remote_fs owner)
57: password node['jenkins']['node']['password'] # for user running the service
58: labels node['jenkins']['node']['labels'] # labels on Jenkins master
59: action :create
60: end
Compiled Resource:
------------------
# Declared in C:/chef/cache/cookbooks/xyz_jenkins/recipes/slave_windows.rb:53:in `from_file'
jenkins_windows_slave("build-slave") do
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :jenkins_windows_slave
cookbook_name "xyz_jenkins"
recipe_name "slave_windows"
remote_fs "C:\\jenkins"
group "Everyone"
user "jenkins"
password "apasswordhere"
labels ["builder", "windows"]
slave_name "build-slave"
end
chef-provisioning's stack trace:
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/transport/winrm.rb:144:in `error!'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/machine/basic_machine.rb:31:in `block in execute'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `call'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/provider.rb:180:in `converge_by'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/chef_provider_action_handler.rb:54:in `perform_action'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/machine/basic_machine.rb:29:in `execute'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/convergence_strategy/install_msi.rb:49:in`block (2 levels) in converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/run_context.rb:268:in `open_stream'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/chef_provider_action_handler.rb:59:in `open_stream'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/convergence_strategy/install_msi.rb:46:in`block in converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/run_context.rb:268:in `open_stream'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/chef_provider_action_handler.rb:59:in `open_stream'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/convergence_strategy/install_msi.rb:45:in`converge'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provisioning/machine/basic_machine.rb:21:in `converge'
U:/.chefdk/gem/ruby/2.0.0/gems/chef-provisioning-0.19/lib/chef/provider/machine.rb:62:in `block in <class:Machine>'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:60:in `instance_eval'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:60:in `recipe_eval_with_update_check'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:45:in `block in action'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource.rb:582:in `run_action'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/client.rb:315:in `converge'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/client.rb:400:in `block in run'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/client.rb:399:in `catch'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/client.rb:399:in `run'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application.rb:243:in `run_with_graceful_exit_option'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application.rb:220:in `block in run_chef_client'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/local_mode.rb:38:in `with_server_connectivity'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application.rb:201:in `run_chef_client'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/client.rb:355:in `block in interval_run_chef_client'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/client.rb:345:in `loop'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/client.rb:345:in `interval_run_chef_client'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/client.rb:335:in `run_application'
C:/opscode/chefdk/embedded/apps/chef/lib/chef/application.rb:58:in `run'
C:/opscode/chefdk/embedded/apps/chef/bin/chef-client:26:in `<top (required)>'
C:/opscode/chefdk/bin/chef-client:52:in `load'
C:/opscode/chefdk/bin/chef-client:52:in `<main>'
chef run stack trace
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/mixlib-shellout-2.0.1-x86-mingw32/lib/mixlib/shellout.rb:278:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/mixlib-shellout-2.0.1-x86-mingw32/lib/mixlib/shellout.rb:265:in `error!'
C:/chef/cache/cookbooks/jenkins/libraries/_executor.rb:82:in `execute!'
C:/chef/cache/cookbooks/jenkins/libraries/_executor.rb:127:in `groovy!'
C:/chef/cache/cookbooks/jenkins/libraries/slave.rb:315:in `current_slave'
C:/chef/cache/cookbooks/jenkins/libraries/slave.rb:129:in `load_current_resource'
C:/chef/cache/cookbooks/jenkins/libraries/slave_jnlp.rb:52:in `load_current_resource'
C:/chef/cache/cookbooks/jenkins/libraries/slave_windows.rb:62:in `load_current_resource'
C:/opscode/chef/embedded/apps/chef/lib/chef/provider.rb:128:in `run_action'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource.rb:561:in `run_action'
C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:331:in `block in converge'
C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:in `catch'
C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:in `converge'
C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:345:in `converge_and_save'
C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:448:in `run'
C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:253:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:230:in `block in run_chef_client'
C:/opscode/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:in `with_server_connectivity'
C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:213:in `run_chef_client'
C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:392:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:in `loop'
C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:in `interval_run_chef_client'
C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:372:in `run_application'
C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:60:in `run'
C:/opscode/chef/embedded/apps/chef/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:64:in `load'
C:/opscode/chef/bin/chef-client:64:in `<main>'
I have tried different versions of the chef-client to resolve the issue, but that did not help. I'm not sure if the problem is with the jenkins recipe, chef-provisioning, or what.
Because the jenkins recipes work on a local vagrant machine running the same OS (win 2012 R2), I'm thinking this may be a problem with chef-provisioning-fog.
It turns out the problem is with WinRM. The current version of the chef-provisioning-fog driver hard-codes the AWS user data in order to set up WinRM on the machine. Part of this setup sets the per-shell memory limit to 300MB, and the java command executed by the jenkins recipe wants to reserve 2GB of heap; hence the fatal error.
The short-term fix is to up the per-shell WinRM limit from 300MB to 2GB:
set-item wsman:localhost\Shell\MaxMemoryPerShellMB 2048
With chef-provisioning, put this resource after getting the machine ready and before converging:
machine_execute 'set-item wsman:localhost\Shell\MaxMemoryPerShellMB 2048' do
machine "jenkins-win-slave-#{i}"
end
Long term, hopefully the issue is resolved and user data can be customized to set up winrm however the user sees fit.
I have set up a site built on Flask sing eb (the Terminal client for Elastic Beanstalk v3.1).
When deploying a new version of my site I get "Update environment operation is complete, but with errors. For more information, see troubleshooting documentation." message.
I have .ebextensions/aws.config file
container_commands:
01_migrate:
command: "application.py db upgrade"
leader_only: true
I tried using ignoreErrors: true and different combinations for the command with no luck. Any ideas to solve this or get away with migration upgrades?
versions:
alembic==0.7.4
awsebcli==3.1
cement==2.4.0
Flask==0.10.1
Flask-Migrate==1.3.0
Flask-Script==2.0.5
Flask-SQLAlchemy==2.0
itsdangerous==0.24
Jinja2==2.7.3
jmespath==0.6.1
Mako==1.0.1
MarkupSafe==0.23
psycopg2==2.6
python-dateutil==2.4.0
PyYAML==3.11
six==1.9.0
SQLAlchemy==0.9.8
Werkzeug==0.10.1
Eerything deployed with Python 3.4 on a 64bit Debian jessie v1.2.0 running Python 3.4 (Preconfigured - Docker)
EDIT: after the misspelling fix
Event message:
[Instance: i-a1627aab Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: [CMD-AppDeploy/AppDeployStage0/EbExtensionPostBuild] command failed with error code 1: Error occurred during build: Command 01_migrate failed.
these are the logs from Elastic Beanstalk
[2015-02-22T23:37:16.010Z] INFO [17720] - [CMD-AppDeploy/AppDeployStage0/EbExtensionPostBuild] : Activity execution failed, because: command failed with error code 1: Error occurred during build: Command 01_migrate failed (Executor::NonZeroExitStatus)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor/exec.rb:81:in `sh'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor/exec.rb:24:in `sh'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/cfn-wrapper.rb:51:in `call_cfn_script'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/cfn-wrapper.rb:28:in `run_config_sets'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/infrahooks/infra-embeddedpostbuild.rb:20:in `execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/executable.rb:56:in `instance_eval'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/executable.rb:56:in `execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:213:in `block (3 levels) in exec_stage'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:209:in `block (2 levels) in exec_stage'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each_with_index'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `block in exec_stage'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:204:in `exec_stage'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:158:in `execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:68:in `run'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:64:in `block (2 levels) in execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:62:in `block in execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:106:in `execute_command'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:60:in `execute!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/bin/command-processor:46:in `<top (required)>'
from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `load'
from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `<main>'
#dnuske
Please note that the solution stack you are using is a Docker based solution stack. As a result, your eb-extensions will not run within the docker context but within the host.
To do what you require, you'll need to update the python dockerfile (https://github.com/aws/aws-eb-python-dockerfiles/blob/master/3.4.2-aws-eb-onbuild/Dockerfile ) to add the upgrade step as part of that docker file. Once you have done that, you can bundle your docker file along with your application and your steps will work as required.
Please let me know if that answers your question.
Thanks,
Dhanvi
Ensure that you are in the necessary python virtual environment for the migration. In my instance I found the following to work for Flask-Migrate:
container_commands:
01_migrate:
command: "source /var/app/venv/staging-LQM1lest/bin/activate; flask db upgrade"
leader_only: true
Add this file to the root of your project directory:
.ebextensions/migration.config
container_commands:
01_migrate:
command: "source /var/app/venv/staging-LQM1lest/bin/activate && python3 manage.py db upgrade"
leader_only: true
Check PYTHONPATH in your EB environment configuration / Software / Environment properties. Mine is /var/app/venv/staging-LQM1lest/bin
manage.py is the file that contains something like this
import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from application import application, db
application.config.from_object(os.environ['APP_SETTINGS'])
migrate = Migrate(application, db)
manager = Manager(application)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
I have used rails 4 and Capistrano 3. When i depoly with Capistrano fail during rake assets:precompile and show following error
INFO [1c9c2531] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile on 107.170.67.113
cap aborted!
SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
I'm newbie on rails and server setup so where am i missing.I don't know
Here my depoly.rb
SSHKit.config.command_map[:rake] ||= "bundle exec rake"
# config valid only for Capistrano 3.1
lock '3.0.1'
set :application, 'PCA'
set :repo_url, 'git#github.com:3lackRos3/pca.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/pca/app/pca'
set :deploy_user, 'pca'
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
set :rvm_type, :user
set :rvm_bin_path, '/usr/local/rvm/bin'
# set :default_environment, {
# 'RBENV_ROOT' => '/usr/local/rbenv',
# 'PATH' => "/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH"
# }
# set :default_environment, {
# 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
# }
# set :rbenv_ruby, "2.1.1"
# set :rbenv_ruby_dir, -> { "#{fetch(:rbenv_path)}/versions/#{fetch(:rbenv_ruby)}" }
# set :rbenv_map_bins, %w{rake gem bundle ruby rails}
# Default value for :scm is :git
set :scm, :git
set :ssh_options, { forward_agent: true }
#set :ssh_options, proxy: Net::SSH::Proxy::Command.new('ssh pca#107.170.67.113 -W %h:%p')
# Default value for :format is :pretty
# set :format, :pretty
set :log_level, :info
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# SSHKit.config.command_map[:rake].sub!(/\(.*\)rake/, "\1bundle exec rake")
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 20
after "deploy", "deploy:cleanup"
namespace :deploy do
desc 'Restart application'
task :restart do
# on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
# end
end
after :publishing, :restart
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
# execute :rake, 'cache:clear'
# end
# end
end
after :finishing, 'deploy:cleanup'
end
Here my capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
#require 'rvm1/capistrano3'
#require 'capistrano/rvm'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
#
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/rails'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
I have run bundle exec cap production deploy:check and
my output is
INFO [ecf1a980] Running /usr/bin/env mkdir -p /tmp/PCA/
INFO [ecf1a980] Finished in 4.848 seconds with exit status 0 (successful).
INFO Uploading /tmp/PCA/git-ssh.sh 100.0%
INFO [8e7210f6] Running /usr/bin/env chmod +x /tmp/PCA/git-ssh.sh on serverip
INFO [8e7210f6] Finished in 0.639 seconds with exit status 0 (successful).
INFO [4c538c51] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared /home/pca/app/pca/releases
INFO [4c538c51] Finished in 4.480 seconds with exit status 0 (successful).
INFO [d6a7dce6] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared/bin /home/pca/app/pca/shared/log /home/pca/app/pca/shared/tmp/pids /home/pca/app/pca/shared/tmp/cache /home/pca/app/pca/shared/tmp/sockets /home/pca/app/pca/shared/vendor/bundle /home/pca/app/pca/shared/public/system
INFO [d6a7dce6] Finished in 4.507 seconds with exit status 0 (successful).
Anybody help me..
thanks!
I have the same issue, having the error rake stderr: Nothing written when running (deployment) cap production deploy.
Turns out it's due to lack of memory, I have a 1G memory server, so "The Solution is to create a swap memory". For me, creating a 2G swap memory fixed it. Deployment now continues and finishes without any errors.
Seems like precompiling process killing due to the lack of memory.
Try to create swap memory.
Check out this tutorial
Make sure to include ssh key of server where deployment is occurring in gits trusted keys.
I am trying to upgrade my setup to v3 and am encountering an issue that I am finding trouble to debug. I use vagrant to test a staging environment for my very small app. Here is what my config/deploy/staging.rb file looks like:
set :user, "vagrant"
set :stage, :staging
set :ssh_options, {
keys: %w(~/.vagrant.d/insecure_private_key),
forward_agent: true
}
role :all, "192.168.33.101", primary: true
set :domain_name, "domain.local"
Here is my deploy:setup command for testing:
namespace :deploy do
desc 'Setup the application (NO-OP Hook)'
task :setup do
on roles(:app) do
execute :echo, :uptime
end
end
end
When trying do anything, even just getting uptime, this is the error I get:
$ cap staging deploy:setup --trace
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy:setup (first_time)
** Execute deploy:setup
INFO [5cf8fd6d] Running /usr/bin/env echo uptime on 192.168.33.101
cap aborted!
Net::SSH::AuthenticationFailed
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:156:in `ssh'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:109:in `block in _execute'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:106:in `tap'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:106:in `_execute'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:54:in `execute'
/Users/mbridges/code/github.com/mattdbridges/cornerstone/config/deploy.rb:24:in `block (3 levels) in <top (required)>'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `run'
/Users/mbridges/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/sshkit-1.0.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => deploy:setup
I was able to authenticate just fine prior to the upgrade. Any ideas?
As it turns out, it has to do with the Vagrant IP address and port configuration.
A simple change
# Old
role :all, "192.168.33.101", primary: true
# New
server "vagrant#localhost:2222", roles: %w[web app db], primary: true
This solves the problem, at least for me.