Replies: 2 comments 5 replies
|
I don't know anything specific about Google's impersonated service accounts; I haven't used those myself. But the credential provider mechanism allows for any arbitrary credential handling. So if there's a way to authenticate with You haven't shared any code; can you share how you're creating the store? |
0 replies
|
Here's a basic way to reproduce the issue: import environ
from obstore.store import GCSStore
env = environ.Env()
env.read_env(".env")
bucket_name = env("BUCKET_USER_DATA")
gcs_store = GCSStore(bucket_name)And the traceback: gcs_store = GCSStore(bucket_name)
^^^^^^^^^^^^^^^^^^^^^
obstore.exceptions.GenericError: Generic GCS error: Unable to decode service account file: unknown variant `impersonated_service_account`, expected `service_account` or `authorized_user` at line 12 column 40
Debug source:
Generic {
store: "GCS",
source: DecodeCredentials {
source: Error("unknown variant `impersonated_service_account`, expected `service_account` or `authorized_user`", line: 12, column: 40),
},
}Proving that the access works with the google python package, and passing credential_provider explicitly: import environ
from google.auth import default as google_auth_default
from google.cloud import storage
from obstore.store import GCSStore
env = environ.Env()
env.read_env(".env")
bucket_name = env("BUCKET_USER_DATA")
def get_gcp_credentials():
credentials, project = google_auth_default()
return credentials
# The bucket is accessible through Google
# This also works without passing the credentials explicitly
storage_client = storage.Client(credentials=get_gcp_credentials())
bucket = storage_client.bucket(bucket_name)
blobs = bucket.list_blobs()
# Obstore
gcs_store = GCSStore(bucket_name, credential_provider=get_gcp_credentials)The error persists: gcs_store = GCSStore(bucket_name, credential_provider=get_gcp_credentials)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
obstore.exceptions.GenericError: Generic GCS error: Unable to decode service account file: unknown variant `impersonated_service_account`, expected `service_account` or `authorized_user` at line 12 column 40
Debug source:
Generic {
store: "GCS",
source: DecodeCredentials {
source: Error("unknown variant `impersonated_service_account`, expected `service_account` or `authorized_user`", line: 12, column: 40),
},
} |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Thanks for this tool!
I am trying to connect to a GCP bucket using an impersonated service account and get the following error.
I tried to pass a callback function with the credential_provider argument, but get the same error.
Is it a limitation of obstore, is there a work-around?
All reactions