开发者

internal_error.html with rails 3 app on DreamHost

开发者 https://www.devze.com 2023-03-30 01:41 出处:网络
I have a rails 3 app on DreamHost. Randomly I get an error like the following. Started GET \"/internal_error.html\" for ...

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


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...


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消