My Google App Engine based website started failing suddenly with following error -

file_exists(): open_basedir restriction in effect. File(/base/data/home/.config/gcloud/application_default_credentials.json) is not within the allowed path(s): 

Any help/pointers will be appreciated as my website is currently down because of it.

1

There are 1 best solutions below

0
On

I post here another possible solution as I had exaclty the same error message, even the reason was different. This is why this question came up while I searched for it.

I am using the Google Translation API:
https://googleapis.github.io/google-cloud-php/#/docs/google-cloud/v0.153.0/translate/v2/translateclient

In my case I didn't provide in $translate = new TranslateClient(); the parameter key.
Providing the Google API key $translate = new TranslateClient([ "key" => "my-key" ]); fixed it.