{"record":{"id":"83ef66cab9277b68","repo":"temporalio/temporal","slug":"dynamic-archival-cluster-state-err","errorCode":null,"errorMessage":"<dynamic archival cluster state err>","messagePattern":"<dynamic archival cluster state err>","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"common/archiver/archival_metadata.go","lineNumber":112,"sourceCode":"func (metadata *archivalMetadata) GetHistoryConfig() ArchivalConfig {\n\treturn metadata.historyConfig\n}\n\nfunc (metadata *archivalMetadata) GetVisibilityConfig() ArchivalConfig {\n\treturn metadata.visibilityConfig\n}\n\n// NewArchivalConfig constructs a new valid ArchivalConfig\nfunc NewArchivalConfig(\n\tstaticClusterStateStr string,\n\tdynamicClusterState dynamicconfig.StringPropertyFn,\n\tenableRead dynamicconfig.BoolPropertyFn,\n\tnamespaceDefaultStateStr string,\n\tnamespaceDefaultURI string,\n) ArchivalConfig {\n\tstaticClusterState, err := getClusterArchivalState(staticClusterStateStr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tnamespaceDefaultState, err := getNamespaceArchivalState(namespaceDefaultStateStr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn &archivalConfig{\n\t\tstaticClusterState:    staticClusterState,\n\t\tdynamicClusterState:   dynamicClusterState,\n\t\tenableRead:            enableRead,\n\t\tnamespaceDefaultState: namespaceDefaultState,\n\t\tnamespaceDefaultURI:   namespaceDefaultURI,\n\t}\n}\n\n// NewDisabledArchvialConfig returns an ArchivalConfig where archival is disabled for both the cluster and the namespace\nfunc NewDisabledArchvialConfig() ArchivalConfig {\n\treturn &archivalConfig{","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/archival_metadata.go#L94-L130","documentation":"NewArchivalConfig in common/archiver/archival_metadata.go parses the static cluster archival state string via getClusterArchivalState and panics on error. The message \"<dynamic archival cluster state err>\" wraps whatever the parser returned (e.g. an invalid state string). Because this is a constructor run at service startup, a bad value is treated as a fatal configuration error rather than a returned error.","triggerScenarios":"Calling NewArchivalConfig with a staticClusterStateStr that getClusterArchivalState cannot parse (not one of the valid archival state values: \"enabled\", \"disabled\", \"paused\", or the empty/unset meaning dynamic default).","commonSituations":"Typo in the cluster archival state in the service config YAML (e.g. \"enable\" instead of \"enabled\"); environment-specific config overriding the state with an unsupported string; upgrading Temporal where the accepted state vocabulary changed while old config lingers.","solutions":["Fix the archival state string in config to a valid value (enabled/disabled/paused)","Log and print the wrapped err from getClusterArchivalState — the panic message carries the underlying parse error","Validate config at deploy time (config schema check) before the service starts","If you control the call site in tests, pass only values produced by the archiver package's own constants"],"exampleFix":"// before (config.yaml)\narchival:\n  clusterState: \"enable\"\n// after (config.yaml)\narchival:\n  clusterState: \"enabled\"\n","handlingStrategy":"validation","validationCode":"staticState := cfg.ArchivalClusterState\nif staticState != \"\" && staticState != \"enabled\" && staticState != \"disabled\" && staticState != \"paused\" {\n    return fmt.Errorf(\"invalid cluster archival state: %q\", staticState)\n}","typeGuard":"func validArchivalState(s string) bool {\n    switch s {\n    case \"\", \"enabled\", \"disabled\", \"paused\":\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Use the archiver package's exported state constants in config generation","Add config schema validation for archival keys before service startup","Pin accepted values in config templates and lint them in CI"],"tags":["archival","config","panic","startup"],"backgroundTag":"invalid-archival-state-config","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}