Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

internal_error.html with rails 3 app on DreamHost

I have a rails 3 app on DreamHost. Randomly I get an error like the following.

Started GET "/internal_error.html" for ...

ActionController::RoutingError (No route matches "/internal_error.html"):

I created a sample page. It just posts data and the controller just redirects it without processing the data. The error happens while redirecting.(randomly 1 out of 10 times)

I contacted DreamHost support and they said that it's not triggered by the server but the application. I think the application is too simple to cause errors. I suspect it's the passenger that causes the error.

Does anybody have any idea about this error?

Thanks.

Sam

like image 621
Sam Kong Avatar asked Aug 20 '11 18:08

Sam Kong


2 Answers

This does seem to be a problem with dreamhost specifically. I get the error when calling redirect_to in an update action, just like the poster in this thread on the dreamhost forums:

http://discussion.dreamhost.com/archive/index.php/thread-130022.html

In my case, however, the data is being updated before the internal error. So the recommendation of adding sleep 0.5 before the redirection fixed the problem for me. Not sure if it will work in your case, though, since I have no idea what is causing the problem in the first place...

like image 192
twangus Avatar answered Nov 09 '22 10:11

twangus


I found a workaround.

I created a controller and an action. /internal_error/index

def index
  render :layout => false
end

[index.html.erb]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<head>
    <META HTTP-EQUIV="refresh" CONTENT="0">
</head>
<html>
<title>Redirect</title>
<body>
</body>
</html>

It works for me.

like image 34
Sam Kong Avatar answered Nov 09 '22 09:11

Sam Kong