GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — google.cloud.error_reporting AttributeError: 'Client' object has no attribute 'project' · Issue #3167 · googleapis/google-cloud-python

google.cloud.error_reporting AttributeError: 'Client' object has no attribute 'project' #3167

New issue
Copy link
New issue
Copy link
Closed
Closed
google.cloud.error_reporting AttributeError: 'Client' object has no attribute 'project'#3167
Copy link
Assignees
lukesneeringer
Labels
api: clouderrorreportingIssues related to the Error Reporting API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Description

@cva
cva
opened on Mar 19, 2017
Issue body actions

I am trying to follow the sample code here in an appengine custom flexible runtime and whenever I run the code, I get the following error:

Traceback (most recent call last):
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/env/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vmagent/app/xxx.py", line 20, in simulate_error
    ec.report_exception()
  File "/env/lib/python3.5/site-packages/google/cloud/error_reporting/client.py", line 348, in report_exception
    user=user)
  File "/env/lib/python3.5/site-packages/google/cloud/error_reporting/client.py", line 277, in _send_error_report
    self.report_errors_api.report_error_event(error_report)
  File "/env/lib/python3.5/site-packages/google/cloud/error_reporting/client.py", line 162, in report_errors_api
    self._report_errors_api = make_report_error_api(self)
  File "/env/lib/python3.5/site-packages/google/cloud/error_reporting/_gax.py", line 44, in make_report_error_api
    return _ErrorReportingGaxApi(gax_client, client.project)
AttributeError: 'Client' object has no attribute 'project'

In the same project I'm also creating clients for pubsub and storage with the same default constructor and they both find the project and credentials, both when running in appengine as well as when I run the container locally and specify credentials by setting GOOGLE_APPLICATION_CREDENTIALS to point to a json file containing credentials for a service account.

I have also tried explicitly passing the project explicitly using something like:

ec = error_reporting.Client(project='xyz')

and

ec = error_reporting.Client('xyz')

to no avail.

Here is the sample code that fails:

from flask import Flask
from google.cloud import error_reporting


app = Flask(__name__)


@app.route('/simulate_error')
def simulate_error():
    ec = error_reporting.Client()
    try:
        # simulate calling a method that's not defined
        raise NameError
    except Exception:
        ec.report_exception()


if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)

Here is the output from pip freeze | grep ^google-cloud:

google-cloud==0.23.0
google-cloud-bigquery==0.23.0
google-cloud-bigtable==0.23.1
google-cloud-core==0.23.1
google-cloud-datastore==0.23.0
google-cloud-dns==0.23.0
google-cloud-error-reporting==0.23.1
google-cloud-language==0.23.1
google-cloud-logging==0.23.1
google-cloud-monitoring==0.23.0
google-cloud-pubsub==0.23.0
google-cloud-resource-manager==0.23.0
google-cloud-runtimeconfig==0.23.0
google-cloud-spanner==0.23.1
google-cloud-speech==0.23.0
google-cloud-storage==0.23.1
google-cloud-translate==0.23.0
google-cloud-vision==0.23.3

Activity

  1. cva
    changed the title [-]google.cloud.error_reporting AttributeError: 'Client' object has no attribute 'project' when t[/-] [+]google.cloud.error_reporting AttributeError: 'Client' object has no attribute 'project'[/+] on Mar 19, 2017
  2. cva commented on Mar 19, 2017

    @cva
    cva
    on Mar 19, 2017
    Author
    More actions

    forgot to mention I get a similar error when I try to use the google.cloud.logging client as well.

  3. lukesneeringer commented on Mar 20, 2017

    @lukesneeringer
    lukesneeringer
    on Mar 20, 2017
    Contributor
    More actions

    Thanks for reporting, @cva. :-) Looking into this now.

  4. lukesneeringer
    self-assigned this
    on Mar 20, 2017
  5. lukesneeringer
    added
    api: clouderrorreportingIssues related to the Error Reporting API.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    status: acknowledged
    on Mar 20, 2017
  6. dhermes commented on Mar 20, 2017

    @dhermes
    dhermes
    on Mar 20, 2017
    Contributor
    More actions

    @lukesneeringer Was fixed in #3159

  7. cva commented on Mar 20, 2017

    @cva
    cva
    on Mar 20, 2017
    Author
    More actions

    when might those changes show up in a new release?

  8. lukesneeringer commented on Mar 21, 2017

    @lukesneeringer
    lukesneeringer
    on Mar 21, 2017
    Contributor
    More actions

    I can release a new error reporting client today.

  9. cva commented on Mar 21, 2017

    @cva
    cva
    on Mar 21, 2017
    Author
    More actions

    Thanks for the update. btw, did anyone check to see if the same fix has also been made to google.cloud.logging? (or should I just open a separate issue?) It seems to exhibit the same behavior.

  10. cva
    closed this as completedon Mar 21, 2017
  11. lukesneeringer commented on Mar 21, 2017

    @lukesneeringer
    lukesneeringer
    on Mar 21, 2017
    Contributor
    More actions

    I was not able to find the issue on logging.

  12. atulep
    added 4 commits that reference this issue on Apr 6, 2023

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    264a53d

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    60d3a5f

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    c77d3cc

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    ecfaf1d
  13. atulep
    added 2 commits that reference this issue on Apr 18, 2023

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    2e52421

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    37c4c71
  14. parthea
    added 2 commits that reference this issue on Oct 22, 2023

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    68cedd5

    chore(deps): update dependency google-cloud-speech to v1.3.2 [(#3167)](…

    c667ea0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

api: clouderrorreportingIssues related to the Error Reporting API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.