Skip to content

Ignore connection error when changing the Elasticsearch Server URL

Changzheng Liu requested to merge 296032_ignore_es_connection_exception into master

What does this MR do?

This is related to #296032 (closed)

When updating the Elasticsearch server URL, there is a check to see whether the gitlab index exists on the target server. In the original code, there are two issues. First, when connecting to ES server, it may get the URL from the cache instead of the new address. Second, if the server is not reachable, it will throw an exception.

To fix the first issue, we can create a new client from the incoming address. Since it's the admin setting, it may be okay to create a new client object each time. To fix the second issue, I am thinking to ignore the connect error for now. A follow-up can be to send back a warning to the user.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Changzheng Liu

Merge request reports