Handle issues with Advanced Search settings differently
Description
If Advanced Search settings are modified and elasticsearch_indexing is enabled, the code runs the find_or_create_elasticsearch_index method. That method checks if an index exists and creates it if it does not (this is also mentioned in the Admin UI under the checkbox for Elasticsearch indexing).
If an error occurs during that connection, the user can receive a 5XX or 4XX error in the UI. The error prevents the save from occurring.
Proposal
We currently rescue from Faraday::Error but should consider expanding the list to rescue from more error types (including testing with AWS OpenSearch hosted backends) and possibly disable elasticsearch_indexing if there is a connection failure. An example from an OpenSearch error encountered during a pairing session:
2022-11-21 10:03:29 -0500: HEAD https://XXXX:443/gitlab-development-issues [status:403, request:0.170s, query:N/A]
2022-11-21 10:03:29 -0500: <
2022-11-21 10:03:29 -0500: [403]
Elasticsearch::Transport::Transport::Errors::Forbidden: [403]
from /Users/terrichu/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/elasticsearch-transport-7.13.3/lib/elasticsearch/transport/transport/base.rb:218:in `__raise_transport_error'