GCS-Connector library issue for connection from Java application to GCS bucket.

26 views
Skip to first unread message

ASHWIN RAJANI

unread,
Jan 13, 2022, 5:20:36 AM1/13/22
to google-cloud-storage-discuss

I am trying to use gcs-connector library in java as is explained here at https://github.com/GoogleCloudDataproc/hadoop-connectors/blob/master/gcs/INSTALL.md . I have added following properties in core-site.xml as mentioned in the link above

fs.AbstractFileSystem.gs.impl fs.gs.project.id google.cloud.auth.service.account.enable google.cloud.auth.service.account.json.keyfile

But I am getting error as P12 key file may not be specified at the same time as credentials via configuration.  although I have passed this parameter. Can see in local value is assigned to variable as expected

As can be see here code is failing because it is trying to check non null string (as can be seen in the attached screenshot ). Although it is able to read value from config but Strings.isNullOrEmpty(options.getServiceAccountKeyFile()) is failing the code.

Requesting someone to please help us with this.

Or if someone could suggest some resource where we can see interaction of Java service with gcs using gcs-connector library.


Felipe Bergallo Corral

unread,
Jan 19, 2022, 9:19:41 AM1/19/22
to google-cloud-storage-discuss
"But I am getting error as P12 key file may not be specified at the same time as credentials via configuration"

This just means that you have to pick either the Service Account Private Key Id or a service account email or an account key... The check isn't for a non-null value, it's for a null value; it's not failing because it can't see the value, it's failing because you've filled out a value (you're attempting to sign-in twice at the same time with two different services), or at least that's what I'm understanding from what you've stated here. Please let me know if I've misunderstood
Reply all
Reply to author
Forward
0 new messages