{"record":{"id":"546e058458a3e41d","repo":"portainer/portainer","slug":"unable-to-list-deployments-across-the-cluster-w","errorCode":null,"errorMessage":"unable to list deployments across the cluster: %w","messagePattern":"unable to list deployments across the cluster: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/kubernetes/cli/pod.go","lineNumber":293,"sourceCode":"\tpods, err := kcl.cli.CoreV1().Pods(namespace).List(context.Background(), podListOptions)\n\tif err != nil {\n\t\tif k8serrors.IsNotFound(err) {\n\t\t\treturn PortainerApplicationResources{}, nil\n\t\t}\n\t\treturn PortainerApplicationResources{}, fmt.Errorf(\"unable to list pods across the cluster: %w\", err)\n\t}\n\n\tportainerApplicationResources := PortainerApplicationResources{Pods: pods.Items}\n\n\treplicaSets, err := kcl.cli.AppsV1().ReplicaSets(namespace).List(context.Background(), metav1.ListOptions{})\n\tif err != nil && !k8serrors.IsNotFound(err) {\n\t\treturn PortainerApplicationResources{}, fmt.Errorf(\"unable to list replica sets across the cluster: %w\", err)\n\t}\n\tportainerApplicationResources.ReplicaSets = replicaSets.Items\n\n\tdeployments, err := kcl.cli.AppsV1().Deployments(namespace).List(context.Background(), metav1.ListOptions{})\n\tif err != nil && !k8serrors.IsNotFound(err) {\n\t\treturn PortainerApplicationResources{}, fmt.Errorf(\"unable to list deployments across the cluster: %w\", err)\n\t}\n\tportainerApplicationResources.Deployments = deployments.Items\n\n\tif includeStatefulSets {\n\t\tstatefulSets, err := kcl.cli.AppsV1().StatefulSets(namespace).List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil && !k8serrors.IsNotFound(err) {\n\t\t\treturn PortainerApplicationResources{}, fmt.Errorf(\"unable to list stateful sets across the cluster: %w\", err)\n\t\t}\n\t\tportainerApplicationResources.StatefulSets = statefulSets.Items\n\t}\n\n\tif includeDaemonSets {\n\t\tdaemonSets, err := kcl.cli.AppsV1().DaemonSets(namespace).List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil && !k8serrors.IsNotFound(err) {\n\t\t\treturn PortainerApplicationResources{}, fmt.Errorf(\"unable to list daemon sets across the cluster: %w\", err)\n\t\t}\n\t\tportainerApplicationResources.DaemonSets = daemonSets.Items\n\t}","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/kubernetes/cli/pod.go#L275-L311","documentation":"Error \"unable to list deployments across the cluster: %w\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/kubernetes/cli/pod.go:293 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}