waymo-research/waymax

Hello, I have encountered the following error message. How can I resolve it

like2000522 opened this issue · 6 comments

2023-10-22 20:35:38.005846: W tensorflow/tsl/platform/cloud/google_auth_provider.cc:184] All attempts to get a Google authentication bearer token failed, returning an empty token. Retrieving token from files failed with "NOT_FOUND: Could not locate the credentials file.". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata.google.internal".

I had similar Google Auth/Permission Denied error on Windows. Exporting GOOGLE_APPLICATION_CREDENTIALS to the notebook and restarting the kernel fixed it.

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] =r'C:\Users\<USER-NAME>\AppData\Roaming\gcloud\application_default_credentials.json'

Hi, I meet the same question in macos10.15, how do i solve?

2023-10-24 15:26:19.642778: W tensorflow/core/platform/cloud/google_auth_provider.cc:184] All attempts to get a Google authentication bearer token failed, returning an empty token. Retrieving token from files failed with "UNAVAILABLE: Error executing an HTTP request: libcurl code 42 meaning 'Operation was aborted by an application callback', error details: Callback aborted". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata".
Traceback (most recent call last):

File "/Users/jqwang/Documents/Coding/waymodemo/test.py", line 15, in
scenario = next(data_iter)
File "/Users/jqwang/miniconda3/envs/waymo/lib/python3.10/site-packages/waymax/dataloader/dataloader_utils.py", line 229, in get_data_generator
for example in dataset.as_numpy_iterator():
File "/Users/jqwang/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 4770, in next
return nest.map_structure(to_numpy, next(self._iterator))
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 787, in next
return self._next_internal()
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 770, in _next_internal
ret = gen_dataset_ops.iterator_get_next(
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 3017, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/framework/ops.py", line 7215, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.PermissionDeniedError: {{function_node _wrapped__IteratorGetNext_output_types_31_device/job:localhost/replica:0/task:0/device:CPU:0}} Error executing an HTTP request: HTTP response code 403 with body 'AccessDeniedAccess denied.

Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
'
when reading gs://waymo_open_dataset_motion_v_1_1_0/uncompressed/tf_example/training/training_tfexample.tfrecord-00000-of-01000 [Op:IteratorGetNext]

I had similar Google Auth/Permission Denied error on Windows. Exporting GOOGLE_APPLICATION_CREDENTIALS to the notebook and restarting the kernel fixed it.

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] =r'C:\Users\<USER-NAME>\AppData\Roaming\gcloud\application_default_credentials.json'

Thank you for your reply, it is very important to me. I am currently trying to run through this emulator and have encountered new issues. May I ask if you have also encountered this issue:
tensorflow.python.framework.errors_impl.AbortedError: {{function_node _wrapped__IteratorGetNext_output_types_31_device/job:localhost/replica:0/task:0/device:CPU:0}} All 10 retry attempts failed. The last failure: Error executing an HTTP request: libcurl code 7 meaning 'Couldn't connect to server', error details: Failed to connect to storage.googleapis.com port 443 after 2005 ms: Couldn't connect to server
when reading gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/tf_example/training/training_tfexample.tfrecord-00000-of-01000 [Op:IteratorGetNext] name:

Can you verify that you have permissions set up properly to access Google cloud storage? e.g. try accessing the dataset via gsutil:

$ gsutil ls gs://waymo_open_dataset_motion_v_1_2_0/uncompressed
gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/lidar/
gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/scenario/
gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/tf_example/

gsutil ls gs://waymo_open_dataset_motion_v_1_2_0/uncompressed

@justinjfu Thanks, and yes, the result as follow:
(waymo) MacBook-Pro:waymodemo jqw$ gsutil ls gs://waymo_open_dataset_motion_v_1_2_0/uncompressed gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/lidar/ gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/scenario/ gs://waymo_open_dataset_motion_v_1_2_0/uncompressed/tf_example/

and python=3.10, and all other environments are installed using pip.

After checking my macos10.15 system, the application_default_credentials.json file exists, and the specific directory is: Users/jqw/.config/gcloud/application_default_credentials.json

At the same time, I also added @sandeepsas 's suggestion in data_demo.ipynb:
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] =r'/Users/jqw/.config/gcloud/application_default_credentials.json'

and
[1]
(waymo) MacBook-Pro:waymodemo jqw$ gcloud auth login jqw1024@gmail.com
WARNING: Re-using locally stored credentials for [jqw1024@gmail.com]. To fetch new credentials, re-run the command with the --force flag.
You are now logged in as [jqw1024@gmail.com].
Your current project is [awesome-icon-337507]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
Updates are available for some Google Cloud CLI components. To install them,
please run:
$ gcloud components update

[2]
(waymo) MacBook-Pro:waymodemo jqw$ gcloud auth application-default login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=764-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fsqlservice.login&state=QVTA9H4tUcMCFIBeLGO85L99mCH1e6&access_type=offline&code_challenge=R-sEKad4t0ssUB2WdSG0G6xS_MEtcYQu5DzR6XssVmY&code_challenge_method=S256

Credentials saved to file: [/Users/jqw/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests Application Default Credentials (ADC).

Quota project "awesome-icon-337507" was added to ADC which can be used by Google client libraries for billing and quota. Note that some services may still bill the project owning the resource.

So I wonder if it is because waymo only supports python3.10+, while gcloud only supports python3.8~3.9?


2023-10-24 15:26:19.642778: W tensorflow/core/platform/cloud/google_auth_provider.cc:184] All attempts to get a Google authentication bearer token failed, returning an empty token. Retrieving token from files failed with "UNAVAILABLE: Error executing an HTTP request: libcurl code 42 meaning 'Operation was aborted by an application callback', error details: Callback aborted". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata".
Traceback (most recent call last):
File "/Users/jqwang/Documents/Coding/waymodemo/test.py", line 15, in
scenario = next(data_iter)
File "/Users/jqwang/miniconda3/envs/waymo/lib/python3.10/site-packages/waymax/dataloader/dataloader_utils.py", line 229, in get_data_generator
for example in dataset.as_numpy_iterator():
File "/Users/jqwang/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 4770, in next
return nest.map_structure(to_numpy, next(self._iterator))
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 787, in next
return self._next_internal()
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 770, in _next_internal
ret = gen_dataset_ops.iterator_get_next(
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 3017, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "/Users/jqw/miniconda3/envs/waymo/lib/python3.10/site-packages/tensorflow/python/framework/ops.py", line 7215, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.PermissionDeniedError: {{function_node _wrapped__IteratorGetNext_output_types_31_device/job:localhost/replica:0/task:0/device:CPU:0}} Error executing an HTTP request: HTTP response code 403 with body 'AccessDeniedAccess denied.

@Jin0932 Hmmm that's weird. Have you also checked that you've created the application default credentials? e.g. On Linux, there should be a file called ~/.config/gcloud/application_default_credentials.json

If that file doesn't exist, you need to run gcloud auth application-default login