{"record":{"id":"aea97b56da48b0dd","repo":"crowdsecurity/crowdsec","slug":"errfeatureunknown","errorCode":"ErrFeatureUnknown","errorMessage":"unknown feature","messagePattern":"unknown feature","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fflag/features.go","lineNumber":46,"sourceCode":"\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/goccy/go-yaml\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar (\n\tErrFeatureNameEmpty   = errors.New(\"name is empty\")\n\tErrFeatureNameCase    = errors.New(\"name is not lowercase\")\n\tErrFeatureNameInvalid = errors.New(\"invalid name (allowed a-z, 0-9, _, .)\")\n\tErrFeatureUnknown     = errors.New(\"unknown feature\")\n\tErrFeatureDeprecated  = errors.New(\"the flag is deprecated\")\n\tErrFeatureRetired     = errors.New(\"the flag is retired\")\n)\n\nconst (\n\tActiveState     = iota // the feature can be enabled, and its description is logged (Info)\n\tDeprecatedState        // the feature can be enabled, and a deprecation message is logged (Warning)\n\tRetiredState           // the feature is ignored and a deprecation message is logged (Error)\n)\n\ntype Feature struct {\n\tName  string\n\tState int // active, deprecated, retired\n\n\t// Description should be a short sentence, explaining the feature.\n\tDescription string\n\n\t// DeprecationMessage is used to inform the user of the behavior that has","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/fflag/features.go#L28-L64","documentation":"Sentinel error ErrFeatureUnknown returned by GetFeature when the requested name is not present in the feature registry (fr.features map miss). The feature flag framework only knows names registered at init time.","triggerScenarios":"GetFeature or Set called with a well-formed but unregistered feature name; a feature renamed/removed in a newer crowdsec version while old config or FFLAGS env still references it.","commonSituations":"Upgrading crowdsec where a feature flag was renamed; typo in feature name in config.yaml feature-flags section; stale CROWDSEC_FEATURES env var from an older install.","solutions":["List available features ('cscli features list') and use an exact registered name","Remove the unknown feature entry from your config or env after upgrading","Check the changelog for feature flag renames between your versions"],"exampleFix":"// before\nfeatureFlags.Set(\"enable_auto_update\") // removed in this version\n// after\nfeatureFlags.Set(\"enable_notification_dir\")","handlingStrategy":"validation","validationCode":"if _, err := fflag.GetFeature(name); errors.Is(err, fflag.ErrFeatureUnknown) { log.Warnf(\"unknown feature %q\", name) }","typeGuard":null,"tryCatchPattern":"if _, err := fflag.GetFeature(name); errors.Is(err, fflag.ErrFeatureUnknown) { return fmt.Errorf(\"feature %s does not exist in this version\", name) }","preventionTips":["List available features before referencing one in config or env","After upgrading, prune stale feature flag entries","Check release notes for renamed feature flags"],"tags":["go","feature-flags","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}