unable to deploy with capistrano 2.3.14

40 views
Skip to first unread message

Josh

unread,
Oct 14, 2012, 2:11:10 AM10/14/12
to railsmachin...@googlegroups.com
I started getting nil values for configuration[:key_that_exists_for_realz] in my application manifest.  Reverting to 2.12.0 fixes whatever issue it is.

 * executing "sudo -p 'sudo password: ' RAILS_ROOT=/rails/app/releases/20121014060352 DEPLOY_STAGE=production RAILS_ENV=production shadow_puppet  /rails/app/releases/20121014060352/app/manifests/application_manifest.rb"
   servers: ["prod-app1", "prod-db1"]
   [prod-app1] executing command
   [prod-db1] executing command
** [out :: prod-db1] Uncaught exception: NoMethodError: undefined method `each' for nil:NilClass
** [out :: prod-db1] 
** [out :: prod-db1] /rails/app/releases/20121014060352/app/manifests/application_manifest.rb:159:in `<class:ApplicationManifest>'
** [out :: prod-db1] /rails/app/releases/20121014060352/app/manifests/application_manifest.rb:3:in `<top (required)>'
** [out :: prod-db1] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: prod-db1] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: prod-db1] /usr/lib/ruby/gems/1.9.1/gems/shadow_puppet-0.6.1/bin/shadow_puppet:130:in `<top (required)>'
** [out :: prod-db1] /usr/bin/shadow_puppet:19:in `load'
** [out :: prod-db1] /usr/bin/shadow_puppet:19:in `<main>'
** [out :: prod-db1]

manifest:

  configuration[:hosts][rails_env].select{|key| key.match(/^(app|db)/)}.each do |k,v|      # line 159
    iptables_rules += [
      "-A INPUT -i eth0 -p tcp -s #{v} -j ACCEPT",
      "-A OUTPUT -o eth0 -p tcp -d #{v} -j ACCEPT"
    ]
  end


moonshine.yml:

:hosts:
  :production:
    :app1: 192.168.160.118
    :db1: 192.168.160.117
    :public_db1: 1.2.3.4

Josh Nichols

unread,
Oct 15, 2012, 10:19:10 AM10/15/12
to railsmachin...@googlegroups.com
For capistrano version, did you mean 2.13 (not 2.3)?

If so, there's a weird bug where it deletes the config directory on deploy. When that happens, everything in config/moonshine.yml would be gone, therefore can't be read, and then weird cases of things being nil.

One fix is to remove `config` from `config/moonshine.yml`'s `:shared_children`. That should fix the problem.

Another is to use bundler to manage capistrano version, and lock it to 2.12.0.

Can you give those a shot please?


- Josh

--
You received this message because you are subscribed to the Google Groups "Moonshine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/railsmachine-moonshine/-/L0A3cfs1GfcJ.
To post to this group, send email to railsmachin...@googlegroups.com.
To unsubscribe from this group, send email to railsmachine-moon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/railsmachine-moonshine?hl=en.

Josh Sharpe

unread,
Oct 15, 2012, 11:05:26 AM10/15/12
to railsmachin...@googlegroups.com
On Mon, Oct 15, 2012 at 10:19 AM, Josh Nichols <jo...@railsmachine.com> wrote:
For capistrano version, did you mean 2.13 (not 2.3)?

Yes. 2.13.4.

Both of these solutions fixed the problem.  Thanks.
Reply all
Reply to author
Forward
0 new messages