From 7954ee0dce025d6687cf273294323fbbb3c1af4e Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 3 Apr 2018 11:27:58 +0200 Subject: [PATCH] Follow up 8c5f87c9d4: Improved detection of ES attachment plugin error and output message. --- lib/search_index_backend.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/search_index_backend.rb b/lib/search_index_backend.rb index 92386651e..27dc5fa00 100644 --- a/lib/search_index_backend.rb +++ b/lib/search_index_backend.rb @@ -606,12 +606,12 @@ return true if backend is configured message = if response&.error&.match?('Connection refused') "Elasticsearch is not reachable, probably because it's not running or even installed." - elsif url.end_with?('pipeline/zammad-attachment') && response.code == 400 + elsif url.end_with?('pipeline/zammad-attachment', 'pipeline=zammad-attachment') && response.code == 400 'The installed attachment plugin could not handle the request payload. Ensure that the correct attachment plugin is installed (5.6 => ingest-attachment, 2.4 - 5.5 => mapper-attachments).' else 'Check the response and payload for detailed information: ' end - "#{prefix}#{message}#{suffix}" + "#{prefix} #{message}#{suffix}" end end