Code Monkey home page Code Monkey logo

Comments (17)

ohmayr avatar ohmayr commented on June 6, 2024 5

We're looking into this issue.

Seems like version of google-auth that you're using does not expose universe_domain as a property of credentials (This is expected).

@brianliefinaccel for now, can you please try upgrading the google-auth version to v2.23.0. Let us know if that resolves the issue for you!

from google-cloud-python.

chewei888 avatar chewei888 commented on June 6, 2024 4

@ohmayr and @brianliefinaccel,

Thank you for providing the solution. After upgrading google-auth, the issue related to universe_domain has been resolved.

pip install --upgrade google-auth
dbutils.library.restartPython()

from google-cloud-python.

brianliefinaccel avatar brianliefinaccel commented on June 6, 2024 2

Most probably because of release #12243

I also encountered the same issue using secret manager package

Traceback (most recent call last):
  ...
  File "...", line 34, in ...
    response = client.access_secret_version(name=values[i])
  File "/opt/conda/default/lib/python3.7/site-packages/google/cloud/secretmanager_v1/services/secret_manager_service/client.py", line 1761, in access_secret_version
    self._validate_universe_domain()
  File "/opt/conda/default/lib/python3.7/site-packages/google/cloud/secretmanager_v1/services/secret_manager_service/client.py", line 549, in _validate_universe_domain
    self.universe_domain, self.transport._credentials
  File "/opt/conda/default/lib/python3.7/site-packages/google/cloud/secretmanager_v1/services/secret_manager_service/client.py", line 525, in _compare_universes
    credentials_universe = credentials.universe_domain
AttributeError: 'Credentials' object has no attribute 'universe_domain'

from google-cloud-python.

brianliefinaccel avatar brianliefinaccel commented on June 6, 2024 2

I can confirm upgrading to google-auth version 2.23.0 works @ohmayr

previously our google-auth version is stuck on v1.35 because we added google-cloud-bigquery==2.20.0 into our dependency, but installing latest version of google-cloud-secret-manager does not upgrade the google-auth package.

I think it is already addressed in googleapis/gapic-generator-python#1922

from google-cloud-python.

brianliefinaccel avatar brianliefinaccel commented on June 6, 2024 1

@ohmayr we ended up locking our package versions to version before yesterday's release because urgency, which works to fix the issue. For google-auth I'll see if we can deploy the upgrade for the other half of our code and report back here.

from google-cloud-python.

parthea avatar parthea commented on June 6, 2024 1

Hi @chaserracerr,

Regrettably, I don't have access to the discussions that you shared in Workplace. Only public information about the code or issues in Github should be shared in this thread. Here is some context about the issue in this thread:

The issue reported in this bug only occurs with older versions of google-auth (v2.22.0 or older from July 2023). The root cause is that the minimum version of google-auth was not stated for python client libraries, which is why this issue slipped through our testing. A workaround was provided about 30 minutes after the issue opened suggesting to use a newer version of google-auth, which is version v2.23.0 or newer. I can confirm that the testing gap has been addressed and a fix was released yesterday via #12258.

from google-cloud-python.

Yourius avatar Yourius commented on June 6, 2024

I've faced the same issue. But the project was in Colab. I fixed it with

!pip install google-analytics-data==0.18.3

New version was released on February, 1, 2024 (google-analytics-data 0.18.4) and that one has errors yet.

from google-cloud-python.

honnix avatar honnix commented on June 6, 2024

Looks like this is also a problem in google-cloud-kms lib, where google-auth is not claimed to be a dependency https://github.com/googleapis/google-cloud-python/blob/6dd0a9a4f0ec8de49630b1caa1a57b45df33f376/packages/google-cloud-kms/setup.py#L42C6-L45, while it should have been because it is directly used https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-kms/google/cloud/kms_v1/services/key_management_service/client.py#L37-L40.

google-cloud-kms relies on google-api-core to introducing google-auth as a transitive dependency but https://github.com/googleapis/python-api-core/blob/5922f2b8f382ee1fd9b69fafb2eed39db93b60fb/setup.py#L34 is not good enough for google-cloud-kms because it may install a previous version of google-auth.

from google-cloud-python.

adamcathersides avatar adamcathersides commented on June 6, 2024

I have been also seeing the same issue when trying to run the resource manager sample code to get the project iam policy.

I upgraded the google-auth to latest (2.27.0). Now I get:

google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument.

from google-cloud-python.

jose-neta avatar jose-neta commented on June 6, 2024

We're looking into this issue.

Seems like version of google-auth that you're using does not expose universe_domain as a property of credentials (This is expected).

@brianliefinaccel for now, can you please try upgrading the google-auth version to v2.23.0. Let us know if that resolves the issue for you!

On GCP Colab Enterprise here, and !pip install --upgrade google-auth solves it, thank you

from google-cloud-python.

adamcathersides avatar adamcathersides commented on June 6, 2024

FYI - I have got my example working now. It appears I was defining one of the resources incorrectly!
So upgrading google-auth also worked for me

from google-cloud-python.

Bharathi-anjuri avatar Bharathi-anjuri commented on June 6, 2024

I'm using google-cloud-secret-manager==2.16.4 google-auth==2.23.0/2.27.0, however im still facing below error
SecretManagerServiceClient._compare_universes(
File "/opt/conda/default/lib/python3.8/site-packages/google/cloud/secretmanager_v1/services/secret_manager_service/client.py", line 525, in _compare_universes
credentials_universe = credentials.universe_domain
AttributeError: 'Credentials' object has no attribute 'universe_domain'

from google-cloud-python.

botchagalupe avatar botchagalupe commented on June 6, 2024

dbutils.library.restartPython()

@ohmayr and @brianliefinaccel,

Thank you for providing the solution. After upgrading google-auth, the issue related to universe_domain has been resolved.

pip install --upgrade google-auth dbutils.library.restartPython()

In Colab, I restarted the kernel and ran the upgrade, and everything worked fine.

from google-cloud-python.

chaserracerr avatar chaserracerr commented on June 6, 2024

@parthea following up on this - can you confirm this was a Google related issue that required support from Google, or was this purely within our universe that required changes. Want to ensure we got the right amount of support from Google (if needed) - thanks

This is in response to Rajpreet's comment in Workplace

from google-cloud-python.

chaserracerr avatar chaserracerr commented on June 6, 2024

Understood, thank you @parthea - for the Google side, is that documentation could have been improved, am I correct in saying so?

from google-cloud-python.

parthea avatar parthea commented on June 6, 2024

Correct. We're working on building automation to avoid a repeat of the issue where a dependency is used but the minimum version for the dependency is not stated: googleapis/gapic-generator-python#1924

from google-cloud-python.

chaserracerr avatar chaserracerr commented on June 6, 2024

I've raised the question with Google to ensure the documentation is update here (in #google-external)

from google-cloud-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.