{"record":{"id":"97401575c8392132","repo":"temporalio/temporal","slug":"errunabletogetsearchattributes","errorCode":"ErrUnableToGetSearchAttributes","errorMessage":"%w: %v","messagePattern":"%w: %v","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/worker/addsearchattributes/workflow.go","lineNumber":169,"sourceCode":"\tif a.esClient == nil {\n\t\ta.logger.Info(\"Elasticsearch client is not configured. Skipping Elasticsearch status check.\")\n\t\treturn nil\n\t}\n\n\tstatus, err := a.esClient.WaitForYellowStatus(ctx, indexName)\n\tif err != nil {\n\t\ta.logger.Error(\"Unable to get Elasticsearch cluster status.\", tag.ESIndex(indexName), tag.Error(err))\n\t\tmetrics.AddSearchAttributesFailuresCount.With(a.metricsHandler).Record(1)\n\t\treturn err\n\t}\n\ta.logger.Info(\"Elasticsearch cluster status.\", tag.ESIndex(indexName), tag.ESClusterStatus(status))\n\treturn nil\n}\n\nfunc (a *activities) UpdateClusterMetadataActivity(ctx context.Context, params WorkflowParams) error {\n\toldSearchAttributes, err := a.saManager.GetSearchAttributes(params.IndexName, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%w: %v\", ErrUnableToGetSearchAttributes, err)\n\t}\n\n\tnewCustomSearchAttributes := util.CloneMapNonNil(oldSearchAttributes.Custom())\n\tmaps.Copy(newCustomSearchAttributes, params.CustomAttributesToAdd)\n\terr = a.saManager.SaveSearchAttributes(ctx, params.IndexName, newCustomSearchAttributes)\n\tif err != nil {\n\t\ta.logger.Info(\"Unable to save search attributes to cluster metadata.\", tag.ESIndex(params.IndexName), tag.Error(err))\n\t\tmetrics.AddSearchAttributesFailuresCount.With(a.metricsHandler).Record(1)\n\t\treturn fmt.Errorf(\"%w: %v\", ErrUnableToSaveSearchAttributes, err)\n\t}\n\ta.logger.Info(\"Search attributes saved to cluster metadata.\", tag.ESIndex(params.IndexName))\n\treturn nil\n}\n","sourceCodeStart":151,"sourceCodeEnd":183,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/worker/addsearchattributes/workflow.go#L151-L183","documentation":"Error \"%w: %v\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at service/worker/addsearchattributes/workflow.go:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}