{"record":{"id":"ae9a80e740c85c84","repo":"apache/beam","slug":"couldn-t-find-message-s","errorCode":null,"errorMessage":"Couldn't find message: %s.","messagePattern":"Couldn't find message: (.+?)\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HttpHealthcareApiClient.java","lineNumber":424,"sourceCode":"      return baseRequest.execute();\n    } else {\n      return baseRequest.setOrderBy(orderBy).execute();\n    }\n  }\n\n  /**\n   * Gets HL7v2 message.\n   *\n   * @param msgName the msg name\n   * @return the message\n   * @throws IOException the io exception\n   */\n  @Override\n  public Message getHL7v2Message(String msgName) throws IOException {\n    Message msg =\n        client.projects().locations().datasets().hl7V2Stores().messages().get(msgName).execute();\n    if (msg == null) {\n      throw new IOException(String.format(\"Couldn't find message: %s.\", msgName));\n    }\n    return msg;\n  }\n\n  @Override\n  public Empty deleteHL7v2Message(String msgName) throws IOException {\n    return client\n        .projects()\n        .locations()\n        .datasets()\n        .hl7V2Stores()\n        .messages()\n        .delete(msgName)\n        .execute();\n  }\n\n  /**\n   * Gets HL7v2 store.","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HttpHealthcareApiClient.java#L406-L442","documentation":"HttpHealthcareApiClient.getHL7v2Message performs a direct GET of an HL7v2 message by its resource name. If the HTTP client returns null (no message model deserialized), the method throws IOException with the message name, translating a null API result into the checked IO error the interface declares.","triggerScenarios":"getHL7v2Message(msgName) is called and the underlying Healthcare API client execute() returns null — the message resource name does not resolve (deleted message, malformed msgName, wrong store), or the response body was empty.","commonSituations":"Consuming notification payloads whose messages have already been ACKed and deleted; building msgName strings by hand with wrong project/dataset/store segments; permissions issues surfacing as empty rather than error responses.","solutions":["Verify the full message resource name (projects/*/locations/*/datasets/*/hl7V2Stores/*/messages/*) is correct and the message still exists.","Retry briefly and check store configuration — deleted messages cannot be recovered; rely on dead-letter handling for missing messages.","Catch the IOException in the caller and skip/dead-letter the message instead of failing the pipeline.","Confirm service-account permissions on the store (view access)."],"exampleFix":"// before\nMessage m = client.getHL7v2Message(name); // IOException if null\n\n// after\nMessage m;\ntry {\n  m = client.getHL7v2Message(name);\n} catch (IOException e) {\n  LOG.warn(\"Message {} not found; skipping\", name);\n  return null;\n}","handlingStrategy":"try-catch","validationCode":"if (msgName == null || !msgName.startsWith(\"projects/\")) {\n  throw new IllegalArgumentException(\"Malformed HL7v2 message name: \" + msgName);\n}","typeGuard":null,"tryCatchPattern":"try {\n  Message msg = client.getHL7v2Message(msgName);\n} catch (IOException e) {\n  LOG.warn(\"Message {} not found: {}\", msgName, e.getMessage());\n  // skip or dead-letter\n}","preventionTips":["Validate message resource names before GET.","Expect deleted/acked messages in notification-driven consumers and handle gracefully.","Check IAM permissions if lookups consistently return nothing."],"tags":["java","google-cloud-healthcare","hl7v2","io","entity-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}