• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

Can't add Google Cloud Storage to external storage

Status
Not open for further replies.

AlanC02

A Lonely Guy
I can't add Google Cloud Storage to external storage.
I follow all the step on Chevereto documentation.
When I fill in the Private key box
Code:
"/path/of/file/XXX.json"
Chevereto didn't show anything but in console it show like that
capture.PNG

I try to fill my private_key shown in my json file, no matter what like
Code:
-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----\n
or
Code:
[PRIVATE-KEY]
, Chevereto show
Code:
Can't insert storage. Error: Google cloud storage client connect error: set the JSON service account credentials using Google_Client::setAuthConfig or set the path to your JSON file with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable and call Google_Client::useApplicationDefaultCredentials to refresh a token with assertion. - check your input parameters
 
Hi,

When I fill in the Private key box
Code:
"/path/of/file/XXX.json"
Chevereto didn't show anything but in console it show like that
Of course, the system expects the actual JSON document key. Not the path to the json file. It won't work either with the direct key, the system expects a JSON document containing the key.

Here's the implementation:
[CODE lang="php" title="app/lib/classes/class.storage.php" highlight="4"] $client = new \Google_Client();
$client->setApplicationName('Chevereto Google Cloud Storage');
$client->addScope('https://www.googleapis.com/auth/devstorage.full_control');
$credentials = json_decode(trim($storage['secret']), true);
$client->setAuthConfig($credentials);
$client->fetchAccessTokenWithAssertion();
if (!$client->getAccessToken()) {
throw new Exception('No access token');
}[/CODE]

Provide the complete JSON document and it should work for you.
 
What do you mean?
Provide the complete JSON document
Is it mean I provide like this in the Private key box?
Code:
{
"type": "service_account",
"project_id": "[PROJECT-ID]",
"private_key_id": "[KEY-ID]",
"private_key": "-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----\n",
"client_email": "[SERVICE-ACCOUNT-EMAIL]",
"client_id": "[CLIENT-ID]",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/[SERVICE-ACCOUNT-EMAIL]"
}
 
Yes, that's the kind of json document provided for Google Cloud.
 
I find that when I were using php7.0, I got the error.
But when I change to use php7.3, I suddenly can add the storage.
😫😪😫
 
Error: Google cloud storage client connect error: set the JSON service account credentials using Google_Client::setAuthConfig or set the path to your JSON file with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable and call Google_Client::useApplicationDefaultCredentials to refresh a token with assertion. - check your input parameters
 
Error: Google cloud storage client connect error: set the JSON service account credentials using Google_Client::setAuthConfig or set the path to your JSON file with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable and call Google_Client::useApplicationDefaultCredentials to refresh a token with assertion. - check your input parameters
You have to provide the key as this:
1586899148586.png

https://chevereto.com/docs/storages#google-cloud-storage

You have to open the key file, which is a JSON document and paste it "as is".
 
Status
Not open for further replies.
Back
Top