# Missing pid - Bad Gateway - after restart

**URL:** <https://www.ruby-forum.com/t/missing-pid-bad-gateway-after-restart/124459>\
**Category:** Radiant CMS\
**Created:** [December 28, 2007, 10:11pm UTC](https://www.ruby-forum.com/t/missing-pid-bad-gateway-after-restart/124459 "2007-12-28T22:11:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/u/Johan_Bichel_Lindeg)\
**Post date:** [December 28, 2007, 10:11pm UTC](https://www.ruby-forum.com/t/missing-pid-bad-gateway-after-restart/124459/1 "2007-12-28T22:11:34Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/u/Johan_Bichel_Lindeg)\
**Post date:** [February 9, 2008, 3:05am UTC](https://www.ruby-forum.com/t/missing-pid-bad-gateway-after-restart/124459/2 "2008-02-09T03:05:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@Johan\_Bichel\_Lindeg](https://www.ruby-forum.com/u/Johan_Bichel_Lindeg)\
**Post date:** [February 11, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/missing-pid-bad-gateway-after-restart/124459/3 "2008-02-11T20:52:51Z")

</div>

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.
