Repository navigation
NLP example doesn't work in Cloud Shell #3252
Description
Activity
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.Steps to reproduce:
-
Open Cloud Shell
-
git clone https://github.com/GoogleCloudPlatform/java-docs-samples -
cd
java-docs-samples/translate -
mvn package
-
- addedapi: languageIssues related to the Cloud Natural Language API API.Issues related to the Cloud Natural Language API API.
on May 18, 2018 Hi @hzyi-google, if I create an API key and set the
GOOGLE_API_KEYvariable, 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.@jphalip thanks for the update. I'll keep investigating.
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_CREDENTIALSvariable for some credentials (this variable supersedes theGOOGLE_API_KEYvariable, 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 loginHi @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_KEYdid not work for me either, I'll follow up with cloud shell team on that.An internal bug has been filed to track the issue that
GOOGLE_API_KEYdoes not work. Closing it here. Feel free to ask for reopen is there are still problems.- added a commit that references this issue
on Mar 9, 2026
I'm getting this error:
The project I'm using does have the API enabled. I have no idea what project
618104708054is — that is not the project I'm using.I've tried setting the
GOOGLE_CLOUD_PROJECTenvironment variable to my project ID, but I still get the same error.Any idea what might be causing this?