Skip to Content

deploy app problem: Chef::Exceptions::Exec with "bin/rake db:migrate"

i have a rails application connected with a hana db server. locally it works fine and my vm is also able to connect to that database (i tried isql Hana username password and the connection works). when i try to deploy my application i get the following exception:

Does anybody has a idea what the problem is?

================================================================================ [0m

[31mError executing action `deploy` on resource 'deploy_revision[advisory-service]' [0m

================================================================================ [0m

[0m

Chef::Exceptions::Exec [0m

---------------------- [0m

bin/rake db:migrate returned 1, expected 0 [0m

[0m

Resource Declaration: [0m

--------------------- [0m

# In /var/lib/monsoon/repos/cert/rails_dev/chef/cookbooks/sap-deploy/providers/rails.rb

70: deploy_revision new_resource.name do

71: repository new_resource.repository

72: revision new_resource.revision

73: user new_resource.owner

74: group new_resource.group

75: deploy_to new_resource.deploy_to

76: ssh_wrapper "#{new_resource.deploy_to}/deploy-ssh-wrapper" if new_resource.deploy_key

77: environment({

78: 'RAILS_ENV' => new_resource.rails_env,

79: 'PATH' => "#{node[:ruby][:bin]}:#{ENV['PATH']}"

80: })

81: symlinks new_resource.symlinks

82: migrate new_resource.migrate

83: migration_command new_resource.migration_command

84: symlink_before_migrate new_resource.symlink_before_migrate

85:

86: notifies :send_notification, new_resource, :immediately

87:

88: # A local variable with the actual new_resource for callbacks

89: local_resource = new_resource

90:

91: before_migrate do

92: link "#{release_path}/vendor/bundle" do

93: to "#{local_resource.deploy_to}/shared/vendor_bundle"

94: end

95:

96: common_groups = %w{development test cucumber staging production osx genesis} - [local_resource.rails_env]

97: bash "bundle install" do

98: cwd release_path

99: user local_resource.owner

100: group

101: environment ({'GIT_SSH' => "#{local_resource.deploy_to}/deploy-ssh-wrapper"}) if local_resource.deploy_key

102: code <<-EOH

103: echo Installling Dependencies

104: #{node[:ruby][:bin]}/bundle install --deployment --binstubs --shebang #{node[:ruby][:bin]}/ruby --without #{common_groups.join(' ')}

105: EOH

106: end

107: end

108:

109: if new_resource.precompile_assets

110: before_symlink do

111: bash "assets precompile" do

112: cwd release_path

113: user local_resource.owner

114: group local_resource.group

115: code <<-EOH

116: echo Precompiling Assets

117: RAILS_ENV=production PATH=#{node[:ruby][:bin]}:$PATH bin/rake assets:precompile

118: EOH

119: end

120: end

121: end

122:

[0m

[0m

Compiled Resource: [0m

------------------ [0m

# Declared in /var/lib/monsoon/repos/cert/rails_dev/chef/cookbooks/sap-deploy/providers/rails.rb:70:in `block in class_from_file'

deploy_revision("advisory-service") do

provider Chef::Provider::Deploy::Revision

action :deploy

retries 0

retry_delay 2

deploy_to "/srv/www/advisory-service"

environment {"RAILS_ENV"=>"production", "PATH"=>"/opt/ruby/1.9.3-p374/bin:/opt/chef/embedded/bin::/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin", "LC_ALL"=>"C"}

repository_cache "cached-copy"

purge_before_symlink ["log", "tmp/pids", "public/system"]

create_dirs_before_symlink ["tmp", "public", "config"]

symlinks {"system"=>"public/system", "pids"=>"tmp/pids", "log"=>"log"}

revision "refs/heads/master"

migrate true

remote "origin"

scm_provider Chef::Provider::Git

keep_releases 5

cookbook_name :advisory_service

repo "https://github.wdf.sap.corp/D062286/advisory-service.git"

user "nginx"

group "nginx"

migration_command "bin/rake db:migrate"

before_migrate # before_symlink # restart_command # after_restart #

shared_path "/srv/www/advisory-service/shared"

destination "/srv/www/advisory-service/shared/cached-copy"

current_path "/srv/www/advisory-service/current"

end

[0m

[0m

[2014-08-21T15:31:02+00:00] INFO: Running queued delayed notifications before re-raising exception

[2014-08-21T15:31:02+00:00] ERROR: Running exception handlers

[2014-08-21T15:31:02+00:00] ERROR: Exception handlers complete

[2014-08-21T15:31:02+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

[2014-08-21T15:31:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Command failed with exit code 1: /opt/chef/bin/chef-solo

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Aug 21, 2014 at 03:58 PM

    Hi

    Can you able to check the trace file chef-stacktrace.out , as per below path ?

    [2014-08-21T15:31:02+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

    regards

    Swami

    Add comment
    10|10000 characters needed characters exceeded