Google Healthcare API on GKE with PubSub - INVALID_ARGUMENT

4/11/2019

We have been testing out the Google Healthcare API specifically with HL7 and as I've run through the tutorials I've hit a roadblock. I should mention that I have a fair bit of experience with Kubernetes and AWS, but not so much Google Cloud.

This step here is what is giving me trouble:

https://cloud.google.com/healthcare/docs/how-tos/mllp-adapter#creating_a_compute_engine_vm_and_sending_messages

When I attempt to send the message from the VM I do not see a response, and the logs in the pod show me the following error:

I0411 17:27:33.756432       1 healthapiclient.go:163] Dialing connection to https://healthcare.googleapis.com:443/v1beta1
I0411 17:27:58.809932       1 mllpreceiver.go:107] Accepted connection from 10.128.0.5:58698
I0411 17:27:58.810140       1 healthapiclient.go:182] Sending message of size 319.
E0411 17:27:58.880369       1 mllpreceiver.go:118] handleMessage: Send: request failed: 400
{
  "error": {
    "code": 400,
    "message": "location ID invalid, expected us-central1",
    "status": "INVALID_ARGUMENT"
  }
}
I0411 17:27:58.880691       1 mllpreceiver.go:119] Closed connection from 10.128.0.5:58698

This error is perplexing because the GKE cluster and the VM are in the same region/zone. Has anyone experienced a similar issue with the MLLP adapter and GKE?

-- damianesteban
google-cloud-healthcare
google-cloud-pubsub
google-kubernetes-engine
hl7
kubernetes

2 Answers

4/12/2019

The issue was the way I was specifying the location/zone:

Initially my template was like this:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mllp-adapter-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: mllp-adapter
    spec:
      containers:
        - name: mllp-adapter
          imagePullPolicy: Always
          image: gcr.io/cloud-healthcare-containers/mllp-adapter
          ports:
            - containerPort: 2575
              protocol: TCP
              name: "port"
          command:
            - "/usr/mllp_adapter/mllp_adapter"
            - "--port=2575"
            - "--hl7_v2_project_id=XXXXXXXXXXXXX"
            - "--hl7_v2_location_id=us-central1-b"
            - "--hl7_v2_dataset_id=XXX-test-set"
            - "--hl7_v2_store_id=hlstore"
            - "--api_addr_prefix=https://healthcare.googleapis.com:443/v1beta1"
            - "--logtostderr"
            - "--receiver_ip=0.0.0.0"
            - "--pubsub_project_id=XXXXXXXX-api-dev"
            - "--pubsub_subscription=XX-incomingsub"

And the location_id needed to be specified like so:

- "--hl7_v2_location_id=us-central1"

Thank you.

-- damianesteban
Source: StackOverflow

4/12/2019

It seems like the location id parameter in the path for the HL7v2 store (in yaml, hl7_v2_location_id) might be missing or incorrect; the error looks like it's being raised from the MLLP adapter's request to Cloud Healthcare API, rather than anything particular to GKE.

-- kurttheviking
Source: StackOverflow