{"record":{"id":"60bee0d1516370db","repo":"temporalio/temporal","slug":"requires-a-starttime-or-closetime","errorCode":null,"errorMessage":"requires a StartTime or CloseTime","messagePattern":"requires a StartTime or CloseTime","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/archiver/gcloud/query_parser.go","lineNumber":68,"sourceCode":"\n// NewQueryParser creates a new query parser for filestore\nfunc NewQueryParser() QueryParser {\n\treturn &queryParser{}\n}\n\nfunc (p *queryParser) Parse(query string) (*parsedQuery, error) {\n\tstmt, err := sqlparser.Parse(fmt.Sprintf(sqlquery.QueryTemplate, query))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\twhereExpr := stmt.(*sqlparser.Select).Where.Expr\n\tparsedQuery := &parsedQuery{}\n\tif err := p.convertWhereExpr(whereExpr, parsedQuery); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif (parsedQuery.closeTime.IsZero() && parsedQuery.startTime.IsZero()) || (!parsedQuery.closeTime.IsZero() && !parsedQuery.startTime.IsZero()) {\n\t\treturn nil, errors.New(\"requires a StartTime or CloseTime\")\n\t}\n\n\tif parsedQuery.searchPrecision == nil {\n\t\treturn nil, errors.New(\"SearchPrecision is required when searching for a StartTime or CloseTime\")\n\t}\n\n\treturn parsedQuery, nil\n}\n\nfunc (p *queryParser) convertWhereExpr(expr sqlparser.Expr, parsedQuery *parsedQuery) error {\n\tif expr == nil {\n\t\treturn errors.New(\"where expression is nil\")\n\t}\n\n\tswitch expr := expr.(type) {\n\tcase *sqlparser.ComparisonExpr:\n\t\treturn p.convertComparisonExpr(expr, parsedQuery)\n\tcase *sqlparser.AndExpr:","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/gcloud/query_parser.go#L50-L86","documentation":"GetMapper builds a search-attribute mapper for the current index and, when a fallback (secondary/legacy) index is configured, also loads that index's search attributes via searchAttributesProvider.GetSearchAttributes. If the fallback index's attributes cannot be loaded (e.g. the index does not exist in Elasticsearch or the persistence call fails), this wrapping error is returned with the index name and cause.","triggerScenarios":"Calling GetMapper when m.fallbackIndexName != \"\" and searchAttributesProvider.GetSearchAttributes(fallbackIndexName, false) returns an error — most often because the fallback index is missing from Elasticsearch, or the ES request fails (auth, connectivity, mapping unavailable).","commonSituations":"Config references a fallback/secondary visibility index that was never created or was deleted; index name typo; Elasticsearch credentials/permissions changed after an upgrade; during version upgrades where the old index was removed before config was updated.","solutions":["Verify the fallback index exists in Elasticsearch (GET /_cat/indices) and create it if missing.","Correct the fallbackIndexName in your visibility config if it is a typo.","Check ES connectivity and credentials of the visibility store client.","If no fallback is needed, clear fallbackIndexName so the fallback path is skipped."],"exampleFix":"// before (config)\nvisibilityConfig:\n  fallbackIndexName: \"temporal-visibility-v1\"  // deleted index\n// after\nvisibilityConfig:\n  fallbackIndexName: \"temporal-secondary-v2\"  // existing index, or remove field","handlingStrategy":"fallback","validationCode":"// Before enabling a fallback index, confirm it exists\nexists, err := esClient.Indices.Exists([]string{fallbackIndexName}).Do(ctx)\nif err != nil || !exists {\n\treturn fmt.Errorf(\"fallback index %q does not exist\", fallbackIndexName)\n}","typeGuard":null,"tryCatchPattern":"mapper, err := provider.GetMapper(ctx)\nif err != nil && strings.Contains(err.Error(), \"failed to load search attributes for fallback index\") {\n\t// disable fallback path or alert, then retry/continue with primary index only\n}","preventionTips":["Provision the fallback/secondary index with the same schema automation as the primary index.","After deleting old visibility indexes during upgrades, update config first or keep indexes until cutover completes.","Add a health check that resolves both primary and fallback index names against ES at service startup."],"tags":["elasticsearch","search-attributes","visibility","config"],"backgroundTag":"elasticsearch-index-not-found","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}