Defect #26526

Rails 5: production env: Search engine returns 500 error

Added by Go MAEDA 5 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Search engine
Target version:-
Resolution:Fixed Affected version:

Description

Started GET "/search?utf8=%E2%9C%93&q=aaa&scope=all&all_words=&all_words=1&titles_only=&issues=1&news=1&documents=1&changesets=1&wiki_pages=1&messages=1&projects=1&attachments=0&options=0&commit=Submit" for 127.0.0.1 at 2017-07-25 19:58:29 +0900
Processing by SearchController#index as HTML
.
(snip)
.
Completed 500 Internal Server Error in 54ms (ActiveRecord: 28.5ms)

NameError (uninitialized constant Redmine::Database):

lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:162:in `search_token_match_statement'
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:155:in `block in search_tokens_condition'
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:155:in `map'
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:155:in `search_tokens_condition'
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:93:in `search_result_ranks_and_ids'
lib/redmine/search.rb:127:in `block in load_result_ids'
.
(snip)

Associated revisions

Revision 16879
Added by Toshi MARUYAMA 5 months ago

fix search engine returns 500 error by Go MAEDA (#26526)

Revision 16881
Added by Toshi MARUYAMA 5 months ago

add "config.enable_dependency_loading = true" at config/environments/production.rb (#26513, #26524, #26526)

History

#1 Updated by Go MAEDA 5 months ago

Workaround:

Index: lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
===================================================================
--- lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb    (revision 16877)
+++ lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb    (working copy)
@@ -15,6 +15,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

+require 'redmine/database'
+
 module Redmine
   module Acts
     module Searchable

#2 Updated by Toshi MARUYAMA 5 months ago

  • Status changed from New to Closed
  • Target version deleted (4.0.0)
  • Resolution set to Fixed

Committed in trunk r16879, thanks.

Also available in: Atom PDF