Java Storage test fails with 403 Forbidden error message. #3594
Labels
api: storage
Issues related to the Cloud Storage API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
URL: https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-clients/google-cloud-storage
Steps:
1 . cd google-cloud-java/google-cloud-clients/google-cloud-storage
2. Set JSON key file path to GOOGLE_APPLICATION_CREDENTIALS
3. mvn verify
RESULT:
T E S T S
Running com.google.cloud.storage.it.ITStorageTest
caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException:
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Permission denied on Cloud KMS key. Please ensure that your Cloud Storage service account has been authorized to use this key.",
"reason" : "forbidden"
} ],
"message" : "Permission denied on Cloud KMS key. Please ensure that your Cloud Storage service account has been authorized to use this key."
}
Results :
Failed tests:
ITStorageTest.testGetServiceAccount:1923 expected:<[gcloud-devel]@gs-project-accounts...> but was:<[service-725184503843]@gs-project-accounts...>
Tests in error:
ITStorageTest.testCreateBlobWithDefaultKmsKeyName:276 » Storage Permission den...
ITStorageTest.testCreateBlobWithKmsKeyName:243 » Storage Permission denied on ...
ITStorageTest.testGetBlobKmsKeyNameField:378 » Storage Permission denied on Cl...
ITStorageTest.testListBlobsKmsKeySelectedFields:482 » Storage Permission denie...
ITStorageTest.testRotateFromCustomerEncryptionToKmsKey:987 » Storage Permissio...
Tests run: 76, Failures: 1, Errors: 5, Skipped: 0
Please refer attached doc for command output
JavaStorageFailures.docx
It looks like the test is using some default service account and not using the service account set as part of GOOGLE_APPLICATION_CREDENTIALS
The text was updated successfully, but these errors were encountered: