我在生产中遇到“ActionController::RoutingError”的大量错误
问题是那些 URL、操作和视图不再存在。 但我在生产中的错误日志即使在 config.log_level = :fatal 中也不断发出这些错误,
我如何在全局范围内解决这个问题?
Rails 2.3.5
Ruby ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
这是 rake 路由输出:
root / {:mode=>"popular", :controller=>"stories", :action=>"index"}
/popular/:category/:sort_option {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new/:category/:sort_option {:mode=>"new", :controller=>"stories", :action=>"index"}
/popular/:category {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new/:category {:mode=>"new", :controller=>"stories", :action=>"index"}
/popular {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new {:mode=>"new", :controller=>"stories", :action=>"index"}
/follow/follow/:id {:controller=>"follow", :action=>"follow"}
/follow/unfollow/:id {:controller=>"follow", :action=>"unfollow"}
/follow/:sort_option {:controller=>"follow", :action=>"index"}
/follow {:controller=>"follow", :action=>"index"}
/story/submit_by_url {:controller=>"story", :action=>"submit_by_url"}
/story/vote/:id {:controller=>"story", :action=>"vote"}
/:id {:controller=>"story", :action=>"index"}
/:id/:action {:controller=>"story"}
/story/:action {:controller=>"story"}
/story/:category/:id {:controller=>"story", :action=>"old_index"}
/story/:category/:id/who_voted {:controller=>"story", :action=>"old_who_voted"}
/tag/cloud {:controller=>"tag", :action=>"cloud"}
/tag/:tag_name/:filter {:controller=>"tag", :action=>"index"}
/tag/:tag_name {:controller=>"tag", :action=>"index"}
/site/:domain/:filter {:controller=>"site", :action=>"index"}
/site/:domain {:controller=>"site", :action=>"index"}
/search {:controller=>"search", :action=>"index"}
/profile/:username {:controller=>"profile", :action=>"index"}
/profile/:username/:action {:controller=>"profile"}
/account/settings {:controller=>"settings", :action=>"index"}
/account/settings/:action {:controller=>"settings"}
/feed/:category(.:format) {:controller=>"feed", :action=>"index"}
/feed/:old_site_route/site.xml {:controller=>"feed", :action=>"index"}
/rss/:old_site_route/:category(.:format) {:controller=>"feed", :action=>"index"}
/sitemaps/index(.:format) {:controller=>"sitemaps", :action=>"index"}
/sitemaps/:action.:number(.:format) {:controller=>"sitemaps"}
/home/fresh {:controller=>"home", :svejo_type=>"fresh", :action=>"list_stories"}
/home/green {:controller=>"home", :svejo_type=>"green", :action=>"list_stories"}
/user/profile {:controller=>"user", :action=>"login"}
/profile/:id/publications {:controller=>"profile", :show=>"published", :action=>"actions"}
/profile/:id/voted {:controller=>"profile", :show=>"voted", :action=>"actions"}
/profile/:id/friends/:action {:controller=>"friends"}
/profile/:id/conversations/:action {:controller=>"conversations"}
/profile/:id/:action {:controller=>"profile"}
/:controller/service.wsdl {:action=>"wsdl"}
/accelerators/:action(.:format) {:controller=>"accelerators"}
/home/story_summary/:id {:controller=>"summary", :action=>"link"}
/home/link_summary/:id.:extension {:controller=>"summary", :action=>"link"}
/home/link_summary/:id {:controller=>"summary", :action=>"link"}
/administration/featured_stories/:action {:controller=>"administration/featured_stories"}
/portfolio {:controller=>"home", :action=>"portfolio"}
last_dayblogs GET /api/dayblogs/last(.:format) {:controller=>"api/dayblogs", :action=>"last"}
new_dayblogs GET /api/dayblogs/new(.:format) {:controller=>"api/dayblogs", :action=>"new"}
edit_dayblogs GET /api/dayblogs/edit(.:format) {:controller=>"api/dayblogs", :action=>"edit"}
dayblogs GET /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"show"}
PUT /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"update"}
DELETE /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"destroy"}
POST /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"create"}
/api/stories/:action {:controller=>"api/stories"}
/api/tags/:action {:controller=>"api/tags"}
/public_api/user/:id/:action(.:format) {:controller=>"public_api/user"}
/public_api/tag/:id/:action(.:format) {:controller=>"public_api/tag"}
/public_api/stories/:action(.:format) {:controller=>"public_api/stories"}
/public_api/comments/:action/:format {:controller=>"public_api/comments"}
/public_api/site/:id/:action(.:format) {:controller=>"public_api/site"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
这是错误示例:
ActionController::RoutingError (No route matches "/1021677.." with {:method=>:get}):
haml (3.0.24) rails/./lib/sass/plugin/rack.rb:41:in `call'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/hoptoad_notifier-2.4.2/lib/hoptoad_notifier/rack.rb:27:in `call'
unicorn (2.0.1) lib/unicorn/http_server.rb:510:in `process_client'
unicorn (2.0.1) lib/unicorn/http_server.rb:585:in `worker_loop'
unicorn (2.0.1) lib/unicorn/http_server.rb:583:in `each'
unicorn (2.0.1) lib/unicorn/http_server.rb:583:in `worker_loop'
unicorn (2.0.1) lib/unicorn/http_server.rb:473:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:470:in `fork'
unicorn (2.0.1) lib/unicorn/http_server.rb:470:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:466:in `each'
unicorn (2.0.1) lib/unicorn/http_server.rb:466:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:480:in `maintain_worker_count'
unicorn (2.0.1) lib/unicorn/http_server.rb:163:in `start'
unicorn (2.0.1) lib/unicorn.rb:13:in `run'
unicorn (2.0.1) bin/unicorn_rails:208
/opt/ruby/bin/unicorn_rails_svejo:23:in `load'
/opt/ruby/bin/unicorn_rails_svejo:23
谢谢!
The problem is that those URLs, actions and views if you will are no longer there.
But my error log in production keeps screaming those errors even in config.log_level = :fatal
How can I resolve this globaly?
Rails 2.3.5
Ruby ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
Here is the rake routes output:
root / {:mode=>"popular", :controller=>"stories", :action=>"index"}
/popular/:category/:sort_option {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new/:category/:sort_option {:mode=>"new", :controller=>"stories", :action=>"index"}
/popular/:category {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new/:category {:mode=>"new", :controller=>"stories", :action=>"index"}
/popular {:mode=>"popular", :controller=>"stories", :action=>"index"}
/new {:mode=>"new", :controller=>"stories", :action=>"index"}
/follow/follow/:id {:controller=>"follow", :action=>"follow"}
/follow/unfollow/:id {:controller=>"follow", :action=>"unfollow"}
/follow/:sort_option {:controller=>"follow", :action=>"index"}
/follow {:controller=>"follow", :action=>"index"}
/story/submit_by_url {:controller=>"story", :action=>"submit_by_url"}
/story/vote/:id {:controller=>"story", :action=>"vote"}
/:id {:controller=>"story", :action=>"index"}
/:id/:action {:controller=>"story"}
/story/:action {:controller=>"story"}
/story/:category/:id {:controller=>"story", :action=>"old_index"}
/story/:category/:id/who_voted {:controller=>"story", :action=>"old_who_voted"}
/tag/cloud {:controller=>"tag", :action=>"cloud"}
/tag/:tag_name/:filter {:controller=>"tag", :action=>"index"}
/tag/:tag_name {:controller=>"tag", :action=>"index"}
/site/:domain/:filter {:controller=>"site", :action=>"index"}
/site/:domain {:controller=>"site", :action=>"index"}
/search {:controller=>"search", :action=>"index"}
/profile/:username {:controller=>"profile", :action=>"index"}
/profile/:username/:action {:controller=>"profile"}
/account/settings {:controller=>"settings", :action=>"index"}
/account/settings/:action {:controller=>"settings"}
/feed/:category(.:format) {:controller=>"feed", :action=>"index"}
/feed/:old_site_route/site.xml {:controller=>"feed", :action=>"index"}
/rss/:old_site_route/:category(.:format) {:controller=>"feed", :action=>"index"}
/sitemaps/index(.:format) {:controller=>"sitemaps", :action=>"index"}
/sitemaps/:action.:number(.:format) {:controller=>"sitemaps"}
/home/fresh {:controller=>"home", :svejo_type=>"fresh", :action=>"list_stories"}
/home/green {:controller=>"home", :svejo_type=>"green", :action=>"list_stories"}
/user/profile {:controller=>"user", :action=>"login"}
/profile/:id/publications {:controller=>"profile", :show=>"published", :action=>"actions"}
/profile/:id/voted {:controller=>"profile", :show=>"voted", :action=>"actions"}
/profile/:id/friends/:action {:controller=>"friends"}
/profile/:id/conversations/:action {:controller=>"conversations"}
/profile/:id/:action {:controller=>"profile"}
/:controller/service.wsdl {:action=>"wsdl"}
/accelerators/:action(.:format) {:controller=>"accelerators"}
/home/story_summary/:id {:controller=>"summary", :action=>"link"}
/home/link_summary/:id.:extension {:controller=>"summary", :action=>"link"}
/home/link_summary/:id {:controller=>"summary", :action=>"link"}
/administration/featured_stories/:action {:controller=>"administration/featured_stories"}
/portfolio {:controller=>"home", :action=>"portfolio"}
last_dayblogs GET /api/dayblogs/last(.:format) {:controller=>"api/dayblogs", :action=>"last"}
new_dayblogs GET /api/dayblogs/new(.:format) {:controller=>"api/dayblogs", :action=>"new"}
edit_dayblogs GET /api/dayblogs/edit(.:format) {:controller=>"api/dayblogs", :action=>"edit"}
dayblogs GET /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"show"}
PUT /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"update"}
DELETE /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"destroy"}
POST /api/dayblogs(.:format) {:controller=>"api/dayblogs", :action=>"create"}
/api/stories/:action {:controller=>"api/stories"}
/api/tags/:action {:controller=>"api/tags"}
/public_api/user/:id/:action(.:format) {:controller=>"public_api/user"}
/public_api/tag/:id/:action(.:format) {:controller=>"public_api/tag"}
/public_api/stories/:action(.:format) {:controller=>"public_api/stories"}
/public_api/comments/:action/:format {:controller=>"public_api/comments"}
/public_api/site/:id/:action(.:format) {:controller=>"public_api/site"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
Here is a sample of the error:
ActionController::RoutingError (No route matches "/1021677.." with {:method=>:get}):
haml (3.0.24) rails/./lib/sass/plugin/rack.rb:41:in `call'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/hoptoad_notifier-2.4.2/lib/hoptoad_notifier/rack.rb:27:in `call'
unicorn (2.0.1) lib/unicorn/http_server.rb:510:in `process_client'
unicorn (2.0.1) lib/unicorn/http_server.rb:585:in `worker_loop'
unicorn (2.0.1) lib/unicorn/http_server.rb:583:in `each'
unicorn (2.0.1) lib/unicorn/http_server.rb:583:in `worker_loop'
unicorn (2.0.1) lib/unicorn/http_server.rb:473:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:470:in `fork'
unicorn (2.0.1) lib/unicorn/http_server.rb:470:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:466:in `each'
unicorn (2.0.1) lib/unicorn/http_server.rb:466:in `spawn_missing_workers'
unicorn (2.0.1) lib/unicorn/http_server.rb:480:in `maintain_worker_count'
unicorn (2.0.1) lib/unicorn/http_server.rb:163:in `start'
unicorn (2.0.1) lib/unicorn.rb:13:in `run'
unicorn (2.0.1) bin/unicorn_rails:208
/opt/ruby/bin/unicorn_rails_svejo:23:in `load'
/opt/ruby/bin/unicorn_rails_svejo:23
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不会那么担心。
许多机器人正在检查您的网站是否存在 drupal 漏洞和 joomla 漏洞
I wouldn't be so worried.
Many bots are checking your website for drupal holes and joomla vulnerabilitie