LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
333 stars 157 forks source link

Bulk Data aborts when setting the ExitStatus #2018

Open prb112 opened 3 years ago

prb112 commented 3 years ago

Describe the bug The Bulk Data Exit Status is limited to 2048 characters.

.addVarcharColumn(EXITSTATUS, 2048, NULL) // EXITSTATUS VARCHAR(512) - Default was 512, we upped to 2048

The Bulk Data mutates the Exit Status and returns a single to the backend indicating success as an overloaded operation per type/input which leads to a large string that may exceed 512 and prunes

To Reproduce Steps to reproduce the behavior:

  1. Create a very large export with a large number.

Expected behavior Retrieve results in all circumstances.

Additional context n/a

0:06:46 fhir-ibmcloud-54ccff8cb-lmhw6 fhir-ibmcloud WARNING CWWKY0011W: Job bulkexportfastjob failed with batch status FAILED and exit status AdverseEvent[]:ActivityDefinition[]:Account[]:Appointment[]:AllergyIntolerance[]:AppointmentResponse[]:AuditEvent[]:Basic[]:Binary[]:BiologicallyDerivedProduct[]:BodyStructure[]:CapabilityStatement[]:CarePlan[]:CareTeam[]:CatalogEntry[]:ChargeItem[]:ChargeItemDefinition[]:ClaimResponse[]:Claim[]:ClinicalImpression[]:CodeSystem[]:Communication[]:CompartmentDefinition[]:Composition[]:CommunicationRequest[1]:ConceptMap[]:Condition[]:Consent[]:Contract[]:Coverage[]:CoverageEligibilityRequest[]:CoverageEligibilityResponse[]:DetectedIssue[]:Device[]:DeviceDefinition[]:DeviceMetric[]:DeviceRequest[]:DiagnosticReport[]:DeviceUseStatement[]:DocumentManifest[]:DocumentReference[]:DomainResource[]:EffectEvidenceSynthesis[]:Endpoint[]:Encounter[]:EnrollmentRequest[]:EnrollmentResponse[]:EventDefinition[]:EpisodeOfCare[]:EvidenceVariable[]:Evidence[]:ExampleScenario[]:ExplanationOfBenefit[]:FamilyMemberHistory[]:Flag[]:Goal[]:GraphDefinition[]:GuidanceResponse[]:HealthcareService[]:Group[1]:ImagingStudy[]:Immunization[]:ImmunizationEvaluation[]:ImmunizationRecommendation[]:ImplementationGuide[]:InsurancePlan[]:Invoice[]:Linkage[]:Library[]:List[]:Location[]:Measure[]:MeasureReport[]:Medication[]:Media[]:MedicationDispense[]:MedicationAdministration[]:MedicationKnowledge[]:MedicationRequest[]:MedicinalProduct[]:MedicationStatement[]:MedicinalProductAuthorization[]:MedicinalProductContraindication[]:MedicinalProductIngredient[]:MedicinalProductIndication[]:MedicinalProductInteraction[]:MedicinalProductManufactured[]:MedicinalProductPackaged[]:MedicinalProductPharmaceutical[]:MessageDefinition[]:MedicinalProductUndesirableEffect[]:MessageHeader[]:MolecularSequence[]:NamingSystem[]:NutritionOrder[]:Observation[]:ObservationDefinition[]:OperationDefinition[]:OperationOutcome[]:OrganizationAffiliation[]:Organization[]:Parameters[]:PaymentNotice[]:PaymentReconciliation[]:Person[]:PlanDefinition[]:Practitioner[]:PractitionerRole[]:Procedure[]:Provenance[]:Questionnaire[]:QuestionnaireResponse[]:RelatedPerson[]:RequestGroup[]:Patient[12456]:ResearchDefinition[]:ResearchElementDefinition[]:ResearchStudy[]:Resource[]:ResearchSubject[]:RiskAssessment[]:RiskEvidenceSynthesis[]:SearchParameter[]:Schedule[]:ServiceRequest[]:Slot[]:SpecimenDefinition[]:Specimen[]:StructureDefinition[]:StructureMap[]:Subscription[]:Substance[]:SubstanceNucleicAcid[]:SubstancePolymer[]:SubstanceProtein[]:SubstanceReferenceInformation[]:SubstanceSourceMaterial[]:SubstanceSpecification[]:SupplyRequest[]:SupplyDelivery[]:TerminologyCapabilities[]:Task[]:TestReport[]:TestScript[]:ValueSet[]:VerificationResult[]:VisionPrescription[] for job instance 6,281 and job execution 6,281. Mar 16 20:06:46 bulkexportfastjob[6281] AdverseEvent 0 Mar 16 20:06:46 bulkexportfastjob[6281] ActivityDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] Account 0 Mar 16 20:06:46 bulkexportfastjob[6281] Appointment 0 Mar 16 20:06:46 bulkexportfastjob[6281] AllergyIntolerance 0 Mar 16 20:06:46 bulkexportfastjob[6281] AppointmentResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] AuditEvent 0 Mar 16 20:06:46 bulkexportfastjob[6281] Basic 0 Mar 16 20:06:46 bulkexportfastjob[6281] Binary 0 Mar 16 20:06:46 bulkexportfastjob[6281] BiologicallyDerivedProduct 0 Mar 16 20:06:46 bulkexportfastjob[6281] BodyStructure 0 Mar 16 20:06:46 bulkexportfastjob[6281] CapabilityStatement 0 Mar 16 20:06:46 bulkexportfastjob[6281] CarePlan 0 Mar 16 20:06:46 bulkexportfastjob[6281] CareTeam 0 Mar 16 20:06:46 bulkexportfastjob[6281] CatalogEntry 0 Mar 16 20:06:46 bulkexportfastjob[6281] ChargeItem 0 Mar 16 20:06:46 bulkexportfastjob[6281] ChargeItemDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] ClaimResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] Claim 0 Mar 16 20:06:46 bulkexportfastjob[6281] ClinicalImpression 0 Mar 16 20:06:46 bulkexportfastjob[6281] CodeSystem 0 Mar 16 20:06:46 bulkexportfastjob[6281] Communication 0 Mar 16 20:06:46 bulkexportfastjob[6281] CompartmentDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] Composition 0 Mar 16 20:06:46 bulkexportfastjob[6281] CommunicationRequest 1 Mar 16 20:06:46 bulkexportfastjob[6281] ConceptMap 0 Mar 16 20:06:46 bulkexportfastjob[6281] Condition 0 Mar 16 20:06:46 bulkexportfastjob[6281] Consent 0 Mar 16 20:06:46 bulkexportfastjob[6281] Contract 0 Mar 16 20:06:46 bulkexportfastjob[6281] Coverage 0 Mar 16 20:06:46 bulkexportfastjob[6281] CoverageEligibilityRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] CoverageEligibilityResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] DetectedIssue 0 Mar 16 20:06:46 bulkexportfastjob[6281] Device 0 Mar 16 20:06:46 bulkexportfastjob[6281] DeviceDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] DeviceMetric 0 Mar 16 20:06:46 bulkexportfastjob[6281] DeviceRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] DiagnosticReport 0 Mar 16 20:06:46 bulkexportfastjob[6281] DeviceUseStatement 0 Mar 16 20:06:46 bulkexportfastjob[6281] DocumentManifest 0 Mar 16 20:06:46 bulkexportfastjob[6281] DocumentReference 0 Mar 16 20:06:46 bulkexportfastjob[6281] DomainResource 0 Mar 16 20:06:46 bulkexportfastjob[6281] EffectEvidenceSynthesis 0 Mar 16 20:06:46 bulkexportfastjob[6281] Endpoint 0 Mar 16 20:06:46 bulkexportfastjob[6281] Encounter 0 Mar 16 20:06:46 bulkexportfastjob[6281] EnrollmentRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] EnrollmentResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] EventDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] EpisodeOfCare 0 Mar 16 20:06:46 bulkexportfastjob[6281] EvidenceVariable 0 Mar 16 20:06:46 bulkexportfastjob[6281] Evidence 0 Mar 16 20:06:46 bulkexportfastjob[6281] ExampleScenario 0 Mar 16 20:06:46 bulkexportfastjob[6281] ExplanationOfBenefit 0 Mar 16 20:06:46 bulkexportfastjob[6281] FamilyMemberHistory 0 Mar 16 20:06:46 bulkexportfastjob[6281] Flag 0 Mar 16 20:06:46 bulkexportfastjob[6281] Goal 0 Mar 16 20:06:46 bulkexportfastjob[6281] GraphDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] GuidanceResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] HealthcareService 0 Mar 16 20:06:46 bulkexportfastjob[6281] Group 1 Mar 16 20:06:46 bulkexportfastjob[6281] ImagingStudy 0 Mar 16 20:06:46 bulkexportfastjob[6281] Immunization 0 Mar 16 20:06:46 bulkexportfastjob[6281] ImmunizationEvaluation 0 Mar 16 20:06:46 bulkexportfastjob[6281] ImmunizationRecommendation 0 Mar 16 20:06:46 bulkexportfastjob[6281] ImplementationGuide 0 Mar 16 20:06:46 bulkexportfastjob[6281] InsurancePlan 0 Mar 16 20:06:46 bulkexportfastjob[6281] Invoice 0 Mar 16 20:06:46 bulkexportfastjob[6281] Linkage 0 Mar 16 20:06:46 bulkexportfastjob[6281] Library 0 Mar 16 20:06:46 bulkexportfastjob[6281] List 0 Mar 16 20:06:46 bulkexportfastjob[6281] Location 0 Mar 16 20:06:46 bulkexportfastjob[6281] Measure 0 Mar 16 20:06:46 bulkexportfastjob[6281] MeasureReport 0 Mar 16 20:06:46 bulkexportfastjob[6281] Medication 0 Mar 16 20:06:46 bulkexportfastjob[6281] Media 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicationDispense 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicationAdministration 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicationKnowledge 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicationRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProduct 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicationStatement 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductAuthorization 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductContraindication 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductIngredient 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductIndication 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductInteraction 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductManufactured 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductPackaged 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductPharmaceutical 0 Mar 16 20:06:46 bulkexportfastjob[6281] MessageDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] MedicinalProductUndesirableEffect 0 Mar 16 20:06:46 bulkexportfastjob[6281] MessageHeader 0 Mar 16 20:06:46 bulkexportfastjob[6281] MolecularSequence 0 Mar 16 20:06:46 bulkexportfastjob[6281] NamingSystem 0 Mar 16 20:06:46 bulkexportfastjob[6281] NutritionOrder 0 Mar 16 20:06:46 bulkexportfastjob[6281] Observation 0 Mar 16 20:06:46 bulkexportfastjob[6281] ObservationDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] OperationDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] OperationOutcome 0 Mar 16 20:06:46 bulkexportfastjob[6281] OrganizationAffiliation 0 Mar 16 20:06:46 bulkexportfastjob[6281] Organization 0 Mar 16 20:06:46 bulkexportfastjob[6281] Parameters 0 Mar 16 20:06:46 bulkexportfastjob[6281] PaymentNotice 0 Mar 16 20:06:46 bulkexportfastjob[6281] PaymentReconciliation 0 Mar 16 20:06:46 bulkexportfastjob[6281] Person 0 Mar 16 20:06:46 bulkexportfastjob[6281] PlanDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] Practitioner 0 Mar 16 20:06:46 bulkexportfastjob[6281] PractitionerRole 0 Mar 16 20:06:46 bulkexportfastjob[6281] Procedure 0 Mar 16 20:06:46 bulkexportfastjob[6281] Provenance 0 Mar 16 20:06:46 bulkexportfastjob[6281] Questionnaire 0 Mar 16 20:06:46 bulkexportfastjob[6281] QuestionnaireResponse 0 Mar 16 20:06:46 bulkexportfastjob[6281] RelatedPerson 0 Mar 16 20:06:46 bulkexportfastjob[6281] RequestGroup 0 Mar 16 20:06:46 bulkexportfastjob[6281] Patient 12456 Mar 16 20:06:46 bulkexportfastjob[6281] ResearchDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] ResearchElementDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] ResearchStudy 0 Mar 16 20:06:46 bulkexportfastjob[6281] Resource 0 Mar 16 20:06:46 bulkexportfastjob[6281] ResearchSubject 0 Mar 16 20:06:46 bulkexportfastjob[6281] RiskAssessment 0 Mar 16 20:06:46 bulkexportfastjob[6281] RiskEvidenceSynthesis 0 Mar 16 20:06:46 bulkexportfastjob[6281] SearchParameter 0 Mar 16 20:06:46 bulkexportfastjob[6281] Schedule 0 Mar 16 20:06:46 bulkexportfastjob[6281] ServiceRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] Slot 0 Mar 16 20:06:46 bulkexportfastjob[6281] SpecimenDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] Specimen 0 Mar 16 20:06:46 bulkexportfastjob[6281] StructureDefinition 0 Mar 16 20:06:46 bulkexportfastjob[6281] StructureMap 0 Mar 16 20:06:46 bulkexportfastjob[6281] Subscription 0 Mar 16 20:06:46 bulkexportfastjob[6281] Substance 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstanceNucleicAcid 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstancePolymer 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstanceProtein 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstanceReferenceInformation 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstanceSourceMaterial 0 Mar 16 20:06:46 bulkexportfastjob[6281] SubstanceSpecification 0 Mar 16 20:06:46 bulkexportfastjob[6281] SupplyRequest 0 Mar 16 20:06:46 bulkexportfastjob[6281] SupplyDelivery 0 Mar 16 20:06:46 bulkexportfastjob[6281] TerminologyCapabilities 0 Mar 16 20:06:46 bulkexportfastjob[6281] Task 0 Mar 16 20:06:46 bulkexportfastjob[6281] TestReport 0 Mar 16 20:06:46 bulkexportfastjob[6281] TestScript 0 Mar 16 20:06:46 bulkexportfastjob[6281] ValueSet 0 Mar 16 20:06:46 bulkexportfastjob[6281] VerificationResult 0 Mar 16 20:06:46 bulkexportfastjob[6281] VisionPrescription 0 Mar 16 20:06:46 bulkexportfastjob[6281] -------------------------------- ---------- Mar 16 20:06:46 bulkexportfastjob[6281] TOTAL 12458 Mar 16 20:06:46 fhir-ibmcloud-54ccff8cb-lmhw6 fhir-ibmcloud ERROR WTRN0074E: Exception caught from before_completion synchronization operation: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.ibm.db2.jcc.am.SqlDataException: The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use.. SQLCODE=-302, SQLSTATE=22001, DRIVER=4.28.11 Error Code: -302 Call: UPDATE FHIR_JBATCH.JOBINSTANCE SET BATCHSTATUS = ?, EXITSTATUS = ?, INSTANCESTATE = ?, UPDATETIME = ? WHERE (JOBINSTANCEID = ?) bind => [5 parameters bound] Query: UpdateObjectQuery(For JobInstanceEntity: instanceId = 6281, batchStatus = FAILED, instanceState = FAILED) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl$1.handleException(EntityManagerSetupImpl.java:787) at org.eclipse.persistence.transaction.AbstractSynchronizationListener.handleException(AbstractSynchronizationListener.java:277) at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:172) at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:70) at com.ibm.tx.jta.impl.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:247) at com.ibm.tx.jta.impl.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:148) at com.ibm.tx.jta.impl.TransactionImpl.prePrepare(TransactionImpl.java:1402) at com.ibm.tx.jta.impl.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:793) at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:768) at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:711) at com.ibm.tx.jta.impl.TranManagerImpl.commit(TranManagerImpl.java:165) at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:113) at com.ibm.ws.transaction.services.TransactionManagerService.commit(TransactionManagerService.java:293) at com.ibm.jbatch.container.services.impl.JPAPersistenceManagerImpl$TranRequest.commitIfNewTranWasStarted(JPAPersistenceManagerImpl.java:2825) at com.ibm.jbatch.container.services.impl.JPAPersistenceManagerImpl$TranRequest.runInNewOrExistingGlobalTran(JPAPersistenceManagerImpl.java:2789) at com.ibm.jbatch.container.services.impl.JPAPersistenceManagerImpl.updateJobExecutionAndInstanceFinalStatus(JPAPersistenceManagerImpl.java:1183) at com.ibm.jbatch.container.services.impl.JPAPersistenceManagerImpl.updateJobExecutionAndInstanceOnEnd(JPAPersistenceManagerImpl.java:1133) at com.ibm.jbatch.container.execution.impl.RuntimeJobExecution.workEnded(RuntimeJobExecution.java:189) at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.persistWorkUnitBatchAndExitStatus(WorkUnitThreadControllerImpl.java:320) at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.endOfWorkUnit(WorkUnitThreadControllerImpl.java:292) at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.executeWorkUnit(WorkUnitThreadControllerImpl.java:210) at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl$AbstractControllerHelper.runExecutionOnThread(WorkUnitThreadControllerImpl.java:503) at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.runExecutionOnThread(WorkUnitThreadControllerImpl.java:92) at com.ibm.jbatch.container.util.BatchWorkUnit.run(BatchWorkUnit.java:113) at com.ibm.ws.context.service.serializable.ContextualRunnable.run(ContextualRunnable.java:79) at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:239) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:823) Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.ibm.db2.jcc.am.SqlDataException: The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use.. SQLCODE=-302, SQLSTATE=22001, DRIVER=4.28.11 Error Code: -302

lmsurpre commented 3 years ago

Question: do we need backwards compatibility with previously-completed jobs?

Answer: we think its probably not worth the effort. Would be an extra couple hours to code up, but also more testing, etc.