{"record":{"id":"209dacfec666510c","repo":"cloudflare/cloudflared","slug":"option-type-generic-not-supported","errorCode":null,"errorMessage":"option type Generic not supported","messagePattern":"option type Generic not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/configuration.go","lineNumber":362,"sourceCode":"\t\t\tfor i, v := range slice {\n\t\t\t\tstr, ok := v.(int)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"expected int, found %T for %v \", v, v)\n\t\t\t\t}\n\t\t\t\tintSlice[i] = str\n\t\t\t}\n\t\t\treturn intSlice, nil\n\t\t}\n\t\tif v, ok := raw.([]int); ok {\n\t\t\treturn v, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"expected int slice found %T for %s\", raw, name)\n\t}\n\treturn nil, nil\n}\n\nfunc (c *configFileSettings) Generic(name string) (cli.Generic, error) {\n\treturn nil, errors.New(\"option type Generic not supported\")\n}\n\nfunc (c *configFileSettings) Bool(name string) (bool, error) {\n\tif raw, ok := c.Settings[name]; ok {\n\t\tif v, ok := raw.(bool); ok {\n\t\t\treturn v, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"expected boolean found %T for %s\", raw, name)\n\t}\n\treturn false, nil\n}\n\nvar configuration configFileSettings\n\nfunc GetConfiguration() *Configuration {\n\treturn &configuration.Configuration\n}\n","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/config/configuration.go#L344-L380","documentation":"configFileSettings is the configuration-file adapter that satisfies the cli flag-source interface used to feed file-based settings into urfave/cli. Generic is the accessor for urfave/cli's generic flag type, which the file-settings backend does not implement, so it always returns this error. It exists only to satisfy the interface.","triggerScenarios":"A configuration file defines a flag whose type resolves to the cli.Generic interface, and code calls configFileSettings.Generic(name) to read it (or the flag-source machinery routes a lookup to Generic).","commonSituations":"A user puts an option in config.yml whose corresponding CLI flag is a Generic/placeholder type; custom code built on cloudflared's config package reads a settings map through the cli flag-source interface.","solutions":["Remove the offending option from the config file, or express its value with a supported type (string, bool, int, duration, string slice)","Do not call Generic on config-file settings; read such values directly from the settings map instead","Check which flag maps to a Generic type in the urfave/cli command definition and avoid setting it via the config file"],"exampleFix":"# before (config.yml)\nsome-generic-option:\n  key: value\n# after\n# remove the option or use a supported scalar/list type\nsome-string-option: value","handlingStrategy":"type-guard","validationCode":"if _, isGeneric := flagValue.(cli.Generic); isGeneric {\n    return errors.New(\"generic flags cannot be set from the config file\")\n}","typeGuard":"func isUnsupportedGenericAccessor(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"option type Generic not supported\")\n}","tryCatchPattern":"val, err := settings.Generic(name)\nif err != nil && strings.Contains(err.Error(), \"Generic not supported\") {\n    // fall back to a supported accessor: settings.String(name), etc.\n}","preventionTips":["Only use scalar/list config keys supported by the file-settings adapter","Never route cli.Generic flags through config-file settings","Map generic flags to explicit supported types in your config schema"],"tags":["config","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}