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

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

Closed
cva opened this issue Mar 19, 2017 · 7 comments
Assignees
Labels
api: clouderrorreporting Issues related to the Error Reporting API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@cva
Copy link

cva commented Mar 19, 2017

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
@cva 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' Mar 19, 2017
@cva
Copy link
Author

cva commented Mar 19, 2017

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

@lukesneeringer
Copy link
Contributor

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

@lukesneeringer lukesneeringer self-assigned this Mar 20, 2017
@lukesneeringer lukesneeringer added api: clouderrorreporting Issues related to the Error Reporting API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. status: acknowledged labels Mar 20, 2017
@dhermes
Copy link
Contributor

dhermes commented Mar 20, 2017

@lukesneeringer Was fixed in #3159

@cva
Copy link
Author

cva commented Mar 20, 2017

when might those changes show up in a new release?

@lukesneeringer
Copy link
Contributor

I can release a new error reporting client today.

@cva
Copy link
Author

cva commented Mar 21, 2017

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.

@cva cva closed this as completed Mar 21, 2017
@lukesneeringer
Copy link
Contributor

I was not able to find the issue on logging.

atulep pushed a commit that referenced this issue Apr 6, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
atulep pushed a commit that referenced this issue Apr 6, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
atulep pushed a commit that referenced this issue Apr 6, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
atulep pushed a commit that referenced this issue Apr 6, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
atulep pushed a commit that referenced this issue Apr 18, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
atulep pushed a commit that referenced this issue Apr 18, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
parthea pushed a commit that referenced this issue Oct 22, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
parthea pushed a commit that referenced this issue Oct 22, 2023
…GoogleCloudPlatform/python-docs-samples#3167)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-speech](https://togithub.com/googleapis/python-speech) | patch | `==1.3.1` -> `==1.3.2` |

---

### Release Notes

<details>
<summary>googleapis/python-speech</summary>

### [`v1.3.2`](https://togithub.com/googleapis/python-speech/blob/master/CHANGELOG.md#&#8203;132httpswwwgithubcomgoogleapispython-speechcomparev131v132-2020-02-03)

[Compare Source](https://togithub.com/googleapis/python-speech/compare/v1.3.1...v1.3.2)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
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 Error Reporting API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

3 participants