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_APPLICATION_CREDENTIALS failed to find key file #158

Closed
maykiwo opened this issue Apr 30, 2018 · 7 comments
Closed

GOOGLE_APPLICATION_CREDENTIALS failed to find key file #158

maykiwo opened this issue Apr 30, 2018 · 7 comments
Labels
connector Items related to the Kafka Connector for Cloud Pub/Sub

Comments

@maykiwo
Copy link

maykiwo commented Apr 30, 2018

Hi all,

After have started kafka-connector correctly, I've wanted connect to source GooglePubSub
I'm connect with root account and launch

export GOOGLE_APPLICATION_CREDENTIALS=../../conf/cert-test.json
curl -X POST http://localhost:8086/connectors -H 'content-type: application/json' -d @source-connector-test

Caused by: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
Do you know what's missing in my conf ?

Thanks

@mdietz94
Copy link
Contributor

mdietz94 commented Apr 30, 2018 via email

@maykiwo
Copy link
Author

maykiwo commented May 1, 2018

I've been trying also absolute path with same error.
The key file has set to 777 for to be sure that can be read for all.

@maykiwo
Copy link
Author

maykiwo commented May 2, 2018

Add some informations:

It seems that GOOGLE_APPLICATION_CREDENTIALS must be set before launching Kafka-Connector

Here the correct way :

export GOOGLE_APPLICATION_CREDENTIALS=/usr/hdf/current/kafka-broker/conf/cert-file.json

./connect-distributed.sh ../config/kafka-connect-worker.properties

But with the above method, it seems not possible to launch multiple GooglePubSub, it is rigth?

regards

@kamalaboulhosn
Copy link
Collaborator

Apologies for the delay in responding. When you say "launch multiple GlooglePubSub," what do you mean exactly? Launch multiple instances of the connector? Are you trying to launch multiple instances and use different credentials for each? It would be helpful to understand the use case that isn't working for you.

@maykiwo
Copy link
Author

maykiwo commented May 28, 2018

Hi @kamalaboulhosn

As I'm understanding kafkaConnector needs one GOOGLE_APPLICATION_CREDENTIAL before we can run it.
So my question is how we can use kafkaConnector if we have multiple GCP projects so multiple credential ?

@lllewellyn
Copy link

I have the same question. If I define GOOGLE_APPLICATION_CREDENTIALS to /some/dir/projectA-credentials and now want to publish to a Google projectB, must I have a completely different set of Kafka Connect JVMs so I can supply the projectB credential?

Related question - would it be possible to specify the credentials as a property of the connector config?

@kamalaboulhosn kamalaboulhosn added the connector Items related to the Kafka Connector for Cloud Pub/Sub label Sep 18, 2018
@kamalaboulhosn
Copy link
Collaborator

The same instance of Kafka connect can only use one credentials file specified via the GOOGLE_APPLICATION_CREDENTIALS environment variable. That means one has to have separate instances of connect running with the environment variable set separately to be able to access Google Cloud Pub/Sub topics or subscriptions that require different credentials. Alternatively, if you are running different instances of the connector within the same connect instance, #187 added support for specifying the credentials file as a config property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connector Items related to the Kafka Connector for Cloud Pub/Sub
Projects
None yet
Development

No branches or pull requests

4 participants