Search code examples
ruby-on-railsamazon-web-servicesgoogle-maps-api-3amazon-s3rails-geocoder

Rails Application is not loading on aws instance


I have a rails application deployed to aws. It was loading & working fine until last friday and it stopped loading, I researched and tried many solutions but got no luck its still not loading. Maybe issue is with the geocoder gem because its throwing exception in the code as :

App 22750 stdout: "Exception Message : "
App 22750 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"

Exceptions are handled, it is working fine on local in all environments : development, test & production. But didn't loading on aws live server.

I have also tried to start new environment but its doing same for both new & old environments on aws console.

AWS Logs are :

-------------------------------------
/var/app/support/logs/passenger.log
-------------------------------------
App 22526 stdout: 
App 22526 stdout: I, [2016-04-12T14:14:50.119149 #22526]  INFO -- : Started GET "/" for 182.189.239.229 at 2016-04-12 14:14:50 +0000
App 22526 stdout: I, [2016-04-12T14:14:50.236634 #22526]  INFO -- : Processing by FoodNetworksController#index as HTML
App 22492 stdout: I, [2016-04-12T14:14:50.250028 #22492]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (979.4ms)
App 22526 stdout: D, [2016-04-12T14:14:50.302096 #22526] DEBUG -- : FOODNETWORK index HERE*******************
App 22526 stdout: D, [2016-04-12T14:14:50.304956 #22526] DEBUG -- : isProducer true
App 22526 stdout: D, [2016-04-12T14:14:50.305930 #22526] DEBUG -- : isGrocery isRestaurant true
App 22750 stdout: D, [2016-04-12T14:14:50.943158 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 373.5872ms
App 22750 stdout: D, [2016-04-12T14:14:51.240655 #22750] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 286.9210ms
App 22750 stdout: 
App 22750 stdout: I, [2016-04-12T14:14:51.252586 #22750]  INFO -- : Started GET "/" for 182.189.239.229 at 2016-04-12 14:14:51 +0000
App 22750 stdout: I, [2016-04-12T14:14:51.286053 #22750]  INFO -- : Processing by FoodNetworksController#index as HTML
App 22526 stdout: D, [2016-04-12T14:14:51.291262 #22526] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 342.0073ms
App 22750 stdout: D, [2016-04-12T14:14:51.307026 #22750] DEBUG -- : FOODNETWORK index HERE*******************
App 22750 stdout: D, [2016-04-12T14:14:51.307714 #22750] DEBUG -- : isProducer true
App 22750 stdout: D, [2016-04-12T14:14:51.308232 #22750] DEBUG -- : isGrocery isRestaurant true
App 22526 stdout: D, [2016-04-12T14:14:51.643763 #22526] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 345.0539ms
App 22526 stdout: D, [2016-04-12T14:14:51.735648 #22526] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=food_setting_types selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 89.0536ms
App 22526 stdout: D, [2016-04-12T14:14:51.826546 #22526] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=terrelocaldev command={:count=>"producers", :query=>{"firstName"=>//i}} runtime: 85.5566ms
App 22750 stdout: D, [2016-04-12T14:14:51.876829 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 330.1392ms
App 22526 stdout: D, [2016-04-12T14:14:52.188308 #22526] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={"firstName"=>//i} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 361.4294ms
App 22750 stdout: D, [2016-04-12T14:14:52.218087 #22750] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 338.6931ms
App 22526 stdout: I, [2016-04-12T14:14:52.304740 #22526]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (1982.3ms)
App 22750 stdout: D, [2016-04-12T14:14:52.307715 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=food_setting_types selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 83.8982ms
App 22750 stdout: D, [2016-04-12T14:14:52.395781 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=terrelocaldev command={:count=>"producers", :query=>{"firstName"=>//i}} runtime: 82.9812ms
App 22750 stdout: D, [2016-04-12T14:14:52.742380 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={"firstName"=>//i} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 346.1859ms
App 22750 stdout: I, [2016-04-12T14:14:52.854000 #22750]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (1542.3ms)
App 22492 stdout: "Exception Message : "
App 22492 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
App 22492 stdout: D, [2016-04-12T14:16:58.730103 #22492] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 97.7094ms
App 22492 stdout: D, [2016-04-12T14:16:58.852233 #22492] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 85.3055ms
App 22492 stdout: D, [2016-04-12T14:16:59.280202 #22492] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 424.4902ms
App 22492 stdout: I, [2016-04-12T14:16:59.310388 #22492]  INFO -- :   Rendered application/_head.html.erb (128172.0ms)
App 22492 stdout: I, [2016-04-12T14:16:59.314715 #22492]  INFO -- :   Rendered shared/_menu.html.erb (2.5ms)
App 22492 stdout: I, [2016-04-12T14:16:59.320365 #22492]  INFO -- :   Rendered shared/_map.html.erb (4.1ms)
App 22492 stdout: I, [2016-04-12T14:16:59.324840 #22492]  INFO -- :   Rendered application/_scripts.html.erb (1.5ms)
App 22492 stdout: I, [2016-04-12T14:16:59.325300 #22492]  INFO -- : Completed 200 OK in 130062ms (Views: 130055.3ms)
App 22526 stdout: "Exception Message : "
App 22526 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
App 22526 stdout: D, [2016-04-12T14:17:00.237611 #22526] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 325.9097ms
App 22526 stdout: I, [2016-04-12T14:17:00.265543 #22526]  INFO -- :   Rendered application/_head.html.erb (127675.1ms)
App 22526 stdout: I, [2016-04-12T14:17:00.268966 #22526]  INFO -- :   Rendered shared/_menu.html.erb (2.3ms)
App 22526 stdout: I, [2016-04-12T14:17:00.272398 #22526]  INFO -- :   Rendered shared/_map.html.erb (2.5ms)
App 22526 stdout: I, [2016-04-12T14:17:00.276179 #22526]  INFO -- :   Rendered application/_scripts.html.erb (1.4ms)
App 22526 stdout: I, [2016-04-12T14:17:00.276666 #22526]  INFO -- : Completed 200 OK in 130026ms (Views: 129968.7ms)
App 22750 stdout: "Exception Message : "
App 22750 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
App 22750 stdout: D, [2016-04-12T14:17:00.701007 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 277.1372ms
App 22750 stdout: I, [2016-04-12T14:17:00.729854 #22750]  INFO -- :   Rendered application/_head.html.erb (127621.3ms)
App 22750 stdout: I, [2016-04-12T14:17:00.733674 #22750]  INFO -- :   Rendered shared/_menu.html.erb (2.6ms)
App 22750 stdout: I, [2016-04-12T14:17:00.737158 #22750]  INFO -- :   Rendered shared/_map.html.erb (2.5ms)
App 22750 stdout: I, [2016-04-12T14:17:00.740967 #22750]  INFO -- :   Rendered application/_scripts.html.erb (1.5ms)
App 22750 stdout: I, [2016-04-12T14:17:00.741549 #22750]  INFO -- : Completed 200 OK in 129455ms (Views: 129432.6ms)
App 22750 stdout: I, [2016-04-12T14:19:44.559835 #22750]  INFO -- : Started GET "/" for 182.189.239.229 at 2016-04-12 14:19:44 +0000
App 22750 stdout: I, [2016-04-12T14:19:44.560933 #22750]  INFO -- : Processing by FoodNetworksController#index as HTML
App 22750 stdout: D, [2016-04-12T14:19:44.561771 #22750] DEBUG -- : FOODNETWORK index HERE*******************
App 22750 stdout: D, [2016-04-12T14:19:44.562114 #22750] DEBUG -- : isProducer true
App 22750 stdout: D, [2016-04-12T14:19:44.562281 #22750] DEBUG -- : isGrocery isRestaurant true
App 22750 stdout: D, [2016-04-12T14:19:44.668755 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=food_setting_types selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 102.2355ms
App 22750 stdout: D, [2016-04-12T14:19:44.771967 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=terrelocaldev command={:count=>"producers", :query=>{"firstName"=>//i}} runtime: 100.5101ms
App 22750 stdout: D, [2016-04-12T14:19:45.201187 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={"firstName"=>//i} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 428.7448ms
App 22750 stdout: I, [2016-04-12T14:19:45.403685 #22750]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (840.4ms)
App 22750 stdout: "Exception Message : "
App 22750 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
App 22750 stdout: D, [2016-04-12T14:21:52.732454 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 84.7536ms
App 22750 stdout: D, [2016-04-12T14:21:52.854199 #22750] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 84.4820ms
App 22750 stdout: D, [2016-04-12T14:21:53.221766 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 364.7676ms
App 22750 stdout: I, [2016-04-12T14:21:53.250386 #22750]  INFO -- :   Rendered application/_head.html.erb (127841.4ms)
App 22750 stdout: I, [2016-04-12T14:21:53.251372 #22750]  INFO -- :   Rendered shared/_menu.html.erb (0.7ms)
App 22750 stdout: I, [2016-04-12T14:21:53.252849 #22750]  INFO -- :   Rendered shared/_map.html.erb (1.1ms)
App 22750 stdout: I, [2016-04-12T14:21:53.253267 #22750]  INFO -- :   Rendered application/_scripts.html.erb (0.2ms)
App 22750 stdout: I, [2016-04-12T14:21:53.253712 #22750]  INFO -- : Completed 200 OK in 128693ms (Views: 128690.7ms)
App 22750 stdout: I, [2016-04-12T14:44:51.990723 #22750]  INFO -- : Started GET "/" for 182.189.239.229 at 2016-04-12 14:44:51 +0000
App 22750 stdout: I, [2016-04-12T14:44:51.991654 #22750]  INFO -- : Processing by FoodNetworksController#index as HTML
App 22750 stdout: D, [2016-04-12T14:44:51.992735 #22750] DEBUG -- : FOODNETWORK index HERE*******************
App 22750 stdout: D, [2016-04-12T14:44:51.993097 #22750] DEBUG -- : isProducer true
App 22750 stdout: D, [2016-04-12T14:44:51.993255 #22750] DEBUG -- : isGrocery isRestaurant true
App 22750 stdout: D, [2016-04-12T14:44:52.085335 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 87.4722ms
App 22750 stdout: D, [2016-04-12T14:44:52.232253 #22750] DEBUG -- :   MOPED: 54.159.101.113:63921 COMMAND      database=admin command={:ismaster=>1} runtime: 100.0688ms
App 22750 stdout: D, [2016-04-12T14:44:52.323932 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=food_setting_types selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 88.2927ms
App 22750 stdout: D, [2016-04-12T14:44:52.411967 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=terrelocaldev command={:count=>"producers", :query=>{"firstName"=>//i}} runtime: 84.8425ms
App 22750 stdout: D, [2016-04-12T14:44:52.780571 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={"firstName"=>//i} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 368.2703ms
App 22750 stdout: I, [2016-04-12T14:44:52.911185 #22750]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (917.0ms)
App 22750 stdout: "Exception Message : "
App 22750 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
App 22750 stdout: D, [2016-04-12T14:47:00.345506 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 241.9735ms
App 22750 stdout: I, [2016-04-12T14:47:00.371169 #22750]  INFO -- :   Rendered application/_head.html.erb (127442.9ms)
App 22750 stdout: I, [2016-04-12T14:47:00.372125 #22750]  INFO -- :   Rendered shared/_menu.html.erb (0.5ms)
App 22750 stdout: I, [2016-04-12T14:47:00.373617 #22750]  INFO -- :   Rendered shared/_map.html.erb (1.0ms)
App 22750 stdout: I, [2016-04-12T14:47:00.374029 #22750]  INFO -- :   Rendered application/_scripts.html.erb (0.1ms)
App 22750 stdout: I, [2016-04-12T14:47:00.374341 #22750]  INFO -- : Completed 200 OK in 128383ms (Views: 128380.7ms)
App 22750 stdout: I, [2016-04-12T14:47:12.390406 #22750]  INFO -- : Started GET "/" for 182.189.239.229 at 2016-04-12 14:47:12 +0000
App 22750 stdout: I, [2016-04-12T14:47:12.391440 #22750]  INFO -- : Processing by FoodNetworksController#index as HTML
App 22750 stdout: D, [2016-04-12T14:47:12.392165 #22750] DEBUG -- : FOODNETWORK index HERE*******************
App 22750 stdout: D, [2016-04-12T14:47:12.392449 #22750] DEBUG -- : isProducer true
App 22750 stdout: D, [2016-04-12T14:47:12.392607 #22750] DEBUG -- : isGrocery isRestaurant true
App 22750 stdout: D, [2016-04-12T14:47:12.469192 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=food_setting_types selector={} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 72.9276ms
App 22750 stdout: D, [2016-04-12T14:47:12.540702 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 COMMAND      database=terrelocaldev command={:count=>"producers", :query=>{"firstName"=>//i}} runtime: 69.1516ms
App 22750 stdout: D, [2016-04-12T14:47:12.841548 #22750] DEBUG -- :   MOPED: 107.22.146.128:63921 QUERY        database=terrelocaldev collection=producers selector={"firstName"=>//i} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 300.5080ms
App 22750 stdout: I, [2016-04-12T14:47:12.944601 #22750]  INFO -- :   Rendered food_networks/index.html.erb within layouts/map_layout (551.3ms)



-------------------------------------
/var/log/eb-activity.log
-------------------------------------
  ++ [[ ruby-2.3.0 == *\2\.\3\.\0* ]]
  ++ match=/opt/rubies/ruby-2.3.0
  ++ for dir in '"${RUBIES[@]}"'
  ++ dir=/opt/rubies/ruby-current
  ++ [[ ruby-current == *\2\.\3\.\0* ]]
  ++ [[ -z /opt/rubies/ruby-2.3.0 ]]
  ++ shift
  ++ chruby_use /opt/rubies/ruby-2.3.0 ''
  ++ [[ ! -x /opt/rubies/ruby-2.3.0/bin/ruby ]]
  ++ [[ -n '' ]]
  ++ export RUBY_ROOT=/opt/rubies/ruby-2.3.0
  ++ RUBY_ROOT=/opt/rubies/ruby-2.3.0
  ++ export RUBYOPT=
  ++ RUBYOPT=
  ++ export PATH=/opt/rubies/ruby-2.3.0/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
  ++ PATH=/opt/rubies/ruby-2.3.0/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
  +++ /opt/rubies/ruby-2.3.0/bin/ruby -
  ++ eval 'export RUBY_ENGINE=ruby;
  export RUBY_VERSION=2.3.0;
  export GEM_ROOT="/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0";'
  +++ export RUBY_ENGINE=ruby
  +++ RUBY_ENGINE=ruby
  +++ export RUBY_VERSION=2.3.0
  +++ RUBY_VERSION=2.3.0
  +++ export GEM_ROOT=/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0
  +++ GEM_ROOT=/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0
  ++ ((  0 != 0  ))
  + cd /var/app/ondeck
  + su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb db:migrate' webapp
  /var/app/ondeck/lib/tasks/bootstrap.rake:32: warning: key "Baked Products" is duplicated and overwritten on line 37
  /var/app/ondeck/lib/tasks/bootstrap.rake:12: warning: already initialized constant FOOD_CATEGORIES
  /var/app/ondeck/lib/tasks/bootstrap.rake:2: warning: previous definition of FOOD_CATEGORIES was here
  + '[' false = true ']'
  + su -s /bin/bash -c 'leader_only bundle exec rake db:migrate' webapp
  /var/app/ondeck/lib/tasks/bootstrap.rake:32: warning: key "Baked Products" is duplicated and overwritten on line 37
  /var/app/ondeck/lib/tasks/bootstrap.rake:12: warning: already initialized constant FOOD_CATEGORIES
  /var/app/ondeck/lib/tasks/bootstrap.rake:2: warning: previous definition of FOOD_CATEGORIES was here
[2016-04-12T14:09:47.038Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/AppDeployPreHook] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/pre.
[2016-04-12T14:09:47.038Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/EbExtensionPostBuild] : Starting activity...
[2016-04-12T14:09:47.494Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Starting activity...
[2016-04-12T14:09:47.494Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Completed activity.
[2016-04-12T14:09:47.527Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/EbExtensionPostBuild] : Completed activity.
[2016-04-12T14:09:47.527Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/InfraCleanEbextension] : Starting activity...
[2016-04-12T14:09:47.541Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0/InfraCleanEbextension] : Completed activity. Result:
  Cleaned ebextensions subdirectories from /var/app/ondeck.
[2016-04-12T14:09:47.541Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage0] : Completed activity. Result:
  Application update - Command CMD-AppDeploy stage 0 completed
[2016-04-12T14:09:47.542Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1] : Starting activity...
[2016-04-12T14:09:47.542Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook] : Starting activity...
[2016-04-12T14:09:47.543Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook/01_flip.sh] : Starting activity...
[2016-04-12T14:09:48.323Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook/01_flip.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
  + EB_APP_STAGING_DIR=/var/app/ondeck
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir
  + EB_APP_DEPLOY_DIR=/var/app/current
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=webapp
  + '[' -d /var/app/current ']'
  + mv /var/app/current /var/app/current.old
  + mv /var/app/ondeck /var/app/current
  + mkdir -p /var/app/current/tmp /var/app/current/public
  + nohup rm -rf /var/app/current.old
  + chown -R webapp:webapp /var/app/current/tmp /var/app/current/public
[2016-04-12T14:09:48.324Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Starting activity...
[2016-04-12T14:09:51.093Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Completed activity. Result:
  + service passenger restart
  =============== Phusion Passenger Standalone web server started ===============
  PID file: /var/app/support/pids/passenger.pid
  Log file: /var/app/support/logs/passenger.log
  Environment: production
  Accessible via: http://0.0.0.0/

  Serving in the background as a daemon.
  Problems? Check https://www.phusionpassenger.com/documentation/Users%20guide%20Standalone.html#troubleshooting
  ===============================================================================
[2016-04-12T14:09:51.093Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployEnactHook] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/enact.
[2016-04-12T14:09:51.093Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployPostHook] : Starting activity...
[2016-04-12T14:09:51.094Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployPostHook/01_create_pids.sh] : Starting activity...
[2016-04-12T14:09:51.478Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployPostHook/01_create_pids.sh] : Completed activity.
[2016-04-12T14:09:51.478Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1/AppDeployPostHook] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/post.
[2016-04-12T14:09:51.478Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AppDeployStage1] : Completed activity. Result:
  Application version switch - Command CMD-AppDeploy stage 1 completed
[2016-04-12T14:09:51.479Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter] : Starting activity...
[2016-04-12T14:09:51.479Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter/ConfigLogRotation] : Starting activity...
[2016-04-12T14:09:51.480Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter/ConfigLogRotation/10-config.sh] : Starting activity...
[2016-04-12T14:09:51.730Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter/ConfigLogRotation/10-config.sh] : Completed activity. Result:
  Disabled forced hourly log rotation.
[2016-04-12T14:09:51.730Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter/ConfigLogRotation] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/addons/logpublish/hooks/config.
[2016-04-12T14:09:51.730Z] INFO  [22088] - [Application update app-a616-160412_190725@3/AddonsAfter] : Completed activity.
[2016-04-12T14:09:51.730Z] INFO  [22088] - [Application update app-a616-160412_190725@3] : Completed activity. Result:
  Application update - Command CMD-AppDeploy succeeded
[2016-04-12T14:47:31.294Z] INFO  [21309] - [CMD-TailLogs] : Starting activity...
[2016-04-12T14:47:31.295Z] INFO  [21309] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2016-04-12T14:47:31.295Z] INFO  [21309] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2016-04-12T14:47:31.295Z] INFO  [21309] - [CMD-TailLogs/TailLogs] : Starting activity...
[2016-04-12T14:47:31.295Z] INFO  [21309] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...

Any Kind of Help will be regarded.

AWS Instance Dashboard :

enter image description here


Solution

  • The error you are getting is giving you the information you need to resolve this issue.

    App 22750 stdout: "Failed to open TCP connection to freegeoip.net:80 (Network is unreachable - connect(2) for \"freegeoip.net\" port 80)"
    

    This is telling you that your application is not able to make a TCP connection to freegeoip.net:80 because the network is unreachable. This is telling us that the server at freegeoip.net is not responding to our requests. If we go and check www.freegeoip.net or just freegeoip.net we see that the service is indeed down and we're only being served a CloudFlare page.

    How to solve this? First update your gem. There was a new release of Geocoder gem a few weeks ago with many improvements. From your command line run bundle update geocoder and it will update your gem to the latest version.

    Secondly, change to ipinfo_io as the service as suggested in another answer. You do this by editting your Geocoder.rb file which is in your config/initializers directory to look something like this:

    Geocoder.configure(
      # Geocoding options
      timeout: 3,               # geocoding service timeout (secs)
      lookup: :ipinfo_io,           # name of geocoding service (symbol)
      ip_lookup: :ipinfo_io,           # name of geocoding service (symbol)
      # language: :en,              # ISO-639 language code
      use_https: true,           # use HTTPS for lookup requests? (if supported)
      # http_proxy: nil,            # HTTP proxy server (user:pass@host:port)
      # https_proxy: nil,           # HTTPS proxy server (user:pass@host:port)
      # api_key: "nil",    # API key for geocoding service
      # cache: nil,                 # cache object (must respond to #[], #[]=, and #keys)
      # cache_prefix: 'geocoder:',  # prefix (string) to use for all cache keys
    
      # Exceptions that should not be rescued by default
      # (if you want to implement custom error handling);
      # supports SocketError and TimeoutError
      # always_raise: [],
    
      # Calculation options
      # units: :mi,                 # :km for kilometers or :mi for miles
      # distances: :linear          # :spherical or :linear
    )
    

    You may also need to set your security groups and iptables to allow your server to initiate an outbound connection and then allow the response traffic back in. For the security groups, allow port 80 outbound as well as inbound. EDIT Because we are using HTTPS for :ipinfo_io we also need to add 443 for inbound and outbound.

    Now that you have opened your security group, the nat instance or gateway or instance iptables might not be allowing the responses to the outbound traffic back in. ssh to the instance or to the NAT server and execute the following command to allow traffic from connections that the session was established by your server:

    sudo iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
    

    Hope that helps.