{"record":{"id":"a47a9880634aafe3","repo":"kubernetes/kops","slug":"reading-cilium-ipsec-config-v-v","errorCode":null,"errorMessage":"reading Cilium IPSec config %v: %v","messagePattern":"reading Cilium IPSec config (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_secret_ciliumpassword.go","lineNumber":113,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tsecretStore, err := clientset.SecretStore(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar data []byte\n\tif options.CiliumPasswordFilePath == \"-\" {\n\t\tdata, err = ConsumeStdin()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Cilium IPSec config from stdin: %v\", err)\n\t\t}\n\t} else {\n\t\tdata, err = os.ReadFile(options.CiliumPasswordFilePath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Cilium IPSec config %v: %v\", options.CiliumPasswordFilePath, err)\n\t\t}\n\t}\n\n\tvar parsedData map[string]interface{}\n\terr = kops.ParseRawYaml(data, &parsedData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse YAML %v: %v\", options.CiliumPasswordFilePath, err)\n\t}\n\n\tsecret := &fi.Secret{\n\t\tData: data,\n\t}\n\n\tif !options.Force {\n\t\t_, created, err := secretStore.GetOrCreateSecret(ctx, \"ciliumpassword\", secret)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error adding Cilium IPSec secret: %v\", err)\n\t\t}","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_secret_ciliumpassword.go#L95-L131","documentation":"This error wraps an os.ReadFile failure for the Cilium IPsec configuration file passed with -f to `kops create secret ciliumpassword`. The file could not be opened or read, so the secret cannot be built. The '-' filename value routes to stdin instead, so this only fires for real paths.","triggerScenarios":"Running `kops create secret ciliumpassword <cluster> -f <path>` where <path> does not exist, is misspelled, is a directory, or is not readable by the current user.","commonSituations":"Wrong working directory with a relative path; file deleted before the run; permissions blocked by secret-management tooling; shell expansion producing an unexpected path.","solutions":["Verify the path exists: ls -l <path>.","Use an absolute path to avoid CWD ambiguity.","Check read permissions for the invoking user.","Copy/export the config to an accessible location, then re-run."],"exampleFix":"// before\nkops create secret ciliumpassword cluster.example.com -f ./cilium.yaml\n// error: open ./cilium.yaml: no such file or directory\n// after\nkops create secret ciliumpassword cluster.example.com -f /etc/cilium/config.yaml","handlingStrategy":"validation","validationCode":"if path != \"-\" {\n    fi, err := os.Stat(path)\n    if err != nil {\n        return fmt.Errorf(\"cilium config not accessible: %w\", err)\n    }\n    if fi.IsDir() {\n        return errors.New(\"path is a directory\")\n    }\n    if fi.Size() == 0 {\n        return errors.New(\"cilium config is empty\")\n    }\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"reading Cilium IPSec config\") {\n    // surface the wrapped os error and the expanded path\n}","preventionTips":["Use absolute paths for -f.","Stat the file before invoking the command.","Only pass '-' when you really intend stdin.","Ensure the file is readable by the process user."],"tags":["file-io","cli","cilium"],"backgroundTag":"file-not-found","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}