Skip to content

make_iap_request.py update seems to have broken the Launching Dataproc Jobs with Cloud Composer Qwiklab #3712

@0yster

Description

@0yster

In which file did you encounter the issue?

make_iap_request.py

The Qwiklab Launching Dataproc Jobs with Cloud Composer uses the make_iap_request.py file, which now no longer works. As a result the lab is currently offline.

Did you change the file? If so, how?

When a change was made by @arithmetic1728, sijunliu@ to this file, a Qwiklab that uses the file no longer works.
5ef84ba

Describe the issue

error:
(venv) student_00_da8d23ee74ab@cloudshell:~/professional-services/examples/cloud-composer-examples/composer_http_post_example (qwiklabs-gcp-00-68bd727eb07f)$ python dag_trigger.py \

--url="${AIRFLOW_URI}/api/experimental/dags/average-speed/dag_runs"
--iapClientId=$CLIENT_ID
--raw_path=gs://$PROJECT/cloud-composer-lab/raw-$EXPORT_TS/
Traceback (most recent call last):
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/venv/lib/python3.7/site-packages/google/auth/compute_engine/credentials.py", line 289, in _call_meta
data_identity_endpoint
self._target_audience
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/venv/lib/python3.7/site-packages/google/auth/compute_engine/_metadata.py", line 172, in get
response,
google.auth.exceptions.TransportError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=1087176421767-er001vugel6q9ottl7ihs8rp6963iv6o.apps.googl
eusercontent.com&format=full from the Google Compute Enginemetadata service. Status: 404 Response:\nb''", <google.auth.transport.requests._Response object at 0x7fe83917c048>)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "dag_trigger.py", line 100, in
main()
File "dag_trigger.py", line 96, in main
data=json.dumps(payload))
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/make_iap_request.py", line 44, in make_iap_request
google_open_id_connect_token = id_token.fetch_id_token(Request(), client_id)
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/venv/lib/python3.7/site-packages/google/oauth2/id_token.py", line 213, in fetch_id_token
credentials.refresh(request)
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/venv/lib/python3.7/site-packages/google/auth/compute_engine/credentials.py", line 312, in refresh
self.token, self.expiry = self._call_metadata_identity_endpoint(request)
File "/home/student_00_da8d23ee74ab/professional-services/examples/cloud-composer-examples/composer_http_post_example/venv/lib/python3.7/site-packages/google/auth/compute_engine/credentials.py", line 294, in _call_meta
data_identity_endpoint
six.raise_from(new_exc, caught_exc)
File "", line 3, in raise_from
google.auth.exceptions.RefreshError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=1087176421767-er001vugel6q9ottl7ihs8rp6963iv6o.apps.googleu
sercontent.com&format=full from the Google Compute Enginemetadata service. Status: 404 Response:\nb''", <google.auth.transport.requests._Response object at 0x7fe83917c048>)

Metadata

Metadata

Labels

api: composerIssues related to the Cloud Composer API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions