Skip to content

AttributeError: 'Client' object has no attribute 'project_id' #988

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

Open
cyprismatt opened this issue Apr 17, 2025 · 1 comment
Open

AttributeError: 'Client' object has no attribute 'project_id' #988

cyprismatt opened this issue Apr 17, 2025 · 1 comment
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API.

Comments

@cyprismatt
Copy link

There are a few references to client.project_id, but client does not have a field project_id, it has a field project:

.venv/lib/python3.12/site-packages/google/cloud/logging_v2/logger.py", line 79, in __init__
    resource = detect_resource(client.project_id)
                               ^^^^^^^^^^^^^^^^^
AttributeError: 'Client' object has no attribute 'project_id'. Did you mean: 'project'?

Changing these references in site-packages fixed the issue, but until that is fixed in the source, this package is broken for retrieving log entries via the SDK.

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Apr 17, 2025
@gkevinzheng gkevinzheng assigned gkevinzheng and unassigned arbrown May 21, 2025
@gkevinzheng
Copy link
Contributor

Hey @cyprismatt,

Could I get a code sample of what you're trying to do and what version of the logging library you're using? I just looked at the code for google/cloud/logging_v2/logger.py and it has no mention of project_id:

resource = detect_resource(client.project)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API.
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy