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.
Related
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 am stumped. I am not sure how to locate the source of my issues. Here is the error I get:
> bundle exec rspec spec
ThemeMaintainer
should have tests (FAILED - 1)
Failures:
1) ThemeMaintainer should have tests
Failure/Error: Unable to find matching line from backtrace
TypeError:
wrong argument type Class (expected Module)
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `include'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `block in add_template_helper'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `module_eval'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `add_template_helper'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:95:in `block in helper'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:94:in `each'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:94:in `helper'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/action_view/test_case.rb:93:in `include_helper_modules!'
# /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/action_view/test_case.rb:86:in `new'
Finished in 0.0017 seconds (files took 13.66 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/helpers/theme_maintainer_spec.rb:4 # ThemeMaintainer should have tests
Top 1 slowest examples (0.00001 seconds, 0.8% of total time):
ThemeMaintainer should have tests
0.00001 seconds ./spec/helpers/theme_maintainer_spec.rb:4
Randomized with seed 27022
Coverage report generated for RSpec to /Users/tj/projects/AOT/aotv2/coverage. 9272 / 22617 LOC (41.0%) covered.
/Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `include': wrong argument type Class (expected Module) (TypeError)
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `block in add_template_helper'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `module_eval'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:170:in `add_template_helper'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:95:in `block in helper'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:94:in `each'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/abstract_controller/helpers.rb:94:in `helper'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/action_view/test_case.rb:93:in `include_helper_modules!'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/actionpack-4.0.12/lib/action_view/test_case.rb:86:in `new'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/example_group.rb:472:in `run'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:111:in `block (2 levels) in run_specs'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:111:in `map'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:111:in `block in run_specs'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/reporter.rb:53:in `report'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:107:in `run_specs'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:85:in `run'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:69:in `run'
from /Users/tj/.rvm/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/ruby/2.1.0/gems/rspec-core-3.1.4/lib/rspec/core/runner.rb:37:in `invoke'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/gems/rspec-core-3.1.4/exe/rspec:4:in `<top (required)>'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/bin/rspec:23:in `load'
from /Users/tj/.rvm/gems/ruby-2.1.3#global/ruby/2.1.0/bin/rspec:23:in `<main>'
and here is the spec
require 'spec_helper.rb'
RSpec.describe ThemeMaintainer do
it 'should have tests'
end
Everytime I run rspec spec I get an error right away on a different spec (it is randomizing sequence of tests). Obviously? there is nothing wrong with the ThemeMaintainer spec. And each one that I get an error on I can easily pass when run by itself.
So my question is how do I find the spec that is really failing?
I have 8 dirs under specs. I run them rspec spec/<dir> 8 individual runs and all runs fine. Only when I run rspec spec for the whole app do I get the error. Stacktrace is ALWAYS the same. Error is always the same.
I could use some guidance on how to diagnose.
Apparently as was recommended in a Github issue response, config.infer_spec_type_from_file_location! should not be being used (as in turn it off in RSpec.configure) and that solves the problem.
I am still not sure why having had it on for 2 years and not having any issue thus far that it now failed.
You didn't close the block.
require 'spec_helper.rb'
RSpec.describe ThemeMaintainer do
it 'should have tests' do
end
end
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' }
I am trying to tunnel the mysql service on api.cloudfoundry.com but facing the error below.
I have installed Ruby 2.0
installed gem versions :
* LOCAL GEMS *
addressable (2.3.3, 2.2.8),async_sinatra (0.5.0),bigdecimal (1.2.0),caldecott (0.0.5),caldecott-client (0.0.2),cf-uaa-lib (1.3.10),cfoundry (0.5.3.rc5),clouseau (0.0.2),
em-http-request (0.3.0),em-websocket (0.3.8),escape_utils (0.3.2),eventmachine (1.0.3 ruby x86-mingw32),interact (0.5.2),io-console (0.4.2),json (1.7.7, 1.6.8),json_pure (1.7.7),
manifests-vmc-plugin (0.6.3.rc2),mime-types (1.21),minitest (4.3.2),mothership (0.5.1),
multi_json (1.7.0),multipart-post (1.2.0),psych (2.0.0),rack (1.5.2),rack-protection (1.5.0),rake (0.9.6),rdoc (4.0.0),rest-client (1.6.7),rubygems-update (2.0.3),
rubyzip (0.9.9),sinatra (1.4.1),test-unit (2.0.0.0),tilt (1.3.6),tunnel-vmc-plugin (0.2.2),
uuidtools (2.1.3),vmc (0.5.1.rc4)
C:\Users\user>vmc tunnel
DL is deprecated, please use Fiddle
1: mongo-hello
2: mysql-hello
3: rabbit-hello
Which service instance?> 2
1: none
2: mysql
3: mysqldump
Which client would you like to start?> 2
Opening tunnel on port 10000... FAILED
CFoundry::BadResponse: 400: <h2>Client sent a bad request.</h2>
For more information, see ~/.vmc/crash
crash contents:
Time of crash:
2013-03-20 17:30:10 +0530
CFoundry::BadResponse: 400: <h2>Client sent a bad request.</h2>
<<<
REQUEST: GET http://api.cloudfoundry.com/apps/caldecott
REQUEST_HEADERS:
Accept : application/json
Authorization : bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjEzNjQwOTc3OTksInVzZXJfbmFtZSI6ImFtdWxsYXdvcmtAZ21haWwuY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwib3BlbmlkIiwicGFzc3dvcmQud3JpdGUiXSwiZW1haWwiOiJhbXVsbGF3b3JrQGdtYWlsLmNvbSIsImF1ZCI6WyJvcGVuaWQiLCJjbG91ZF9jb250cm9sbGVyIiwicGFzc3dvcmQiXSwianRpIjoiOGEzYmNhYzEtOTdjMC00OGY2LWE1YjAtNmZhNjFkNTM1YzRiIiwidXNlcl9pZCI6Ijc1NGE0YmE0LTQxNDMtNDA1NC05OWE3LWRkOGJlYTA1NzMyOSIsImNsaWVudF9pZCI6InZtYyJ9.bgY7BUi7DpjKL4gy5YkbTJDYuYXHhHPzKPZApabeA_dpRLfcr1yhprlx2Yx1Shavdso-R9jYg3jiy9MuTUhZ6hvIVVoKcaFxcw43owb2ztXxb_VM6N2wmyXnLX5dmSXNIv7xa5hgbeuwE32rSR66sLNGEgHu-sreaKQIN9V6GbOe-Bj4WN-uux0O8AGmol5sp1QhD4Nf2nAmsiPHR63OhS6-SDBYgizcmpfWgwGeOMvcTumbYJ6PpvRNPa20pQomjDOqSY2Jn_tQM7RfZCklpyZKvdt2RIQK5fWAekMLWlnG3aJYHE90UHnxg0UclhwzgrgI0HiDWkQ_42dqOX446g
Content-Length : 297
Content-Type : application/json
REQUEST_BODY: {"name":"caldecott","instances":1,"staging":{"model":"sinatra","stack":"ruby19","command":"bundle exec ruby server.rb -p $VCAP_APP_PORT"},"resources":{"memory":64},"env":["CALDECOTT_AUTH=9d498baf-9102-4c80-851d-f400530a261f"],"uris":["caldecott-b58c1.cloudfoundry.com"],"services":["mysql-hello"]}
RESPONSE: [400]
RESPONSE_HEADERS:
content-type : text/html
RESPONSE_BODY:
<h2>Client sent a bad request.</h2>
>>>
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:167:in `handle_error_response'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:137:in `handle_response'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:87:in `request'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:72:in `post'
cfoundry-0.5.3.rc5/lib/cfoundry/v1/model_magic.rb:46:in `block (2 levels) in define_client_methods'
cfoundry-0.5.3.rc5/lib/cfoundry/v1/model.rb:83:in `create!'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:145:in `push_helper'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:88:in `create_helper'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:28:in `open!'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/plugin.rb:41:in `block in tunnel'
interact-0.5.2/lib/interact/progress.rb:98:in `with_progress'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/plugin.rb:40:in `tunnel'
mothership-0.5.1/lib/mothership/base.rb:66:in `run'
mothership-0.5.1/lib/mothership/command.rb:72:in `block in invoke'
mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:150:in `block (2 levels) in execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:161:in `save_token_if_it_changes'
vmc-0.5.1.rc4/lib/vmc/cli.rb:149:in `block in execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:100:in `wrap_errors'
vmc-0.5.1.rc4/lib/vmc/cli.rb:145:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
vmc-0.5.1.rc4/bin/vmc:11:in `<top (required)>'
D:/Ruby200/bin/vmc:23:in `load'
D:/Ruby200/bin/vmc:23:in `<main>'
Try deleting the caldecott application and then trying the tunnel again;
$ vmc delete caldecott
$ vmc tunnel