Why would ActiveRecord connect to Postgres as root?

My databases.yml makes no mention of root and in my dev environment
everything works fine, however following a deployment with Capistrano
about an hour ago, I get the following error:

PGError in HomeController#index

FATAL: role “root” does not exist

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/postgresql_adapter.rb:713:in connect' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/postgresql_adapter.rb:713:inconnect’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/postgresql_adapter.rb:237:in initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/postgresql_adapter.rb:23:innew’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/postgresql_adapter.rb:23:in
postgresql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:291:insend’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract/connection_specification.rb:291:in
connection=' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:259:inretrieve_connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract/connection_specification.rb:78:in
connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:incache’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
caching.rb:677:in perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:524:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:524:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ filters.rb:685:inprocess_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
session_management.rb:123:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:388:inprocess’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:171:in handle_request' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:115:indispatch’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:126:in dispatch_cgi' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:9:indispatch’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb:76:in
process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb:74:insynchronize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb:74:in
process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:159:inprocess_client’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:158:in each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:158:inprocess_client’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:ininitialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:innew’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/configurator.rb: 282:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/configurator.rb:
281:in each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/configurator.rb: 281:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:128:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/command.rb: 212:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load’
/usr/bin/mongrel_rails:19

The site’s been working fine for weeks, but now it’s down, just as I
was starting to build up users … typical :slight_smile:

-S

Check your database.yml file again, and again.

It does not spontaneously choose one day to go root.

On Tue, Mar 4, 2008 at 11:45 AM, Stuart G.
[email protected]
wrote:

connection_adapters/postgresql_adapter.rb:713:in connect' connection_adapters/abstract/connection_specification.rb:291:in send’
query_cache.rb:8:in cache' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in
281:in `each’
The site’s been working fine for weeks, but now it’s down, just as I
was starting to build up users … typical :slight_smile:

-S


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

On Mar 4, 1:50 am, “Ryan B. (Radar)” [email protected]
wrote:

Check your database.yml file again, and again.

It does not spontaneously choose one day to go root.

You would think that wouldn’t you Ryan … with the passwords removed,
database.yml is reproduced below, in full …

SQLite version 3.x

gem install sqlite3-ruby (not necessary on OS X Leopard)

development:
adapter: postgresql
database: footytechs-dev
user: footytechs
password: password
host: localhost

Warning: The database defined as ‘test’ will be erased and

re-generated from your development database when you run ‘rake’.

Do not set this db to the same as development or production.

test:
adapter: postgresql
database: footytechs-test
user: footytechs
password: password
host: localhost

production:
adapter: postgresql
database: footytechs-prod
user: footytechs
password: password
host: localhost