Ruby on rails Sunspot Solr奇怪的错误

时间:2016-09-08 19:09:27

标签: ruby-on-rails solr sunspot sunspot-rails

每次我在我的网络应用程序中执行操作时,都会遇到这个我真正无法理解的巨大错误。

在我点击“添加到收藏夹”到一个分类后,生成此控制台日志,这从SQL端正常工作。

点击后我得到错误,但如果我在浏览器中点击“返回”,我看到该项目是“我最喜欢的”。

错误如下:

Started PUT "/classifieds/72/favorite?type=favorite" for 127.0.0.1 at 2016-09-08 21:58:36 +0300
Processing by ClassifiedsController#favorite as HTML
  Parameters: {"authenticity_token"=>"yynpSeBi2Jsr+GzGZZWbxmBCZSxXfOvG1NU9L3lX3pafRbtka779xUB18MkZUFPxtvQh7O4siIpPe5gl8XGbyQ==", "type"=>"favorite", "id"=>"72"}
  User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ?  [["id", 4], ["LIMIT", 1]]
  Classified Load (0.1ms)  SELECT  "classifieds".* FROM "classifieds" WHERE "classifieds"."id" = ? LIMIT ?  [["id", 72], ["LIMIT", 1]]
   (0.1ms)  begin transaction
  SOLR Request (4.4ms)  [ path=update parameters={} ]
  SQL (0.4ms)  INSERT INTO "favorite_classifieds" ("user_id", "classified_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)  [["user_id", 4], ["classified_id", 72], ["created_at", 2016-09-08 18:58:36 UTC], ["updated_at", 2016-09-08 18:58:36 UTC]]
   (20.3ms)  commit transaction
DEPRECATION WARNING: `redirect_to :back` is deprecated and will be removed from Rails 5.1. Please use `redirect_back(fallback_location: fallback_location)` where `fallback_location` represents the location to use if the request has no HTTP referer information. (called from favorite at /home/frcake/workspace/Site/brokerv1/brokr/app/controllers/classifieds_controller.rb:79)
Redirected to http://localhost:3000/classifieds/72
  SOLR Request (12.5ms)  [ path=update parameters={} ]
Completed 500 Internal Server Error in 50ms (ActiveRecord: 21.1ms)



RSolr::Error::Http (RSolr::Error::Http - 500 Internal Server Error
Error: 'java.nio.file.NoSuchFileException: /home/frcake/workspace/Site/brokerv1/brokr/solr/development/data/index/_41.fdt','trace'=>'java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/frcake/workspace/Site/brokerv1/brokr/solr/development/data/index/_41.fdt

URI: http://localhost:8982/solr/development/update?wt=ruby
Request Headers: {"Content-Type"=>"text/xml"}
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><commit softCommit=\"false\"/>"

Backtrace: /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:288:in `adapt_response'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:189:in `execute'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:175:in `send_and_receive'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.6/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.6/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:84:in `update'
/home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:113:in `commit'):

rsolr (1.1.2) lib/rsolr/client.rb:288:in `adapt_response'
rsolr (1.1.2) lib/rsolr/client.rb:189:in `execute'
rsolr (1.1.2) lib/rsolr/client.rb:175:in `send_and_receive'
sunspot_rails (2.2.6) lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `instrument'
sunspot_rails (2.2.6) lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
rsolr (1.1.2) lib/rsolr/client.rb:84:in `update'
rsolr (1.1.2) lib/rsolr/client.rb:113:in `commit'
sunspot (2.2.6) lib/sunspot/session.rb:123:in `commit'
sunspot (2.2.6) lib/sunspot/session.rb:220:in `commit_if_dirty'
sunspot (2.2.6) lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `commit_if_dirty'
sunspot (2.2.6) lib/sunspot.rb:554:in `commit_if_dirty'
sunspot_rails (2.2.6) lib/sunspot/rails/request_lifecycle.rb:26:in `block (2 levels) in included'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:396:in `instance_exec'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:396:in `block in make_lambda'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:218:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:218:in `block in halting'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:456:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:456:in `block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:456:in `each'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:456:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.0.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.0.1) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.0.1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.0.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.0.1) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.0.1) lib/active_record/migration.rb:552:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.3.1) lib/web_console/middleware.rb:131:in `call_app'
web-console (3.3.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.3.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.3.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
puma (3.6.0) lib/puma/configuration.rb:225:in `call'
puma (3.6.0) lib/puma/server.rb:578:in `handle_request'
puma (3.6.0) lib/puma/server.rb:415:in `process_client'
puma (3.6.0) lib/puma/server.rb:275:in `block in run'
puma (3.6.0) lib/puma/thread_pool.rb:116:in `call'
puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
  Rendering /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
  Rendering /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
  Rendered /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (9.4ms)
  Rendering /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
  Rendered /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (4.0ms)
  Rendering /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
  Rendered /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.5ms)
Rendered /home/frcake/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (36.3ms)

1 个答案:

答案 0 :(得分:0)

我遵循了这个有待回答的答案Can't reindex Sunspot SOLR - Error - RSolr::Error::Http - 500 Internal Server Error

而不是删除整个文件夹我刚刚删除了solr.xml文件

所有其他命令都是相同的:)