{"record":{"id":"6d5ed8ad746a5b90","repo":"apache/beam","slug":"hl7v2io","errorCode":null,"errorMessage":"{} {}","messagePattern":"\\{\\} \\{\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IO.java","lineNumber":962,"sourceCode":"        Message model = new Message();\n        model.setData(msg.getData());\n        model.setLabels(msg.getLabels());\n        switch (writeMethod) {\n          case BATCH_IMPORT:\n            // TODO: add support for HL7v2 import.\n            throw new UnsupportedOperationException(\"The batch import API is not supported yet\");\n          case INGEST:\n          default:\n            try {\n              long requestTimestamp = Instant.now().getMillis();\n              client.ingestHL7v2Message(hl7v2Store.get(), model);\n              successfulHL7v2MessageWrites.inc();\n              messageIngestLatencyMs.update(Instant.now().getMillis() - requestTimestamp);\n            } catch (Exception e) {\n              failedMessageWrites.inc();\n              LOG.warn(\"Failed to ingest message\", e);\n              HealthcareIOError<HL7v2Message> err = HealthcareIOError.of(msg, e);\n              LOG.warn(\"{} {}\", err.getErrorMessage(), err.getStackTrace());\n              context.output(err);\n            }\n        }\n      }\n    }\n  }\n}\n","sourceCodeStart":944,"sourceCodeEnd":970,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IO.java#L944-L970","documentation":"Companion log to 'Failed to ingest message': after a failed HL7v2 ingestion, the pipeline logs the HealthcareIOError's error message and stack trace via a generic '{} {}' format. It is diagnostic output only, immediately followed by emitting the error to the error output PCollection.","triggerScenarios":"Same as error 6053: any Exception from client.ingestHL7v2Message in the HL7v2IO Write DoFn; this line fires right after the failure is recorded.","commonSituations":"Debugging pipelines where HL7v2 messages land on the error output — this line carries the detailed reason (API status, parse failure) that the first log line omits.","solutions":["Read this log line's first placeholder (err.getErrorMessage()) to learn the concrete ingestion failure cause","Set up a sink on the error output PCollection to persist errors for analysis instead of relying on worker logs","Fix the root cause identified (permissions, store path, message validity) and replay the failed messages"],"exampleFix":"// before\nLOG.warn(\"{} {}\", err.getErrorMessage(), err.getStackTrace());\n// after\nLOG.warn(\"Failed to ingest HL7v2 message {}: {}\", msg.getId(), err.getErrorMessage(), err);","handlingStrategy":"try-catch","validationCode":"// same guard as the ingest call\nif (!isValidHl7v2(model)) throw new IllegalArgumentException(\"malformed HL7v2 payload\");","typeGuard":null,"tryCatchPattern":"catch (Exception e) {\n  HealthcareIOError<HL7v2Message> err = HealthcareIOError.of(msg, e);\n  LOG.warn(\"HL7v2 ingest failed for {}: {}\", msg.getId(), err.getErrorMessage(), e);\n  context.output(err);\n}","preventionTips":["Log structured fields (message id, status code) instead of concatenating message + stack trace","Route error output to monitoring, not just worker logs","Fix the root cause reported by err.getErrorMessage() before replaying messages"],"tags":["gcp","healthcare","hl7v2","logging"],"backgroundTag":"api-request-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}