Old Rails app: strange problem with getaddrinfo


#1

Hi all

I’m trying to get an old Rails App (RAILS_GEM_VERSION = ‘1.1.6’) to work
again;

Strangely I get the following error on most pages, and I don’t have any
idea where it could come from:

SocketError in Startseite#index

Showing app/views/partials/_menu.rhtml where line #6 raised:

getaddrinfo: nodename nor servname provided, or not known

Extracted source (around line #6):

3: unikat_subitems = []
4:
5: shop_subitems = []
6: produkt_typen_for_produkt(‘MassenArtikel’).each do |id|
7: produkt_typ = ProduktTyp.find_by_id(id)
8: shop_subitems << {:caption => produkt_typ.name, :action =>
:produkt_typ, :id => produkt_typ}
9: end

Trace of template inclusion: /app/views/layouts/public.rhtml

RAILS_ROOT: script/…/config/…
Application Trace | Framework Trace | Full Trace

vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
initialize' vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:innew’
vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
real_connect' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:389:inconnect’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:152:in
initialize' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:innew’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in
mysql_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:insend’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in
connection_without_query_cache=' vendor/rails/activerecord/lib/active_record/query_cache.rb:54:inconnection=’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in
retrieve_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:inconnection’
app/helpers/application_helper.rb:11:in produkt_typen_for_produkt' #{RAILS_ROOT}/app/views/partials/_menu.rhtml:6:in_run_rhtml_47app47views47partials47_menu46rhtml’
#{RAILS_ROOT}/app/views/layouts/public.rhtml:16:in
`_run_rhtml_47app47views47layouts47public46rhtml’

vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
initialize' vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:innew’
vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
real_connect' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:389:inconnect’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:152:in
initialize' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:innew’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in
mysql_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:insend’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in
connection_without_query_cache=' vendor/rails/activerecord/lib/active_record/query_cache.rb:54:inconnection=’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in
retrieve_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:inconnection’
vendor/rails/actionpack/lib/action_view/base.rb:326:in send' vendor/rails/actionpack/lib/action_view/base.rb:326:incompile_and_render_template’
vendor/rails/actionpack/lib/action_view/base.rb:301:in render_template' vendor/rails/actionpack/lib/action_view/base.rb:260:inrender_file’
vendor/rails/actionpack/lib/action_view/base.rb:275:in render' vendor/rails/actionpack/lib/action_view/partials.rb:59:inrender_partial’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in
benchmark' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:307:in
realtime' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:inbenchmark’
vendor/rails/actionpack/lib/action_view/partials.rb:58:in
render_partial' vendor/rails/actionpack/lib/action_view/base.rb:287:inrender’
vendor/rails/actionpack/lib/action_view/base.rb:326:in send' vendor/rails/actionpack/lib/action_view/base.rb:326:incompile_and_render_template’
vendor/rails/actionpack/lib/action_view/base.rb:301:in render_template' vendor/rails/actionpack/lib/action_view/base.rb:260:inrender_file’
vendor/rails/actionpack/lib/action_controller/layout.rb:254:in
render_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:inrender’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:in
measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:inrender’
vendor/rails/actionpack/lib/action_controller/base.rb:1096:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:632:incall_filter’
vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:438:incall’
vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:638:incall_filter’
vendor/rails/actionpack/lib/action_controller/filters.rb:438:in call' vendor/rails/actionpack/lib/action_controller/filters.rb:637:incall_filter’
vendor/rails/actionpack/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:in
measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:430:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:430:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:624:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
process' vendor/rails/actionpack/lib/action_controller/base.rb:330:inprocess’
vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:inprocess’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in
synchronize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:inprocess’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in
process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:ineach’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:innew’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:ininitialize’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:ineach’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281 vendor/rails/activesupport/lib/active_support/dependencies.rb:488:inload’
vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
load' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
load' vendor/rails/railties/lib/commands/servers/mongrel.rb:60 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:495:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:495:inrequire’
vendor/rails/railties/lib/commands/server.rb:39
script/server:3:in `require’
script/server:3

vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
initialize' vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:innew’
vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:111:in
real_connect' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:389:inconnect’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:152:in
initialize' vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:innew’
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in
mysql_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:insend’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in
connection_without_query_cache=' vendor/rails/activerecord/lib/active_record/query_cache.rb:54:inconnection=’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in
retrieve_connection' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:inconnection’
app/helpers/application_helper.rb:11:in produkt_typen_for_produkt' #{RAILS_ROOT}/app/views/partials/_menu.rhtml:6:in_run_rhtml_47app47views47partials47_menu46rhtml’
vendor/rails/actionpack/lib/action_view/base.rb:326:in send' vendor/rails/actionpack/lib/action_view/base.rb:326:incompile_and_render_template’
vendor/rails/actionpack/lib/action_view/base.rb:301:in render_template' vendor/rails/actionpack/lib/action_view/base.rb:260:inrender_file’
vendor/rails/actionpack/lib/action_view/base.rb:275:in render' vendor/rails/actionpack/lib/action_view/partials.rb:59:inrender_partial’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in
benchmark' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:307:in
realtime' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:inbenchmark’
vendor/rails/actionpack/lib/action_view/partials.rb:58:in
render_partial' vendor/rails/actionpack/lib/action_view/base.rb:287:inrender’
#{RAILS_ROOT}/app/views/layouts/public.rhtml:16:in
_run_rhtml_47app47views47layouts47public46rhtml' vendor/rails/actionpack/lib/action_view/base.rb:326:insend’
vendor/rails/actionpack/lib/action_view/base.rb:326:in
compile_and_render_template' vendor/rails/actionpack/lib/action_view/base.rb:301:inrender_template’
vendor/rails/actionpack/lib/action_view/base.rb:260:in render_file' vendor/rails/actionpack/lib/action_controller/layout.rb:254:inrender_without_benchmark’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render' vendor/rails/actionpack/lib/action_controller/base.rb:1096:inperform_action_without_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:632:in
call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:638:incall_filter’
vendor/rails/actionpack/lib/action_controller/filters.rb:438:in call' vendor/rails/actionpack/lib/action_controller/filters.rb:637:incall_filter’
vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:438:incall’
vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:619:inperform_action_without_benchmark’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' vendor/rails/actionpack/lib/action_controller/rescue.rb:83:inperform_action’
vendor/rails/actionpack/lib/action_controller/base.rb:430:in send' vendor/rails/actionpack/lib/action_controller/base.rb:430:inprocess_without_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:624:in
process_without_session_management_support' vendor/rails/actionpack/lib/action_controller/session_management.rb:114:inprocess’
vendor/rails/actionpack/lib/action_controller/base.rb:330:in process' vendor/rails/railties/lib/dispatcher.rb:41:indispatch’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in
process' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:insynchronize’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in
process' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:inprocess_client’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
each' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:inprocess_client’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:ininitialize’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:innew’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in
each' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
load' vendor/rails/activesupport/lib/active_support/dependencies.rb:488:inload’
vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:488:inload’
vendor/rails/railties/lib/commands/servers/mongrel.rb:60
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
require' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
require' vendor/rails/railties/lib/commands/server.rb:39 script/server:3:inrequire’
script/server:3

Request

Parameters: None

Show session dump


:positions: []

:bestell_positionen: []

flash: !map:ActionController::Flash::FlashHash {}

Response
Headers: {“Status”=>“200 OK”, “cookie”=>[], “Cache-Control”=>“no-cache”}

Anyone has an idea?


#2

On 28 Oct 2008, at 14:43, Joshua M. wrote:

SocketError in Startseite#index

It can’t connect to the database.

Fred


#3

Frederick C. wrote:

On 28 Oct 2008, at 14:43, Joshua M. wrote:

SocketError in Startseite#index

It can’t connect to the database.

Fred

Yes, that seems to be the problem. But I double-checked my parameters
(which work for another, though newer RoR app), and it still gives the
same error.

My db params are:

development:
adapter: mysql
database: bergschmuck_development
username: XXX
password:
socket: /tmp/mysql.sock


#4

Ah I had the RAILS_ENV=production set in environment.rb, THAT was the
problem… Another few hours wasted for nearly nothing lol. :wink: