John Clayton
2006-Aug-14 21:33 UTC
[Mongrel] Mongrel loading wrong database environment (& a couple other bugs?)
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? I''m starting up mongrel using the mongrel_cluster_ctl script from /et/ init.d/mongrel_cluster as suggested in the docs. You can see my config file below. I''ve also noticed a couple other issues. 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 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. Thanks for any help you can offer, John Clayton My mongrel versions: mongrel (0.3.13.3) A small fast HTTP library and server that runs Rails, Camping, and Nitro apps. mongrel_cluster (0.2.0) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. My config file: --- user: mongrel cwd: /var/www/example.com/app/current/ port: "8000" environment: production debug: false group: instrument address: 127.0.0.1 pid_file: log/mongrel.pid servers: 3
Zed Shaw
2006-Aug-15 00:18 UTC
[Mongrel] Mongrel loading wrong database environment (& a couple other bugs?)
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 0.3.13.4 pre-release. If you have a chance, double confirm it by installing the pre-release on your development or staging system: 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.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?