GeezerVison is showing github.com — NLP example doesn't work in Cloud Shell · Issue #3252 · googleapis/google-cloud-java
NLP example doesn't work in Cloud Shell #3252DescriptionI'm getting this error:
Caused by: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Cloud Natural Language API has not been used in project 618104708054 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/language.googleapis.com/overview?project=618104708054 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
The project I'm using does have the API enabled. I have no idea what project 618104708054 is — that is not the project I'm using.
I've tried setting the GOOGLE_CLOUD_PROJECT environment variable to my project ID, but I still get the same error.
Any idea what might be causing this? Activityjphalip commented on May 10, 2018 I'm getting the same error with the Translation API as well:
Google Cloud Translation API has not been used in project 618104708054 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=618104708054 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
jphalip commented on May 10, 2018 Steps to reproduce:
-
Open Cloud Shell
-
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
-
cd java-docs-samples/translate
-
mvn package
yihanzhen commented on May 18, 2018 Hi @jphalip ,
Just want to have a quick check with you before I investigate further, did you set up the API key as is mentioned here? jphalip commented on May 19, 2018 Hi @hzyi-google, if I create an API key and set the GOOGLE_API_KEY variable, I'm now seeing this:
WARNING: Ignoring API key set in environment variable GOOGLE_API_KEY: using Application Default Credentials instead.
... followed by the same error as originally reported, i.e. that the API isn't enabled for project 618104708054. I'm still not sure what project that number refers to. yihanzhen commented on May 21, 2018 @jphalip thanks for the update. I'll keep investigating. kurtisvg commented on May 23, 2018 Hi @jphalip,
It looks like you are having issues with authentication. There is a detailed breakdown here, but the quick version is that the client library is inspecting the GOOGLE_APPLICATION_CREDENTIALS variable for some credentials (this variable supersedes the GOOGLE_API_KEY variable, which is why you are receiving a warning).
Could you try running the following in the cloud shell terminal and see if authentication works:
unset GOOGLE_APPLICATION_CREDENTIALS
gcloud auth application-default login
yihanzhen commented on May 24, 2018 Hi @jphalip,
The service account set up in README under language samples should be able to fix the auth issue for both language and translate. Please let us know if that works for you. GOOGLE_API_KEY did not work for me either, I'll follow up with cloud shell team on that. yihanzhen commented on Jun 4, 2018 An internal bug has been filed to track the issue that GOOGLE_API_KEY does not work. Closing it here. Feel free to ask for reopen is there are still problems.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|