[Mongrel] Mongrel loading wrong database environment (& a couple other bugs?)

Zed Shaw zedshaw at zedshaw.com
Mon Aug 14 20:18:27 EDT 2006

On Mon, 2006-08-14 at 14:33 -0700, John Clayton wrote:
> Hi There,
> I've got a mongrel cluster running on redhat 9 proxied behind an  
> Apache 2.2 installation.  I have run into a real stumbling block in  
> that, while the rails app runs in production mode (you get a  
> production.log file, for example, and I see this in the mongrel log:  
> ** Starting Rails with production environment ... ), it always loads  
> the development database configuration no matter what. I can re- 
> config the file, move things around, with no effect.  Has anyone else  
> noticed this?

Not sure what Mongrel would do to cause this, and since many other
people are running in production with Mongrel you should double check
your database.yml config and your database config.  Best thing to do is
remove *everything* from database.yml except your production setup, and
remove all databases except your production database.  But, uh don't do
this on real production, do it some test environment.

If you do this then you'll quickly find out why it's wrong and can go
fix your configuration.

> 1. When specifying a pid file that's not in the default, you can  
> start up mongrel fine and it writes the pid(s, this is clustered) to  
> the correct location, say /tmp/mongrel.*.pid, but the stop command  
> always tries to find the pid in /path/to/docroot/log/tmp/ 
> mongrel.*.pid, basically appending the absolute path to the default  
> location.
This is fixed in the pre-release.  If you have a chance, double
confirm it by installing the pre-release on your development or staging

  gem install mongrel --source=http://mongrel.rubyforge.org/releases/

> This is handy if you want to move symlinks around and still have the  
> ctl script find the pids.
> 2. the -r (--root) option and the :docroot yml pair don't seem to  
> have any effect whatsoever.

Can you describe this a bit better?  Also tell me if you see this stil
with the pre-release.

Oh, one more thing, also make sure that your setup runs in production
*without* mongrel_cluster and with webrick.  If it works in plain
mongrel then it might be a mongrel_cluster bug.  If it works with
webrick then it might be a mongrel bug.

Zed A. Shaw
http://www.railsmachine.com/ -- Need Mongrel support?

More information about the Mongrel-users mailing list