{"record":{"id":"a2dde6bbc1db3dce","repo":"portainer/portainer","slug":"an-error-occurred-during-the-combinevolumeswithapp","errorCode":null,"errorMessage":"an error occurred during the CombineVolumesWithApplications operation, unable to list replica sets across the cluster. Error: %w","messagePattern":"an error occurred during the CombineVolumesWithApplications operation, unable to list replica sets across the cluster\\. Error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/kubernetes/cli/volumes.go","lineNumber":234,"sourceCode":"// CombineVolumesWithApplications combines the volumes with the applications that use them.\nfunc (kcl *KubeClient) CombineVolumesWithApplications(volumes *[]models.K8sVolumeInfo) (*[]models.K8sVolumeInfo, error) {\n\tpods, err := kcl.cli.CoreV1().Pods(\"\").List(context.Background(), metav1.ListOptions{})\n\tif err != nil {\n\t\tif k8serrors.IsNotFound(err) {\n\t\t\treturn volumes, nil\n\t\t}\n\t\tlog.Error().Err(err).Msg(\"Failed to list pods across the cluster\")\n\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineServicesWithApplications operation, unable to list pods across the cluster. Error: %w\", err)\n\t}\n\n\thasReplicaSetOwnerReference := containsReplicaSetOwnerReference(pods)\n\treplicaSetItems := make([]appsv1.ReplicaSet, 0)\n\tdeploymentItems := make([]appsv1.Deployment, 0)\n\tif hasReplicaSetOwnerReference {\n\t\treplicaSets, err := kcl.cli.AppsV1().ReplicaSets(\"\").List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to list replica sets across the cluster\")\n\t\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineVolumesWithApplications operation, unable to list replica sets across the cluster. Error: %w\", err)\n\t\t}\n\t\treplicaSetItems = replicaSets.Items\n\n\t\tdeployments, err := kcl.cli.AppsV1().Deployments(\"\").List(context.Background(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to list deployments across the cluster\")\n\t\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineVolumesWithApplications operation, unable to list deployments across the cluster. Error: %w\", err)\n\t\t}\n\t\tdeploymentItems = deployments.Items\n\t}\n\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)","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/kubernetes/cli/volumes.go#L216-L252","documentation":"Error \"an error occurred during the CombineVolumesWithApplications operation, unable to list replica sets across the cluster. Error: %w\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/kubernetes/cli/volumes.go:234 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"}