{"record":{"id":"a883eb117c5bce7c","repo":"kubernetes/kops","slug":"error-reading-addons-from-q-v","errorCode":null,"errorMessage":"error reading addons from %q: %v","messagePattern":"error reading addons from %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/addons.go","lineNumber":42,"sourceCode":"\t\"github.com/blang/semver/v4\"\n\t\"k8s.io/klog/v2\"\n\t\"k8s.io/kops/channels/pkg/api\"\n\t\"k8s.io/kops/pkg/kubemanifest\"\n\t\"k8s.io/kops/upup/pkg/fi/utils\"\n\t\"k8s.io/kops/util/pkg/vfs\"\n)\n\ntype Addons struct {\n\tChannelName     string\n\tChannelLocation url.URL\n\tAPIObject       *api.Addons\n}\n\nfunc LoadAddons(vfsContext *vfs.VFSContext, name string, location *url.URL) (*Addons, error) {\n\tklog.V(2).Infof(\"Loading addons channel from %q\", location)\n\tdata, err := vfsContext.ReadFile(location.String())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading addons from %q: %v\", location, err)\n\t}\n\n\treturn ParseAddons(name, location, data)\n}\n\nfunc ParseAddons(name string, location *url.URL, data []byte) (*Addons, error) {\n\tconfigString := strings.TrimSpace(string(data))\n\n\tobjects, err := kubemanifest.LoadObjectsFrom([]byte(configString))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing addons or manifest: %v\", err)\n\t}\n\n\tapiObject := &api.Addons{}\n\tif len(objects) == 0 {\n\t\t// No objects (empty, whitespace, or comment-only content): nothing to apply.\n\t} else if gvk := objects[0].GroupVersionKind(); gvk.Kind == \"Addons\" && gvk.Group == \"\" && gvk.Version == \"\" {\n\t\t// Reuse the document already parsed by LoadObjectsFrom instead of parsing it again.","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/addons.go#L24-L60","documentation":"LoadAddons reads the addons channel YAML from a VFS location (local path, s3, HTTP, etc.) and wraps any read failure. This is a fetch-level error: the addons manifest content could not be retrieved at all, before any parsing happens.","triggerScenarios":"LoadAddons(name, location) -> vfsContext.ReadFile(location.String()) fails: file does not exist, S3/GCS object missing or access denied, bad URL scheme, network timeout, or malformed VFS base path.","commonSituations":"Typo in the addons manifest URL; S3 credentials not configured; offline environment; channel file deleted or renamed after the cluster spec referenced it; kops upgrade changing default channel paths.","solutions":["Verify the addons location URL/protocol and that the object exists (aws s3 ls / curl the URL).","Fix cloud credentials for the storage backend (S3/GCS) hosting the channel.","Re-upload the addons file or point the cluster spec at a valid channel (e.g. the default kops addons location).","Check VFS base path flags so relative locations resolve correctly."],"exampleFix":"# before: cluster spec\naddons:\n- manifest: s3://my-bucket/addons/typo-name.yaml\n# after\naddons:\n- manifest: s3://my-bucket/addons/networking.amazon-vpc-routed-eni.yaml","handlingStrategy":"validation","validationCode":"u, err := url.Parse(addonsLocation)\nif err != nil || u.String() == \"\" {\n\treturn fmt.Errorf(\"invalid addons location: %q\", addonsLocation)\n}\n// for s3: pre-check object existence, e.g. aws s3 ls s3://bucket/path/addons.yaml","typeGuard":null,"tryCatchPattern":"addons, err := channels.LoadAddons(vfsContext, name, location)\nif err != nil {\n\tif strings.Contains(err.Error(), \"error reading addons\") {\n\t\treturn fmt.Errorf(\"check addons URL %q and storage credentials: %w\", location, err)\n\t}\n\treturn err\n}","preventionTips":["Pin addon manifest URLs to storage you control and monitor.","Validate cloud credentials (AWS_PROFILE, IRSA) before applying.","Use kops' default channels unless a custom channel is required.","Add a pre-flight existence check for s3/http locations."],"tags":["vfs","storage","s3","file-not-found"],"backgroundTag":"manifest-read-failed","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"}