{"record":{"id":"ff87abc5ce13cfed","repo":"portainer/portainer","slug":"an-error-occurred-during-the-combinevolumeswithapp-ff87ab","errorCode":null,"errorMessage":"an error occurred during the CombineVolumesWithApplications operation, unable to list daemon sets across the cluster. Error: %w","messagePattern":"an error occurred during the CombineVolumesWithApplications operation, unable to list daemon sets across the cluster\\. Error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/kubernetes/cli/volumes.go","lineNumber":263,"sourceCode":"\n\thasStatefulSetOwnerReference := containsStatefulSetOwnerReference(pods)\n\tstatefulSetItems := make([]appsv1.StatefulSet, 0)\n\tif hasStatefulSetOwnerReference {\n\t\tstatefulSets, err := kcl.cli.AppsV1().StatefulSets(\"\").List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to list stateful sets across the cluster\")\n\t\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineVolumesWithApplications operation, unable to list stateful sets across the cluster. Error: %w\", err)\n\t\t}\n\t\tstatefulSetItems = statefulSets.Items\n\t}\n\n\thasDaemonSetOwnerReference := containsDaemonSetOwnerReference(pods)\n\tdaemonSetItems := make([]appsv1.DaemonSet, 0)\n\tif hasDaemonSetOwnerReference {\n\t\tdaemonSets, err := kcl.cli.AppsV1().DaemonSets(\"\").List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to list daemon sets across the cluster\")\n\t\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineVolumesWithApplications operation, unable to list daemon sets across the cluster. Error: %w\", err)\n\t\t}\n\t\tdaemonSetItems = daemonSets.Items\n\t}\n\n\treturn kcl.updateVolumesWithOwningApplications(volumes, pods, deploymentItems, replicaSetItems, statefulSetItems, daemonSetItems)\n}\n\n// updateVolumesWithOwningApplications updates the volumes with the applications that use them.\nfunc (kcl *KubeClient) updateVolumesWithOwningApplications(volumes *[]models.K8sVolumeInfo, pods *corev1.PodList, deploymentItems []appsv1.Deployment, replicaSetItems []appsv1.ReplicaSet, statefulSetItems []appsv1.StatefulSet, daemonSetItems []appsv1.DaemonSet) (*[]models.K8sVolumeInfo, error) {\n\tfor i, volume := range *volumes {\n\t\tfor _, pod := range pods.Items {\n\t\t\tif pod.Spec.Volumes != nil {\n\t\t\t\tfor _, podVolume := range pod.Spec.Volumes {\n\t\t\t\t\tif podVolume.PersistentVolumeClaim != nil && podVolume.PersistentVolumeClaim.ClaimName == volume.PersistentVolumeClaim.Name && pod.Namespace == volume.PersistentVolumeClaim.Namespace {\n\t\t\t\t\t\tapplication, err := kcl.ConvertPodToApplication(pod, PortainerApplicationResources{\n\t\t\t\t\t\t\tReplicaSets:  replicaSetItems,\n\t\t\t\t\t\t\tDeployments:  deploymentItems,\n\t\t\t\t\t\t\tStatefulSets: statefulSetItems,","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/kubernetes/cli/volumes.go#L245-L281","documentation":"Error \"an error occurred during the CombineVolumesWithApplications operation, unable to list daemon sets across the cluster. Error: %w\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/kubernetes/cli/volumes.go:263 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"}