{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/1131","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/1131/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/1131/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/1131/events","html_url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1131","id":259230778,"number":1131,"title":"HTTPError: Json returned \"Job not found my-project/my-cluster\"","user":{"login":"claudiadast","id":16655465,"avatar_url":"https://avatars2.githubusercontent.com/u/16655465?v=4","gravatar_id":"","url":"https://api.github.com/users/claudiadast","html_url":"https://github.com/claudiadast","followers_url":"https://api.github.com/users/claudiadast/followers","following_url":"https://api.github.com/users/claudiadast/following{/other_user}","gists_url":"https://api.github.com/users/claudiadast/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiadast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiadast/subscriptions","organizations_url":"https://api.github.com/users/claudiadast/orgs","repos_url":"https://api.github.com/users/claudiadast/repos","events_url":"https://api.github.com/users/claudiadast/events{/privacy}","received_events_url":"https://api.github.com/users/claudiadast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"waprin","id":1075173,"avatar_url":"https://avatars2.githubusercontent.com/u/1075173?v=4","gravatar_id":"","url":"https://api.github.com/users/waprin","html_url":"https://github.com/waprin","followers_url":"https://api.github.com/users/waprin/followers","following_url":"https://api.github.com/users/waprin/following{/other_user}","gists_url":"https://api.github.com/users/waprin/gists{/gist_id}","starred_url":"https://api.github.com/users/waprin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waprin/subscriptions","organizations_url":"https://api.github.com/users/waprin/orgs","repos_url":"https://api.github.com/users/waprin/repos","events_url":"https://api.github.com/users/waprin/events{/privacy}","received_events_url":"https://api.github.com/users/waprin/received_events","type":"User","site_admin":false},"assignees":[{"login":"waprin","id":1075173,"avatar_url":"https://avatars2.githubusercontent.com/u/1075173?v=4","gravatar_id":"","url":"https://api.github.com/users/waprin","html_url":"https://github.com/waprin","followers_url":"https://api.github.com/users/waprin/followers","following_url":"https://api.github.com/users/waprin/following{/other_user}","gists_url":"https://api.github.com/users/waprin/gists{/gist_id}","starred_url":"https://api.github.com/users/waprin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waprin/subscriptions","organizations_url":"https://api.github.com/users/waprin/orgs","repos_url":"https://api.github.com/users/waprin/repos","events_url":"https://api.github.com/users/waprin/events{/privacy}","received_events_url":"https://api.github.com/users/waprin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-09-20T16:46:59Z","updated_at":"2017-09-20T18:16:36Z","closed_at":null,"author_association":"NONE","body":"## Describe the issue\r\n\r\nI have a python client library-based script that implements functions from `python-docs-samples/dataproc/submit_job_to_cluster.py`. When I tried running the full script, it returned the following error:\r\n\r\n```\r\nWaiting for job to finish...\r\nTraceback (most recent call last):\r\n  File \"/Users/cdastmalchi/WGS_automation_python_SDK.py\", line 174, in <module>\r\n    main()\r\n  File \"/Users/cdastmalchi/WGS_automation_python_SDK.py\", line 168, in main\r\n    wait_for_job(dataproc, args.project_id, region, args.cluster_name)\r\n  File \"/Users/cdastmalchi/WGS_automation_python_SDK.py\", line 132, in wait_for_job\r\n    jobId=job_id).execute()\r\n  File \"/anaconda/lib/python2.7/site-packages/oauth2client/util.py\", line 137, in positional_wrapper\r\n    return wrapped(*args, **kwargs)\r\n  File \"/anaconda/lib/python2.7/site-packages/googleapiclient/http.py\", line 842, in execute\r\n    raise HttpError(resp, content, uri=self.uri)\r\ngoogleapiclient.errors.HttpError: <HttpError 404 when requesting https://dataproc.googleapis.com/v1/projects/my-project/regions/us-east4/jobs/my-cluster?alt=json returned \"Job not found my-project/my-cluster\"> \r\n```\r\nThe issue appears to occur when implementing the `wait_for_job()` function:\r\n\r\n```\r\ndef wait_for_job(dataproc, project, region, job_id):\r\n    print('Waiting for job to finish...')\r\n    while True:\r\n        result = dataproc.projects().regions().jobs().get(\r\n            projectId=project,\r\n            region=region,\r\n            jobId=job_id).execute()\r\n        # Handle exceptions\r\n        if result['status']['state'] == 'ERROR':\r\n            raise Exception(result['status']['details'])\r\n        elif result['status']['state'] == 'DONE':\r\n            print('Job finished.')\r\n            return result\r\n```\r\n\r\nBut I'm not sure what exactly is wrong. Do you think the problem has to do with regions/zones? my cluster is in `us-east4-b` and the attempted job submission was in `us-east4`."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/comments/330936533","html_url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1131#issuecomment-330936533","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/1131","id":330936533,"user":{"login":"claudiadast","id":16655465,"avatar_url":"https://avatars2.githubusercontent.com/u/16655465?v=4","gravatar_id":"","url":"https://api.github.com/users/claudiadast","html_url":"https://github.com/claudiadast","followers_url":"https://api.github.com/users/claudiadast/followers","following_url":"https://api.github.com/users/claudiadast/following{/other_user}","gists_url":"https://api.github.com/users/claudiadast/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiadast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiadast/subscriptions","organizations_url":"https://api.github.com/users/claudiadast/orgs","repos_url":"https://api.github.com/users/claudiadast/repos","events_url":"https://api.github.com/users/claudiadast/events{/privacy}","received_events_url":"https://api.github.com/users/claudiadast/received_events","type":"User","site_admin":false},"created_at":"2017-09-20T18:16:36Z","updated_at":"2017-09-20T18:16:36Z","author_association":"NONE","body":"@waprin: I've followed the code as outlined in `python-docs-samples/dataproc/submit_job_to_cluster.py`, so if it were a region/zone problem, wouldn't many others be having the same issue?"}}
{"actor":{"display_login":"claudiadast"}}