Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit bot process when we can't contact metadata server. #3912

Closed
wants to merge 2 commits into from

Conversation

jonathanmetzman
Copy link
Collaborator

Nothing can be done in the process so quit and try again.

Tries to fix:

 "AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x000001D8BDC56108>" raised exception!
Traceback (most recent call last):
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 111, in refresh
    self._retrieve_info(request)
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 88, in _retrieve_info
    request, service_account=self._service_account_email
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\_metadata.py", line 234, in get_service_account_info
    return get(request, path, params={"recursive": "true"})
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\_metadata.py", line 165, in get
    "metadata service. Compute Engine Metadata server unavailable".format(url)
google.auth.exceptions.TransportError: Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/[email protected]/?recursive=true from the Google Compute Enginemetadata service. Compute Engine Metadata server unavailable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\clusterfuzz\src\third_party\grpc\_plugin_wrapping.py", line 78, in __call__
    context, _AuthMetadataPluginCallback(callback_state, callback))
  File "c:\clusterfuzz\src\third_party\google\auth\transport\grpc.py", line 104, in __call__
    callback(self._get_authorization_headers(context), None)
  File "c:\clusterfuzz\src\third_party\google\auth\transport\grpc.py", line 91, in _get_authorization_headers
    self._request, context.method_name, context.service_url, headers
  File "c:\clusterfuzz\src\third_party\google\auth\credentials.py", line 133, in before_request
    self.refresh(request)
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 117, in refresh
    six.raise_from(new_exc, caught_exc)
  File "<string>", line 3, in raise_from
google.auth.exceptions.RefreshError: Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/[email protected]/?recursive=true from the Google Compute Enginemetadata service. Compute Engine Metadata server unavailable
"

Nothing can be done in the process so quit and try again.

Tries to fix:

```
 "AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x000001D8BDC56108>" raised exception!
Traceback (most recent call last):
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 111, in refresh
    self._retrieve_info(request)
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 88, in _retrieve_info
    request, service_account=self._service_account_email
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\_metadata.py", line 234, in get_service_account_info
    return get(request, path, params={"recursive": "true"})
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\_metadata.py", line 165, in get
    "metadata service. Compute Engine Metadata server unavailable".format(url)
google.auth.exceptions.TransportError: Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/[email protected]/?recursive=true from the Google Compute Enginemetadata service. Compute Engine Metadata server unavailable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\clusterfuzz\src\third_party\grpc\_plugin_wrapping.py", line 78, in __call__
    context, _AuthMetadataPluginCallback(callback_state, callback))
  File "c:\clusterfuzz\src\third_party\google\auth\transport\grpc.py", line 104, in __call__
    callback(self._get_authorization_headers(context), None)
  File "c:\clusterfuzz\src\third_party\google\auth\transport\grpc.py", line 91, in _get_authorization_headers
    self._request, context.method_name, context.service_url, headers
  File "c:\clusterfuzz\src\third_party\google\auth\credentials.py", line 133, in before_request
    self.refresh(request)
  File "c:\clusterfuzz\src\third_party\google\auth\compute_engine\credentials.py", line 117, in refresh
    six.raise_from(new_exc, caught_exc)
  File "<string>", line 3, in raise_from
google.auth.exceptions.RefreshError: Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/[email protected]/?recursive=true from the Google Compute Enginemetadata service. Compute Engine Metadata server unavailable
"
```
@@ -158,6 +160,10 @@ def task_loop():
task.dont_retry()
exception_occurred = True
stacktrace = traceback.format_exc()
except google.auth.exceptions.RefreshError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not already caught by the existing catchall on line 167? the resulting behaviour seems like it would be the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants