{"record":{"id":"bff90a0ec976d301","repo":"portainer/portainer","slug":"failed-to-convert-pod-to-application-w","errorCode":null,"errorMessage":"failed to convert pod to application: %w","messagePattern":"failed to convert pod to application: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/kubernetes/cli/persistent_volume_claims.go","lineNumber":279,"sourceCode":"\tresources := PortainerApplicationResources{\n\t\tReplicaSets:  replicaSetItems,\n\t\tDeployments:  deploymentItems,\n\t\tStatefulSets: statefulSetItems,\n\t\tDaemonSets:   daemonSetItems,\n\t}\n\n\tfor i := range pvcs {\n\t\tfor _, pod := range pods.Items {\n\t\t\tfor _, podVolume := range pod.Spec.Volumes {\n\t\t\t\tif podVolume.PersistentVolumeClaim == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif podVolume.PersistentVolumeClaim.ClaimName != pvcs[i].Name || pod.Namespace != pvcs[i].Namespace {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tapplication, err := kcl.ConvertPodToApplication(pod, resources, false)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to convert pod to application: %w\", err)\n\t\t\t\t}\n\t\t\t\tif application == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\talreadyAdded := false\n\t\t\t\tfor _, existing := range pvcs[i].OwningApplications {\n\t\t\t\t\tif existing.Name == application.Name && existing.Namespace == application.Namespace {\n\t\t\t\t\t\talreadyAdded = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !alreadyAdded {\n\t\t\t\t\tpvcs[i].OwningApplications = append(pvcs[i].OwningApplications, *application)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/kubernetes/cli/persistent_volume_claims.go#L261-L297","documentation":"Error \"failed to convert pod to application: %w\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/kubernetes/cli/persistent_volume_claims.go:279 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"}