{"record":{"id":"3445ad004286b054","repo":"portainer/portainer","slug":"an-error-occurred-during-the-combineserviceswithap-3445ad","errorCode":null,"errorMessage":"an error occurred during the CombineServicesWithApplications operation, unable to convert pod to application. Error: %w","messagePattern":"an error occurred during the CombineServicesWithApplications operation, unable to convert pod to application\\. Error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/kubernetes/cli/volumes.go","lineNumber":286,"sourceCode":"\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,\n\t\t\t\t\t\t\tDaemonSets:   daemonSetItems,\n\t\t\t\t\t\t}, false)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Error().Err(err).Msg(\"Failed to convert pod to application\")\n\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"an error occurred during the CombineServicesWithApplications operation, unable to convert pod to application. Error: %w\", err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Check if the application already exists in the OwningApplications slice\n\t\t\t\t\t\texists := false\n\t\t\t\t\t\tfor _, existingApp := range (*volumes)[i].PersistentVolumeClaim.OwningApplications {\n\t\t\t\t\t\t\tif existingApp.Name == application.Name && existingApp.Namespace == application.Namespace {\n\t\t\t\t\t\t\t\texists = true\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !exists && application != nil {\n\t\t\t\t\t\t\t(*volumes)[i].PersistentVolumeClaim.OwningApplications = append((*volumes)[i].PersistentVolumeClaim.OwningApplications, *application)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn volumes, nil","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/kubernetes/cli/volumes.go#L268-L304","documentation":"Error \"an error occurred during the CombineServicesWithApplications operation, unable to convert pod to application. Error: %w\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/kubernetes/cli/volumes.go:286 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"}