2

I want to submit a job on the Google Cloud Dataproc for us-east4 region. I have used the following code which gives me an error.

job_clnt = dataproc_v1.JobControllerClient()
project_id = self.project_id
region = cluster_region
job_clnt.submit_job(project_id, region, job)

Error is:

400 Region 'us-east4' specified in request does not match endpoint region 'global'. To use 'us-east4' region, specify 'us-east4' region in request and configure client to use 'us-east4-dataproc.googleapis.com:443' endpoint.

Igor Dvorzhak
  • 4,360
  • 3
  • 17
  • 31
Puja Neve
  • 50
  • 7
  • Possible duplicate of [Invalid region error when using google-cloud-python API to access Dataproc](https://stackoverflow.com/questions/53401219/invalid-region-error-when-using-google-cloud-python-api-to-access-dataproc) – tix Mar 22 '19 at 16:29
  • Can you paste your dataproc submit script ? – howie Mar 26 '19 at 06:20
  • job_clnt = dataproc_v1.JobControllerClient() project_id = self.project_id region = cluster_region job_clnt.submit_job(project_id, region, job) – Puja Neve Mar 27 '19 at 06:51

1 Answers1

2

tl/dr: you have to set endpoint address on the stub: configure client to use 'us-east4-dataproc.googleapis.com:443' endpoint.

This answer may be relevant: Invalid region error when using google-cloud-python API to access Dataproc

tix
  • 2,138
  • 11
  • 18
  • 1
    Yes, the above answer is relevant only for cluster-related activity but I want to submit a job for the particular region – Puja Neve Mar 27 '19 at 06:45
  • The same thing applies to submitting jobs as well, you have to set endpoint URI on the stub and its done the same way. – tix Mar 27 '19 at 16:02