aws / opsworks-cookbooks

Chef Cookbooks for the AWS OpsWorks Service
Other
1.06k stars 1.23k forks source link

Rails App setup fails with latest OpsWorks Agent version #370

Closed spickermann closed 8 years ago

spickermann commented 8 years ago

Rails App server setup fails.

Updating to the newest OpsWorks Agent version (like it was recommended on the OpsWorks dashboard) does not help. I also tried several different combinations of OpsWorks Agent versions and desired Ruby Gem versions.

The error log looks like this:

[2016-02-27T12:23:12+00:00] INFO: Processing template[/etc/sudoers.d/opsworks] action create (ssh_users::default line 41)
[2016-02-27T12:23:12+00:00] INFO: Processing remote_file[/tmp/rubygems-2.5.2.tgz] action create (opsworks_rubygems::default line 1)
[2016-02-27T12:23:12+00:00] INFO: remote_file[/tmp/rubygems-2.5.2.tgz] created file /tmp/rubygems-2.5.2.tgz
[2016-02-27T12:23:12+00:00] WARN: remote_file[/tmp/rubygems-2.5.2.tgz] cannot be downloaded from http://production.cf.rubygems.org/rubygems/rubygems-2.5.2.tgz: Error connecting to http://production.cf.rubygems.org/rubygems/rubygems-2.5.2.tgz - getaddrinfo: Name or service not known

================================================================================
Error executing action `create` on resource 'remote_file[/tmp/rubygems-2.5.2.tgz]'
================================================================================

SocketError
-----------
Error connecting to http://production.cf.rubygems.org/rubygems/rubygems-2.5.2.tgz - getaddrinfo: Name or service not known

Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_rubygems/recipes/default.rb

1: remote_file "/tmp/rubygems-#{node[:opsworks_rubygems][:version]}.tgz" do
2:   source "http://production.cf.rubygems.org/rubygems/rubygems-#{node[:opsworks_rubygems][:version]}.tgz"
3:   not_if do
4:     ::File.exists?('/usr/local/bin/gem') && `/usr/local/bin/gem -v`.strip == node[:opsworks_rubygems][:version]
5:   end
6: end
7: 

Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_rubygems/recipes/default.rb:1:in `from_file'

remote_file("/tmp/rubygems-2.5.2.tgz") do
provider Chef::Provider::RemoteFile
action "create"
retries 0
retry_delay 2
path "/tmp/rubygems-2.5.2.tgz"
backup 5
atomic_update true
source ["http://production.cf.rubygems.org/rubygems/rubygems-2.5.2.tgz"]
use_etag true
use_last_modified true
cookbook_name "opsworks_rubygems"
recipe_name "default"
not_if { #code block }
end

[2016-02-27T12:23:12+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-02-27T12:23:12+00:00] ERROR: Running exception handlers
[2016-02-27T12:23:12+00:00] ERROR: Exception handlers complete
[2016-02-27T12:23:12+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2016-02-27T12:23:13+00:00] ERROR: remote_file[/tmp/rubygems-2.5.2.tgz] (opsworks_rubygems::default line 1) had an error: SocketError: Error connecting to http://production.cf.rubygems.org/rubygems/rubygems-2.5.2.tgz - getaddrinfo: Name or service not known
[2016-02-27T12:23:13+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
jweiss commented 8 years ago

Please see https://forums.aws.amazon.com/ann.jspa?annID=3570

Rubygems disabled the location that we were using to download rubygems which impacted Chef 11.10 instances. Meanwhile we released both a new agent (version 3433) that used a different location and Rubygems re-enabled the old location.

So either way, it should work normally again by now.

We will also release a new agent next week that no longer uses the rubygems location directly so that we don't depend on them.

spickermann commented 8 years ago

I can confirm that it is possible to deploy again. The problem is solved. Thanks for looking into it.