You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/20 20:40:55 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #13784: Fix two bugs in StackdriverTaskHandler

mik-laj commented on a change in pull request #13784:
URL: https://github.com/apache/airflow/pull/13784#discussion_r561283952



##########
File path: tests/providers/google/cloud/log/test_stackdriver_task_handler.py
##########
@@ -35,10 +35,21 @@ def _create_list_response(messages, token):
     return mock.MagicMock(pages=(n for n in [page]), next_page_token=token)
 
 
+def _remove_stackdriver_handlers():

Review comment:
       This is another small fix. An error is generated when exiting the process, but it did not cause any errors, but only noise in the log.
   ```
   ========================================== 9 failed, 8 passed, 3 skipped, 7 errors in 12.91s ==========================================
   [2021-01-20 19:52:29,766] {_metadata.py:104} WARNING - Compute Engine Metadata server unavailable onattempt 1 of 3. Reason: timed out
   [2021-01-20 19:52:29,769] {_metadata.py:104} WARNING - Compute Engine Metadata server unavailable onattempt 2 of 3. Reason: [Errno 111] Connection refused
   [2021-01-20 19:52:29,774] {_metadata.py:104} WARNING - Compute Engine Metadata server unavailable onattempt 3 of 3. Reason: [Errno 111] Connection refused
   [2021-01-20 19:52:29,774] {_default.py:246} WARNING - Authentication failed using Compute Engine authentication due to unavailable metadata server.
   Error in atexit._run_exitfuncs:
   Traceback (most recent call last):
     File "/usr/local/lib/python3.6/logging/__init__.py", line 1946, in shutdown
       h.close()
     File "/opt/airflow/airflow/providers/google/cloud/log/stackdriver_task_handler.py", line 345, in close
       self._transport.flush()
     File "/usr/local/lib/python3.6/site-packages/cached_property.py", line 36, in __get__
       value = obj.__dict__[self.func.__name__] = self.func(obj)
     File "/opt/airflow/airflow/providers/google/cloud/log/stackdriver_task_handler.py", line 120, in _transport
       return self.transport_type(self._client, self.name)
     File "/usr/local/lib/python3.6/site-packages/cached_property.py", line 36, in __get__
       value = obj.__dict__[self.func.__name__] = self.func(obj)
     File "/opt/airflow/airflow/providers/google/cloud/log/stackdriver_task_handler.py", line 108, in _client
       key_path=self.gcp_key_path, scopes=self.scopes, disable_logging=True
     File "/opt/airflow/airflow/providers/google/cloud/utils/credentials_provider.py", line 309, in get_credentials_and_project_id
       return _CredentialProvider(*args, **kwargs).get_credentials_and_project()
     File "/opt/airflow/airflow/providers/google/cloud/utils/credentials_provider.py", line 242, in get_credentials_and_project
       credentials, project_id = self._get_credentials_using_adc()
     File "/opt/airflow/airflow/providers/google/cloud/utils/credentials_provider.py", line 295, in _get_credentials_using_adc
       credentials, project_id = google.auth.default(scopes=self.scopes)
     File "/usr/local/lib/python3.6/site-packages/google/auth/_default.py", line 356, in default
       raise exceptions.DefaultCredentialsError(_HELP_MESSAGE)
   google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org