Missing pid - Bad Gateway - after restart

After trying to restart radiant on my (mt) (gs) server with ‘mtr restart
radiant’ i get a 502 bad gateway error when accessing from http, and in
response to the command i get the following error:

Error executing command:
application started, but pid file was not found, check ‘mtr status’

‘mtr status’ returns:

applications:
radiant:
status: stopped
memory:
free: 65024
total: 65536
used: 512

Last time this happened i reinstalled my whole site. But there must be a
way
to restart my radiant without having to do that.

On http://kb.mediatemple.net/article.php?id=140 it is suggested to do
the
following when this error appears.

gem install rails -y
gem install mongrel --source=http://gems.mediatemple.net

I tried this too but i still get the same errors, also after trying to
do
‘mtr start radiant’ again. And even if this would solve the problem
there
must be a way not to have to do this each time i restart.
Thanks, Johan

Well, I get ‘502 bad gateway error when accessing from http’ generally
when I removed and then add a rails application to the gridserver. So
try and do a '$ mtr generate_htaccess '.

Also I was recently getting the ‘application started, but pid file was
not found, …’ error. First I decided to reinstall the whole
app…stupid choice. All I had to do was check the log/mongrel.log to
see that I forgot to install the needed plugins for the rails app. So
take a gander at your mongrel log, the answer might be in there.

Johan Bichel Lindegaard wrote:

After trying to restart radiant on my (mt) (gs) server with ‘mtr restart
radiant’ i get a 502 bad gateway error when accessing from http

This happened to me when I killed my app files and uploaded new files
without stopping the rails process on the server first. Basically the
server was looking for the old PID since the service was not stopped
before swapping the files.

I’ve also seen this when my config/environment.rb file was set for Rails
1.2.6 when Rails 1.2.5 was the latest version installed on the server.
This was solved by setting the following line:

RAILS_GEM_VERSION = ‘1.2.5’ unless defined? RAILS_GEM_VERSION

So in addition to checking log/mongrel.log, check log/production.log as
well.