Thin很少引发丢失的模板异常

时间:2012-02-18 01:13:37

标签: ruby-on-rails nginx production thin

在我的prod服务器上,我有时会收到Missing template个例外。

设置是使用CentOS5,ruby 1.9.2,Rails 3.2.1,8个nginx实例,6个瘦实例的VPN

所以,这有两个主要观点,很少发生,约。每1000个请求1次,但它是

据我所知,瘦接收请求只是处理真正的异常,但我无法理解为什么,因为1000其他请求中的999是好的,它们一定没问题。

这是文件系统问题吗?还是来自机器人的语言环境?

异常示例在这里:

From: Exception Notifier <myhost>


Subject: [myhost Exception] controllername#actionname (ActionView::MissingTemplate) "Missing
 template controllername/actionname, application/actionname with {:locale=>[...
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Gm-Message-State: ALoCoQn4St5gK1z...

A ActionView::MissingTemplate occurred in controllername#actionname:

  Missing template controllername/actionname, application/actionname with {:locale=3D>[:en], :fo=
rmats=3D>[:html], :handlers=3D>[:erb, :builder, :coffee, :haml]}. Searche=
d in:
  * "/..mypath../releases/20120205001108/app/views"

  actionpack (3.2.1) lib/action_view/path_set.rb:58:in `find'

-------------------------------
Request:
-------------------------------

  * URL       : http://myhost/actionurl
  * IP address: 74.208.8.48
  * Parameters: {"utf8"=3D>"=E2=9C=93", "authenticity_token"=3D>"Ffkm6Bd8=
wi3+Got7uTeLhzj86hJNDpFYRjG4Yrqx4yQ=3D", "video_link"=3D>"", "controller"=
=3D>"controllername", "action"=3D>"actionname"}
  * Rails root: /..mypath../releases/20120205001108

-------------------------------
Session:
-------------------------------

  * session id: "0c7c55faac70eb0632139de299ccdc9a"
  * data: {"session_id"=3D>"0c7c55faac70eb0632139de299ccdc9a",
   "_csrf_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhzj86hJNDpFYRjG4Yrqx4yQ=3D"}

-------------------------------
Environment:
-------------------------------

  * CONTENT_LENGTH                                 : 94
  * CONTENT_TYPE                                   : application/x-www-fo=
rm-urlencoded
  * GATEWAY_INTERFACE                              : CGI/1.2
  * HTTP_ACCEPT                                    : image/gif, image/x-x=
bitmap, image/jpeg, image/pjpeg, */*
  * HTTP_ACCEPT_ENCODING                           : gzip, deflate
  * HTTP_ACCEPT_LANGUAGE                           : en-us
  * HTTP_CONNECTION                                : close
  * HTTP_COOKIE                                    : _myhost_session=3DBA=
h7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTBjN2M1NWZhYWM3MGViMDYzMjEzOWRlMjk5Y2NkYzl=
hBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUZma202QmQ4d2kzK0dvdDd1VGVMaHpqODZoSk5E=
cEZZUmpHNFlycXg0eVE9BjsARg%3D%3D--7766b6f664ae053b5682f046ad3531e5a41bcdf=
d
  * HTTP_HOST                                      : myhost
  * HTTP_MAX_FORWARDS                              : 10
  * HTTP_PRAGMA                                    : no-cache
  * HTTP_REFERER                                   : http://myhost/
  * HTTP_USER_AGENT                                : Mozilla/4.0 (compati=
ble; MSIE 6.0; Windows NT 5.1)
  * HTTP_VERSION                                   : HTTP/1.0
  * HTTP_X_FORWARDED_FOR                           : 74.208.8.48
  * HTTP_X_REAL_IP                                 : 74.208.8.48
  * ORIGINAL_FULLPATH                              : /actionurl
  * PATH_INFO                                      : /actionurl
  * QUERY_STRING                                   : =

  * REMOTE_ADDR                                    : 127.0.0.1
  * REQUEST_METHOD                                 : POST
  * REQUEST_PATH                                   : /actionurl
  * REQUEST_URI                                    : /actionurl
  * SCRIPT_NAME                                    : =

  * SERVER_NAME                                    : myhost
  * SERVER_PORT                                    : 80
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : thin 1.3.1 codename =
Triple Espresso
  * action_controller.instance                     : controllername#actionname
  * action_dispatch.backtrace_cleaner              : #<Rails::BacktraceCl=
eaner:0xab76b14>
  * action_dispatch.cookies                        : #<ActionDispatch::Co=
okies::CookieJar:0xcaedac4>
  * action_dispatch.logger                         : #<ActiveSupport::Tag=
gedLogging:0xadb7874>
  * action_dispatch.parameter_filter               : [:password, /RAW_POS=
T_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DAT=
A/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /=
RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_P=
OST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/, /RAW_POST_DATA/]
  * action_dispatch.remote_ip                      : 74.208.8.48
  * action_dispatch.request.content_type           : application/x-www-fo=
rm-urlencoded
  * action_dispatch.request.formats                : [text/html]
  * action_dispatch.request.parameters             : {"utf8"=3D>"=E2=9C=93=
", "authenticity_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhzj86hJNDpFYRjG4Yrqx4yQ=3D=
", "someparam"=3D>"", "controller"=3D>"controllername", "action"=3D>"actionname"}
  * action_dispatch.request.path_parameters        : {:controller=3D>"controllername", :action=3D>"actionname"}
  * action_dispatch.request.query_parameters       : {}
  * action_dispatch.request.request_parameters     : {"utf8"=3D>"=E2=9C=93=
", "authenticity_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhzj86hJNDpFYRjG4Yrqx4yQ=3D=
", "video_link"=3D>""}
  * action_dispatch.request.unsigned_session_cookie: {"session_id"=3D>"0c=
7c55faac70eb0632139de299ccdc9a", "_csrf_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhz=
j86hJNDpFYRjG4Yrqx4yQ=3D"}
  * action_dispatch.request_id                     : 3e96f7bca9fc30f3e4eb=
1d91e61a63c0
  * action_dispatch.routes                         : #<ActionDispatch::Ro=
uting::RouteSet:0xb0b029c>
  * action_dispatch.secret_token                   : 20b9fbcf1214f8f88d5e=
549c61892c2558dffbe59db6c9dda63c84554af6d628248f3fd5217eb12e47df41260789a=
e59ad359b67e2309e5832390244777d56a7
  * action_dispatch.show_detailed_exceptions       : false
  * action_dispatch.show_exceptions                : true
  * async.callback                                 : #<Method: Thin::Unix=
Connection(Thin::Connection)#post_process>
  * async.close                                    : #<EventMachine::Defa=
ultDeferrable:0xcacf7a4>
  * exception_notifier.options                     : {:sender_address=3D>=
"\"myhost Exception Notifier\" <exception@email>", :exception_recipients=3D>=
["exception@email"], :email_prefix=3D>"[myhost Exception] ", :sections=3D>["=
request", "session", "environment", "backtrace"], :ignore_exceptions=3D>[=
ActiveRecord::RecordNotFound, AbstractController::ActionNotFound, ActionC=
ontroller::RoutingError]}
  * rack-cache.allow_reload                        : false
  * rack-cache.allow_revalidate                    : false
  * rack-cache.cache_key                           : Rack::Cache::Key
  * rack-cache.default_ttl                         : 0
  * rack-cache.entitystore                         : rails:/
  * rack-cache.metastore                           : rails:/
  * rack-cache.private_headers                     : ["Authorization", "C=
ookie"]
  * rack-cache.storage                             : #<Rack::Cache::Stora=
ge:0xc2b79b8>
  * rack-cache.use_native_ttl                      : false
  * rack-cache.verbose                             : true
  * rack.errors                                    : #<IO:0x99b5b50>
  * rack.input                                     : #<StringIO:0xcaa0bac=
>
  * rack.multiprocess                              : false
  * rack.multithread                               : false
  * rack.request.cookie_hash                       : {"_myhost_session"=3D=
>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTBjN2M1NWZhYWM3MGViMDYzMjEzOWRlMjk5Y2N=
kYzlhBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUZma202QmQ4d2kzK0dvdDd1VGVMaHpqODZo=
Sk5EcEZZUmpHNFlycXg0eVE9BjsARg=3D=3D--7766b6f664ae053b5682f046ad3531e5a41=
bcdfd"}
  * rack.request.cookie_string                     : _myhost_session=3DBA=
h7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTBjN2M1NWZhYWM3MGViMDYzMjEzOWRlMjk5Y2NkYzl=
hBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUZma202QmQ4d2kzK0dvdDd1VGVMaHpqODZoSk5E=
cEZZUmpHNFlycXg0eVE9BjsARg%3D%3D--7766b6f664ae053b5682f046ad3531e5a41bcdf=
d
  * rack.request.form_hash                         : {"utf8"=3D>"=E2=9C=93=
", "authenticity_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhzj86hJNDpFYRjG4Yrqx4yQ=3D=
", "someparam"=3D>""}
  * rack.request.form_input                        : #<StringIO:0xcaa0bac=
>
  * rack.request.form_vars                         : utf8=3D%E2%9C%93&aut=
henticity_token=3DFfkm6Bd8wi3%2BGot7uTeLhzj86hJNDpFYRjG4Yrqx4yQ%3D&video_=
link=3D
  * rack.request.query_hash                        : {}
  * rack.request.query_string                      : =

  * rack.run_once                                  : false
  * rack.session                                   : {"session_id"=3D>"0c=
7c55faac70eb0632139de299ccdc9a", "_csrf_token"=3D>"Ffkm6Bd8wi3+Got7uTeLhz=
j86hJNDpFYRjG4Yrqx4yQ=3D"}
  * rack.session.options                           : {:path=3D>"/", :doma=
in=3D>nil, :expire_after=3D>nil, :secure=3D>false, :httponly=3D>true, :de=
fer=3D>false, :renew=3D>false, :coder=3D>#<Rack::Session::Cookie::Base64:=
:Marshal:0xc26f410>, :id=3D>"0c7c55faac70eb0632139de299ccdc9a"}
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 0]
  =

  * Process: 13504
  * Server : myserver

-------------------------------
Backtrace:
-------------------------------

  actionpack (3.2.1) lib/action_view/path_set.rb:58:in `find'
  actionpack (3.2.1) lib/action_view/lookup_context.rb:109:in `find'
  actionpack (3.2.1) lib/action_view/renderer/abstract_renderer.rb:3:in `=
find_template'
  actionpack (3.2.1) lib/action_view/renderer/template_renderer.rb:28:in =
`determine_template'
  actionpack (3.2.1) lib/action_view/renderer/template_renderer.rb:10:in =
`render'
  actionpack (3.2.1) lib/action_view/renderer/renderer.rb:36:in `render_t=
emplate'
  actionpack (3.2.1) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.1) lib/abstract_controller/rendering.rb:109:in `_render=
_template'
  actionpack (3.2.1) lib/action_controller/metal/streaming.rb:225:in `_re=
nder_template'
  actionpack (3.2.1) lib/abstract_controller/rendering.rb:103:in `render_=
to_body'
  actionpack (3.2.1) lib/action_controller/metal/renderers.rb:28:in `rend=
er_to_body'
  actionpack (3.2.1) lib/action_controller/metal/compatibility.rb:50:in `=
render_to_body'
  actionpack (3.2.1) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.1) lib/action_controller/metal/rendering.rb:16:in `rend=
er'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:40:in=
 `block (2 levels) in render'
  activesupport (3.2.1) lib/active_support/core_ext/benchmark.rb:5:in `bl=
ock in ms'
  /usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
  activesupport (3.2.1) lib/active_support/core_ext/benchmark.rb:5:in `ms=
'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:40:in=
 `block in render'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:83:in=
 `cleanup_view_runtime'
  activerecord (3.2.1) lib/active_record/railties/controller_runtime.rb:2=
4:in `cleanup_view_runtime'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:39:in=
 `render'
  actionpack (3.2.1) lib/action_controller/metal/implicit_render.rb:10:in=
 `default_render'
  actionpack (3.2.1) lib/action_controller/metal/implicit_render.rb:5:in =
`send_action'
  actionpack (3.2.1) lib/abstract_controller/base.rb:167:in `process_acti=
on'
  actionpack (3.2.1) lib/action_controller/metal/rendering.rb:10:in `proc=
ess_action'
  actionpack (3.2.1) lib/abstract_controller/callbacks.rb:18:in `block in=
 process_action'
  activesupport (3.2.1) lib/active_support/callbacks.rb:414:in `_run__858=
933213__process_action__417312363__callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_cal=
lback'
  activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_proc=
ess_action_callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callba=
cks'
  actionpack (3.2.1) lib/abstract_controller/callbacks.rb:17:in `process_=
action'
  actionpack (3.2.1) lib/action_controller/metal/rescue.rb:29:in `process=
_action'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:30:in=
 `block in process_action'
  activesupport (3.2.1) lib/active_support/notifications.rb:123:in `block=
 in instrument'
  activesupport (3.2.1) lib/active_support/notifications/instrumenter.rb:=
20:in `instrument'
  activesupport (3.2.1) lib/active_support/notifications.rb:123:in `instr=
ument'
  actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:29:in=
 `process_action'
  actionpack (3.2.1) lib/action_controller/metal/params_wrapper.rb:205:in=
 `process_action'
  activerecord (3.2.1) lib/active_record/railties/controller_runtime.rb:1=
8:in `process_action'
  newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_=
controller.rb:34:in `block in process_action'
  newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_ins=
trumentation.rb:255:in `block in perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:242:in `trace=
_execution_scoped'
  newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_ins=
trumentation.rb:250:in `perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_=
controller.rb:33:in `process_action'
  actionpack (3.2.1) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.1) lib/abstract_controller/rendering.rb:45:in `process'=

  actionpack (3.2.1) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.1) lib/action_controller/metal/rack_delegation.rb:14:in=
 `dispatch'
  actionpack (3.2.1) lib/action_controller/metal.rb:246:in `block in acti=
on'
  actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:66:in `call=
'
  actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:66:in `disp=
atch'
  actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:30:in `call=
'
  journey (1.0.1) lib/journey/router.rb:68:in `block in call'
  journey (1.0.1) lib/journey/router.rb:56:in `each'
  journey (1.0.1) lib/journey/router.rb:56:in `call'
  actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:589:in `cal=
l'
  newrelic_rpm (3.3.1) lib/new_relic/rack/browser_monitoring.rb:23:in `ca=
ll'
  exception_notification (2.5.2) lib/exception_notifier.rb:25:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/best_standards_suppor=
t.rb:17:in `call'
  rack (1.4.1) lib/rack/etag.rb:23:in `call'
  rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/params_parser.rb:21:i=
n `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:242:in `call=
'
  rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
  rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/cookies.rb:338:in `ca=
ll'
  activerecord (3.2.1) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.1) lib/active_record/connection_adapters/abstract/con=
nection_pool.rb:443:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `b=
lock in call'
  activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__332=
759817__call__1023748432__callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_cal=
lback'
  activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call=
_callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callba=
cks'
  actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `c=
all'
  rack (1.4.1) lib/rack/sendfile.rb:102:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `c=
all'
  actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:1=
6:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56=
:in `call'
  railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `=
call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.1) lib/active_support/cache/strategy/local_cache.rb:=
72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  rack-cache (1.1) lib/rack/cache/context.rb:132:in `forward'
  rack-cache (1.1) lib/rack/cache/context.rb:139:in `pass'
  rack-cache (1.1) lib/rack/cache/context.rb:151:in `invalidate'
  rack-cache (1.1) lib/rack/cache/context.rb:70:in `call!'
  rack-cache (1.1) lib/rack/cache/context.rb:50:in `call'
  railties (3.2.1) lib/rails/engine.rb:479:in `call'
  railties (3.2.1) lib/rails/application.rb:220:in `call'
  railties (3.2.1) lib/rails/railtie/configurable.rb:30:in `method_missin=
g'
  thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
  thin (1.3.1) lib/thin/connection.rb:78:in `catch'
  thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
  thin (1.3.1) lib/thin/connection.rb:53:in `process'
  thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
  thin (1.3.1) lib/thin/server.rb:159:in `start'
  thin (1.3.1) lib/thin/controllers/controller.rb:86:in `start'
  thin (1.3.1) lib/thin/runner.rb:185:in `run_command'
  thin (1.3.1) lib/thin/runner.rb:151:in `run!'
  thin (1.3.1) bin/thin:6:in `<top (required)>'
  /..mypath../shared/bundle/ruby/1.9.1/bin/thin:19:in `load'
  /..mypath../shared/bundle/ruby/1.9.1/bin/thin:19:in `<main>'

1 个答案:

答案 0 :(得分:0)

这应该是POST请求吗?这就是堆栈跟踪中出现的内容:

REQUEST_METHOD                                 : POST