{"record":{"id":"afd770eced998a5a","repo":"temporalio/temporal","slug":"w-expected-string-got-t","errorCode":null,"errorMessage":"%w: expected string got %T","messagePattern":"%w: expected string got %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/persistence/visibility/store/elasticsearch/visibility_store.go","lineNumber":1075,"sourceCode":"\tcombinedTypeMap := store.CombineTypeMaps(saTypeMap, chasmMapper)\n\n\tvar (\n\t\tisValidType         bool\n\t\tmemo                []byte\n\t\tmemoEncoding        string\n\t\tallSearchAttributes map[string]any\n\t)\n\trecord := &store.InternalExecutionInfo{}\n\tfor fieldName, fieldValue := range sourceMap {\n\t\tswitch fieldName {\n\t\tcase sadefs.NamespaceID,\n\t\t\tsadefs.VisibilityTaskKey:\n\t\t\t// Ignore these fields.\n\t\t\tcontinue\n\t\tcase sadefs.Memo:\n\t\t\tvar memoStr string\n\t\t\tif memoStr, isValidType = fieldValue.(string); !isValidType {\n\t\t\t\treturn nil, logParseError(fieldName, fieldValue, fmt.Errorf(\"%w: expected string got %T\", errUnexpectedJSONFieldType, fieldValue), docID)\n\t\t\t}\n\t\t\tvar err error\n\t\t\tif memo, err = base64.StdEncoding.DecodeString(memoStr); err != nil {\n\t\t\t\treturn nil, logParseError(fieldName, memoStr[:10], err, docID)\n\t\t\t}\n\t\t\tcontinue\n\t\tcase sadefs.MemoEncoding:\n\t\t\tif memoEncoding, isValidType = fieldValue.(string); !isValidType {\n\t\t\t\treturn nil, logParseError(fieldName, fieldValue, fmt.Errorf(\"%w: expected string got %T\", errUnexpectedJSONFieldType, fieldValue), docID)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tfieldType, err := combinedTypeMap.GetType(fieldName)\n\t\tif err != nil {\n\t\t\t// Silently ignore ErrInvalidName because it indicates an unknown field in an Elasticsearch document.\n\t\t\tif errors.Is(err, sadefs.ErrInvalidName) {\n\t\t\t\tcontinue","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/persistence/visibility/store/elasticsearch/visibility_store.go#L1057-L1093","documentation":"Error \"%w: expected string got %T\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at common/persistence/visibility/store/elasticsearch/visibility_store.go:1075 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-08T10:18:20.063Z"}