{"record":{"id":"d9e3d8ee0aaa7218","repo":"larksuite/cli","slug":"unsupported-file-provider-mode-q","errorCode":null,"errorMessage":"unsupported file provider mode %q","messagePattern":"unsupported file provider mode %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/binding/secret_resolve_file.go","lineNumber":103,"sourceCode":"\t\tvar parsed interface{}\n\t\tif err := json.Unmarshal(data, &parsed); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"file provider JSON parse error: %w\", err)\n\t\t}\n\n\t\tvalue, err := ReadJSONPointer(parsed, ref.ID)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"file provider JSON Pointer %q: %w\", ref.ID, err)\n\t\t}\n\n\t\t// Value must be a string\n\t\tstrValue, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"file provider JSON Pointer %q resolved to non-string value\", ref.ID)\n\t\t}\n\t\treturn strValue, nil\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported file provider mode %q\", mode)\n\t}\n}\n","sourceCodeStart":85,"sourceCodeEnd":106,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/binding/secret_resolve_file.go#L85-L106","documentation":"The file provider only supports the modes \"singleValue\" and \"json\" (with \"\" defaulting to \"json\"). Any other ProviderConfig.Mode string is rejected. This catches typos and unsupported provider dialects early instead of guessing a resolution strategy.","triggerScenarios":"Calling resolveSecretRef with a {source:\"file\"} SecretRef whose ProviderConfig.Mode is any string other than \"singleValue\", \"json\", or empty — e.g. \"single-value\", \"raw\", \"yaml\", or \"text\".","commonSituations":"Typo like \"single_value\" or \"single-value\"; copying config from another tool that supports more modes; IDE autocomplete inventing a mode name; older/newer config format drift.","solutions":["Set Mode to \"json\" (default) or \"singleValue\" — exact spelling matters.","Remove the Mode field entirely to get the json default.","If you need a new mode, extend the switch in resolveFileRef and its tests rather than passing an unknown value."],"exampleFix":"// before\nmode: single-value\n// after\nmode: singleValue\n// or omit mode entirely for the json default","handlingStrategy":"validation","validationCode":"switch pc.Mode {\ncase \"\", \"json\", \"singleValue\":\n    // ok\ndefault:\n    return fmt.Errorf(\"file provider mode %q not supported; use json or singleValue\", pc.Mode)\n}","typeGuard":"func validFileMode(m string) bool { return m == \"\" || m == \"json\" || m == \"singleValue\" }","tryCatchPattern":"secret, err := resolveSecretRef(ctx, ref)\nif err != nil {\n    if strings.Contains(err.Error(), \"unsupported file provider mode\") {\n        // correct the mode spelling in the provider config\n    }\n    return err\n}","preventionTips":["Use only \"json\" (or omit) and \"singleValue\" — check exact spelling and camelCase.","Add a config schema/enum check for Mode at load time.","When porting config from other tools, map their mode names to this library's two supported modes."],"tags":["secrets","file-provider","config","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}