From 9fed81820070dc6354851e3f437e5250ec226bd7 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 13 Nov 2024 15:22:41 +0530 Subject: [PATCH] Update ES template strings (#29209) Use a template variable to distinguish between Elasticsearch and Opensearch ```release-note NONE ``` --- .../elasticsearch/aggregation_job.go | 8 ++--- .../elasticsearch/elasticsearch/common.go | 12 ++++---- .../elasticsearch/elasticsearch.go | 12 ++++---- .../opensearch/aggregation_job.go | 8 ++--- .../elasticsearch/opensearch/common.go | 10 +++---- .../elasticsearch/opensearch/opensearch.go | 16 +++++----- server/i18n/en.json | 30 +++++++++---------- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/server/enterprise/elasticsearch/elasticsearch/aggregation_job.go b/server/enterprise/elasticsearch/elasticsearch/aggregation_job.go index 6ef99b54cc..198a6bdcc6 100644 --- a/server/enterprise/elasticsearch/elasticsearch/aggregation_job.go +++ b/server/enterprise/elasticsearch/elasticsearch/aggregation_job.go @@ -175,7 +175,7 @@ func (worker *ElasticsearchAggregatorWorker) DoJob(job *model.Job) { Get(*worker.jobServer.Config().ElasticsearchSettings.IndexPrefix + common.IndexBasePosts + "_*"). Do(rctx.Context()) if err != nil { - appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.get_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.get_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) worker.setJobError(logger, job, appError) return } @@ -230,7 +230,7 @@ func (worker *ElasticsearchAggregatorWorker) DoJob(job *model.Job) { }, ); appErr != nil { logger.Error("Worker: Failed to create indexing job.", mlog.Err(appErr)) - appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.create_index_job.error", nil, "", http.StatusInternalServerError).Wrap(appErr) + appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.create_index_job.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(appErr) worker.setJobError(logger, job, appError) return } @@ -280,7 +280,7 @@ func (worker *ElasticsearchAggregatorWorker) DoJob(job *model.Job) { } // Delete indexes if _, err = worker.client.Indices.Delete(strings.Join(curWindow, ",")).Do(rctx.Context()); err != nil { - appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.delete_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.delete_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) logger.Error("Worker: Failed to delete indexes for job", mlog.String("workername", worker.name), mlog.String("job_id", job.Id), mlog.Err(appError)) worker.setJobError(logger, job, appError) return @@ -301,7 +301,7 @@ func (worker *ElasticsearchAggregatorWorker) DoJob(job *model.Job) { } default: // error case - appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.index_job_failed.error", nil, "", http.StatusInternalServerError) + appError := model.NewAppError("ElasticsearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.index_job_failed.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError) logger.Error("Worker: Index aggregation job failed", mlog.Err(appError)) worker.setJobError(logger, job, appError) return diff --git a/server/enterprise/elasticsearch/elasticsearch/common.go b/server/enterprise/elasticsearch/elasticsearch/common.go index c857b0e6c0..1f397766dc 100644 --- a/server/enterprise/elasticsearch/elasticsearch/common.go +++ b/server/enterprise/elasticsearch/elasticsearch/common.go @@ -24,7 +24,7 @@ func createTypedClient(logger mlog.LoggerIFace, cfg *model.Config, fileBackend f client, err := elasticsearch.NewTypedClient(*esCfg) if err != nil { - return nil, model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.connect_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return nil, model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.connect_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } return client, nil @@ -38,7 +38,7 @@ func createUntypedClient(logger mlog.LoggerIFace, cfg *model.Config, fileBackend client, err := elasticsearch.NewClient(*esCfg) if err != nil { - return nil, model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.connect_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return nil, model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.connect_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } return client, nil @@ -100,7 +100,7 @@ func configureCA(esCfg *elasticsearch.Config, cfg *model.Config, fb filestore.Fi // read the certificate authority (CA) file clientCA, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.CA) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.ca_cert_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.ca_cert_missing", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } esCfg.CACert = clientCA @@ -112,19 +112,19 @@ func configureClientCertificate(tlsConfig *tls.Config, cfg *model.Config, fb fil // read the client certificate file clientCert, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.ClientCert) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_missing", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // read the client key file clientKey, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.ClientKey) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_key_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_key_missing", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // load the client key and certificate certificate, err := tls.X509KeyPair(clientCert, clientKey) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_malformed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_malformed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // update the TLS config diff --git a/server/enterprise/elasticsearch/elasticsearch/elasticsearch.go b/server/enterprise/elasticsearch/elasticsearch/elasticsearch.go index 239be8059b..64a22be12e 100644 --- a/server/enterprise/elasticsearch/elasticsearch/elasticsearch.go +++ b/server/enterprise/elasticsearch/elasticsearch/elasticsearch.go @@ -164,7 +164,7 @@ func (es *ElasticsearchInterfaceImpl) Start() *model.AppError { Request(common.GetPostTemplate(es.Platform.Config())). Do(ctx) if err != nil { - return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_posts_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_posts_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up channels index template. @@ -172,7 +172,7 @@ func (es *ElasticsearchInterfaceImpl) Start() *model.AppError { Request(common.GetChannelTemplate(es.Platform.Config())). Do(ctx) if err != nil { - return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_channels_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_channels_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up users index template. @@ -180,7 +180,7 @@ func (es *ElasticsearchInterfaceImpl) Start() *model.AppError { Request(common.GetUserTemplate(es.Platform.Config())). Do(ctx) if err != nil { - return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_users_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_users_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up files index template. @@ -188,7 +188,7 @@ func (es *ElasticsearchInterfaceImpl) Start() *model.AppError { Request(common.GetFileInfoTemplate(es.Platform.Config())). Do(ctx) if err != nil { - return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_file_info_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Elasticsearch.start", "ent.elasticsearch.create_template_file_info_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } if atomic.LoadInt32(&es.channelIndexVerified) == 0 { @@ -1419,7 +1419,7 @@ func (es *ElasticsearchInterfaceImpl) DataRetentionDeleteIndexes(rctx request.CT dateFormat := *es.Platform.Config().ElasticsearchSettings.IndexPrefix + common.IndexBasePosts + "_2006_01_02" postIndexesResult, err := es.client.Indices.Get(*es.Platform.Config().ElasticsearchSettings.IndexPrefix + common.IndexBasePosts + "_*").Do(ctx) if err != nil { - return model.NewAppError("ElasticSearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.get_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("ElasticSearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.get_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } for index := range postIndexesResult { if indexDate, err := time.Parse(dateFormat, index); err != nil { @@ -1427,7 +1427,7 @@ func (es *ElasticsearchInterfaceImpl) DataRetentionDeleteIndexes(rctx request.CT } else { if indexDate.Before(cutoff) || indexDate.Equal(cutoff) { if _, err := es.client.Indices.Delete(index).Do(ctx); err != nil { - return model.NewAppError("ElasticSearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.delete_index.error", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("ElasticSearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.delete_index.error", map[string]any{"Backend": model.ElasticsearchSettingsESBackend}, "", http.StatusInternalServerError).Wrap(err) } } } diff --git a/server/enterprise/elasticsearch/opensearch/aggregation_job.go b/server/enterprise/elasticsearch/opensearch/aggregation_job.go index 9ec84f6a86..f83a4e416c 100644 --- a/server/enterprise/elasticsearch/opensearch/aggregation_job.go +++ b/server/enterprise/elasticsearch/opensearch/aggregation_job.go @@ -174,7 +174,7 @@ func (worker *OpensearchAggregatorWorker) DoJob(job *model.Job) { Indices: []string{*worker.jobServer.Config().ElasticsearchSettings.IndexPrefix + common.IndexBasePosts + "_*"}, }) if err != nil { - appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.get_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.get_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) worker.setJobError(logger, job, appError) return } @@ -229,7 +229,7 @@ func (worker *OpensearchAggregatorWorker) DoJob(job *model.Job) { }, ); appErr != nil { logger.Error("Worker: Failed to create indexing job.", mlog.Err(appErr)) - appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.create_index_job.error", nil, "", http.StatusInternalServerError).Wrap(appErr) + appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.create_index_job.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(appErr) worker.setJobError(logger, job, appError) return } @@ -281,7 +281,7 @@ func (worker *OpensearchAggregatorWorker) DoJob(job *model.Job) { if _, err = worker.client.Indices.Delete(rctx.Context(), opensearchapi.IndicesDeleteReq{ Indices: curWindow, }); err != nil { - appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.delete_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.delete_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) logger.Error("Worker: Failed to delete indexes for job", mlog.String("workername", worker.name), mlog.String("job_id", job.Id), mlog.Err(appError)) worker.setJobError(logger, job, appError) return @@ -302,7 +302,7 @@ func (worker *OpensearchAggregatorWorker) DoJob(job *model.Job) { } default: // error case - appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.index_job_failed.error", nil, "", http.StatusInternalServerError) + appError := model.NewAppError("OpensearchAggregatorWorker", "ent.elasticsearch.aggregator_worker.index_job_failed.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError) logger.Error("Worker: Index aggregation job failed", mlog.Err(appError)) worker.setJobError(logger, job, appError) return diff --git a/server/enterprise/elasticsearch/opensearch/common.go b/server/enterprise/elasticsearch/opensearch/common.go index 752da4842b..f8d50c8f07 100644 --- a/server/enterprise/elasticsearch/opensearch/common.go +++ b/server/enterprise/elasticsearch/opensearch/common.go @@ -25,7 +25,7 @@ func createClient(logger mlog.LoggerIFace, cfg *model.Config, fileBackend filest client, err := opensearchapi.NewClient(*esCfg) if err != nil { - return nil, model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.connect_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return nil, model.NewAppError("Opensearch.createClient", "ent.elasticsearch.create_client.connect_failed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } return client, nil @@ -90,7 +90,7 @@ func configureCA(esCfg *opensearch.Config, cfg *model.Config, fb filestore.FileB // read the certificate authority (CA) file clientCA, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.CA) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.ca_cert_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.createClient", "ent.elasticsearch.create_client.ca_cert_missing", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } esCfg.CACert = clientCA @@ -102,19 +102,19 @@ func configureClientCertificate(tlsConfig *tls.Config, cfg *model.Config, fb fil // read the client certificate file clientCert, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.ClientCert) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.createClient", "ent.elasticsearch.create_client.client_cert_missing", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // read the client key file clientKey, err := common.ReadFileSafely(fb, *cfg.ElasticsearchSettings.ClientKey) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_key_missing", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.createClient", "ent.elasticsearch.create_client.client_key_missing", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // load the client key and certificate certificate, err := tls.X509KeyPair(clientCert, clientKey) if err != nil { - return model.NewAppError("Elasticsearch.createClient", "ent.elasticsearch.create_client.client_cert_malformed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.createClient", "ent.elasticsearch.create_client.client_cert_malformed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // update the TLS config diff --git a/server/enterprise/elasticsearch/opensearch/opensearch.go b/server/enterprise/elasticsearch/opensearch/opensearch.go index 8a4d6d5e14..5f7a265e8e 100644 --- a/server/enterprise/elasticsearch/opensearch/opensearch.go +++ b/server/enterprise/elasticsearch/opensearch/opensearch.go @@ -171,7 +171,7 @@ func (os *OpensearchInterfaceImpl) Start() *model.AppError { Body: bytes.NewReader(templateBuf), }) if err != nil { - return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_posts_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_posts_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up channels index template. @@ -184,7 +184,7 @@ func (os *OpensearchInterfaceImpl) Start() *model.AppError { Body: bytes.NewReader(templateBuf), }) if err != nil { - return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_channels_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_channels_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up users index template. @@ -197,7 +197,7 @@ func (os *OpensearchInterfaceImpl) Start() *model.AppError { Body: bytes.NewReader(templateBuf), }) if err != nil { - return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_users_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_users_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } // Set up files index template. @@ -210,7 +210,7 @@ func (os *OpensearchInterfaceImpl) Start() *model.AppError { Body: bytes.NewReader(templateBuf), }) if err != nil { - return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_file_info_if_not_exists.template_create_failed", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.start", "ent.elasticsearch.create_template_file_info_if_not_exists.template_create_failed", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } if atomic.LoadInt32(&os.channelIndexVerified) == 0 { @@ -1497,7 +1497,7 @@ func (os *OpensearchInterfaceImpl) PurgeIndexList(rctx request.CTX, indexes []st if err != nil { openErr, ok := err.(*opensearch.StructError) if !ok || openErr.Status != http.StatusNotFound { - rctx.Logger().Error("Elastic Search PurgeIndex Error", mlog.Err(err)) + rctx.Logger().Error("Opensearch PurgeIndex Error", mlog.Err(err)) return model.NewAppError("Opensearch.PurgeIndexList", "ent.elasticsearch.purge_index.delete_failed", nil, "", http.StatusInternalServerError).Wrap(err) } } @@ -1511,7 +1511,7 @@ func (os *OpensearchInterfaceImpl) RefreshIndexes(rctx request.CTX) *model.AppEr defer cancel() _, err := os.client.Indices.Refresh(ctx, nil) if err != nil { - rctx.Logger().Error("Elastic Search RefreshIndexes Error", mlog.Err(err)) + rctx.Logger().Error("Opensearch RefreshIndexes Error", mlog.Err(err)) return model.NewAppError("Opensearch.RefreshIndexes", "ent.elasticsearch.refresh_indexes.refresh_failed", nil, "", http.StatusInternalServerError).Wrap(err) } return nil @@ -1535,7 +1535,7 @@ func (os *OpensearchInterfaceImpl) DataRetentionDeleteIndexes(rctx request.CTX, Indices: []string{*os.Platform.Config().ElasticsearchSettings.IndexPrefix + common.IndexBasePosts + "_*"}, }) if err != nil { - return model.NewAppError("Opensearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.get_indexes.error", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.get_indexes.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } for index := range postIndexesResult.Indices { if indexDate, err := time.Parse(dateFormat, index); err != nil { @@ -1545,7 +1545,7 @@ func (os *OpensearchInterfaceImpl) DataRetentionDeleteIndexes(rctx request.CTX, if _, err := os.client.Indices.Delete(ctx, opensearchapi.IndicesDeleteReq{ Indices: []string{index}, }); err != nil { - return model.NewAppError("Opensearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.delete_index.error", nil, "", http.StatusInternalServerError).Wrap(err) + return model.NewAppError("Opensearch.DataRetentionDeleteIndexes", "ent.elasticsearch.data_retention_delete_indexes.delete_index.error", map[string]any{"Backend": model.ElasticsearchSettingsOSBackend}, "", http.StatusInternalServerError).Wrap(err) } } } diff --git a/server/i18n/en.json b/server/i18n/en.json index e9845f32b4..b8bfab1bf4 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -7631,63 +7631,63 @@ }, { "id": "ent.elasticsearch.aggregator_worker.create_index_job.error", - "translation": "Elasticsearch aggregator worker failed to create the indexing job" + "translation": "{{.Backend}} aggregator worker failed to create the indexing job" }, { "id": "ent.elasticsearch.aggregator_worker.delete_indexes.error", - "translation": "Elasticsearch aggregator worker failed to delete the indexes" + "translation": "{{.Backend}} aggregator worker failed to delete the indexes" }, { "id": "ent.elasticsearch.aggregator_worker.get_indexes.error", - "translation": "Elasticsearch aggregator worker failed to get indexes" + "translation": "{{.Backend}} aggregator worker failed to get indexes" }, { "id": "ent.elasticsearch.aggregator_worker.index_job_failed.error", - "translation": "Elasticsearch aggregator worker failed due to the indexing job failing" + "translation": "{{.Backend}} aggregator worker failed due to the indexing job failing" }, { "id": "ent.elasticsearch.create_client.ca_cert_missing", - "translation": "Could not open the CA file for Elasticsearch" + "translation": "Could not open the CA file for {{.Backend}}" }, { "id": "ent.elasticsearch.create_client.client_cert_malformed", - "translation": "Decoding of the client certificate for Elasticsearch failed" + "translation": "Decoding of the client certificate for {{.Backend}} failed" }, { "id": "ent.elasticsearch.create_client.client_cert_missing", - "translation": "Could not open the client certificate file for Elasticsearch" + "translation": "Could not open the client certificate file for {{.Backend}}" }, { "id": "ent.elasticsearch.create_client.client_key_missing", - "translation": "Could not open the client key file for Elasticsearch" + "translation": "Could not open the client key file for {{.Backend}}" }, { "id": "ent.elasticsearch.create_client.connect_failed", - "translation": "Setting up Elasticsearch Client Failed" + "translation": "Setting up {{.Backend}} Client Failed" }, { "id": "ent.elasticsearch.create_template_channels_if_not_exists.template_create_failed", - "translation": "Failed to create Elasticsearch template for channels" + "translation": "Failed to create {{.Backend}} template for channels" }, { "id": "ent.elasticsearch.create_template_file_info_if_not_exists.template_create_failed", - "translation": "Failed to create Elasticsearch template for files" + "translation": "Failed to create {{.Backend}} template for files" }, { "id": "ent.elasticsearch.create_template_posts_if_not_exists.template_create_failed", - "translation": "Failed to create Elasticsearch template for posts" + "translation": "Failed to create {{.Backend}} template for posts" }, { "id": "ent.elasticsearch.create_template_users_if_not_exists.template_create_failed", - "translation": "Failed to create Elasticsearch template for users" + "translation": "Failed to create {{.Backend}} template for users" }, { "id": "ent.elasticsearch.data_retention_delete_indexes.delete_index.error", - "translation": "Failed to delete Elasticsearch index" + "translation": "Failed to delete {{.Backend}} index" }, { "id": "ent.elasticsearch.data_retention_delete_indexes.get_indexes.error", - "translation": "Failed to get Elasticsearch indexes" + "translation": "Failed to get {{.Backend}} indexes" }, { "id": "ent.elasticsearch.delete_channel.error",