{"record":{"id":"71934587f86b413d","repo":"fatedier/frp","slug":"unsafe-feature-q-is-not-enabled-to-enable-it-en","errorCode":null,"errorMessage":"unsafe feature %q is not enabled. To enable it, ensure it is allowed in the configuration or command line flags","messagePattern":"unsafe feature %q is not enabled\\. To enable it, ensure it is allowed in the configuration or command line flags","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/validator.go","lineNumber":24,"sourceCode":"\t\"github.com/fatedier/frp/pkg/policy/security\"\n)\n\n// ConfigValidator holds the context dependencies for configuration validation.\ntype ConfigValidator struct {\n\tunsafeFeatures *security.UnsafeFeatures\n}\n\n// NewConfigValidator creates a new ConfigValidator instance.\nfunc NewConfigValidator(unsafeFeatures *security.UnsafeFeatures) *ConfigValidator {\n\treturn &ConfigValidator{\n\t\tunsafeFeatures: unsafeFeatures,\n\t}\n}\n\n// ValidateUnsafeFeature checks if a specific unsafe feature is enabled.\nfunc (v *ConfigValidator) ValidateUnsafeFeature(feature string) error {\n\tif !v.unsafeFeatures.IsEnabled(feature) {\n\t\treturn fmt.Errorf(\"unsafe feature %q is not enabled. \"+\n\t\t\t\"To enable it, ensure it is allowed in the configuration or command line flags\", feature)\n\t}\n\treturn nil\n}\n","sourceCodeStart":6,"sourceCodeEnd":29,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/validator.go#L6-L29","documentation":"Error \"unsafe feature %q is not enabled. To enable it, ensure it is allowed in the configuration or command line flags\" thrown in fatedier/frp.","triggerScenarios":"Raised by ConfigValidator.ValidateUnsafeFeature in pkg/config/v1/validation/validator.go when the config uses a feature classified as unsafe that is not in the enabled unsafe-features set.","commonSituations":"A config uses an unsafe feature (e.g. certain plugins or options) without opting in. Fix by allowing the feature via the unsafe-features configuration/flags, or removing the unsafe option.","solutions":["Add the feature name to the unsafe features allow-list in the configuration or in the command line flags.","Remove the configuration that uses this unsafe feature if it is not required."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}