Skip to content

Error reporting fails when GRPC is disabled #135

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

Closed
adibossiseu opened this issue Jun 16, 2021 · 0 comments · Fixed by #190
Closed

Error reporting fails when GRPC is disabled #135

adibossiseu opened this issue Jun 16, 2021 · 0 comments · Fixed by #190
Assignees
Labels
api: clouderrorreporting Issues related to the googleapis/python-error-reporting API. lang: python Issues specific to Python. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@adibossiseu
Copy link

adibossiseu commented Jun 16, 2021

When GRPC is disabled, report_exception and report fails.

Environment details

  • OS type and version: Windows 10, build 19043.1052
  • Python version: 3.8.2
  • pip version: 21.1.2
  • google-cloud-error-reporting version: 1.1.2

Steps to reproduce

  1. set the environment variable GOOGLE_CLOUD_DISABLE_GRPC=true
  2. create an error reporting client (google.cloud.error_reporting.Client)
  3. report a test message
  4. you should see the following message TypeError: __init__() takes 1 positional argument but 3 positional arguments (and 3 keyword-only arguments) were given This is caused by _ErrorReportingLoggingAPI object creation in the report_errors_api property of the client.

Code example

from google.cloud.error_reporting import Client
error_reporting_client = Client(service='test-service')
error_reporting_client.report('test-message')

Stack trace

Traceback (most recent call last):
  File "logging_setup.py", line 90, in <module>
    test()
  File "logging_setup.py", line 86, in test
    error_reporting_client.report('test-message')
  File "venv\lib\site-packages\google\cloud\error_reporting\client.py", line 358, in report
    self._send_error_report(
  File "venv\lib\site-packages\google\cloud\error_reporting\client.py", line 318, in _send_error_report
    self.report_errors_api.report_error_event(error_report)
  File "venv\lib\site-packages\google\cloud\error_reporting\client.py", line 205, in report_errors_api
    self._report_errors_api = _ErrorReportingLoggingAPI(
  File "venv\lib\site-packages\google\cloud\error_reporting\_logging.py", line 72, in __init__
    self.logging_client = google.cloud.logging.Client(
TypeError: __init__() takes 1 positional argument but 3 positional arguments (and 3 keyword-only arguments) were given
@product-auto-label product-auto-label bot added the api: clouderrorreporting Issues related to the googleapis/python-error-reporting API. label Jun 16, 2021
@daniel-sanche daniel-sanche added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. lang: python Issues specific to Python. labels Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: clouderrorreporting Issues related to the googleapis/python-error-reporting API. lang: python Issues specific to Python. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants