{"record":{"id":"85ab9718d66f53b4","repo":"cilium/cilium","slug":"failed-to-collect-gateway-entries-w","errorCode":null,"errorMessage":"failed to collect Gateway entries: %w","messagePattern":"failed to collect Gateway entries: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/sysdump/sysdump.go","lineNumber":2134,"sourceCode":"\t\t\t\tn := corev1.NamespaceAll\n\t\t\t\tv, err := c.Client.ListUnstructured(ctx, gatewayClass, &n, metav1.ListOptions{})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect GatewayClass entries: %w\", err)\n\t\t\t\t}\n\t\t\t\tif err := c.WriteYAML(gatewayClassesFileName, v); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect GatewayClass entries: %w\", err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tDescription: \"Collecting Gateway entries\",\n\t\t\tQuick:       true,\n\t\t\tTask: func(ctx context.Context) error {\n\t\t\t\tn := corev1.NamespaceAll\n\t\t\t\tv, err := c.Client.ListUnstructured(ctx, gateway, &n, metav1.ListOptions{})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect Gateway entries: %w\", err)\n\t\t\t\t}\n\t\t\t\tif err := c.WriteYAML(gatewaysFileName, v); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect Gateway entries: %w\", err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tDescription: \"Collecting ListenerSet entries\",\n\t\t\tQuick:       true,\n\t\t\tTask: func(ctx context.Context) error {\n\t\t\t\tn := corev1.NamespaceAll\n\t\t\t\tv, err := c.Client.ListUnstructured(ctx, listenerSet, &n, metav1.ListOptions{})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect ListenerSet entries: %w\", err)\n\t\t\t\t}\n\t\t\t\tif err := c.WriteYAML(listenerSetsFileName, v); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect ListenerSet entries: %w\", err)","sourceCodeStart":2116,"sourceCodeEnd":2152,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/sysdump/sysdump.go#L2116-L2152","documentation":"Thrown when the cilium-cli sysdump collector fails to list Gateway resources (namespaced, all namespaces) via the dynamic client. The Kubernetes API error from ListUnstructured is wrapped with %w.","triggerScenarios":"c.Client.ListUnstructured(ctx, gateway, &corev1.NamespaceAll, metav1.ListOptions{}) returns an error: Gateway API CRDs not installed, RBAC denial on gateways list, or API server connectivity failure.","commonSituations":"Cluster lacking the gateway.networking.k8s.io Gateway CRD (only GatewayClass installed, or experimental channel missing); user lacking read access across namespaces; wrong cluster context.","solutions":["Check: kubectl get gateways -A; if the resource is not found, install the full Gateway API CRD bundle.","Verify RBAC: kubectl auth can-i list gateways --all-namespaces.","Confirm kubeconfig points at the intended cluster (kubectl config current-context).","If Gateways are not used, ignore this missing entry in the sysdump."],"exampleFix":"// before\nkubectl get gateways -A  # no matches / not found\n// after\nkubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml","handlingStrategy":"validation","validationCode":"kubectl get crd gateways.gateway.networking.k8s.io && kubectl auth can-i list gateways -A","typeGuard":null,"tryCatchPattern":"v, err := c.Client.ListUnstructured(ctx, gateway, &n, metav1.ListOptions{})\nif err != nil {\n    if meta.IsNoMatchError(err) || k8sErrors.IsNotFound(err) { return nil }\n    return fmt.Errorf(\"failed to collect Gateway entries: %w\", err)\n}","preventionTips":["Install the full Gateway API CRD bundle (not only GatewayClass).","Verify with kubectl api-resources | grep gateways.","Grant cross-namespace list permission to the collecting user.","Point kubeconfig at the correct cluster."],"tags":["kubernetes","gateway-api","crd","sysdump"],"backgroundTag":"crd-not-installed","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}