Comments (9)
Hi @lope7 ,
This means you're missing the serviceusage.service.use
IAM permission on your credential. Can you please post a reproduction script where I can try to confirm this issue?
from google-cloud-php.
Hi @yash30201,
Thank you very much for your response.
We know that it asks for that permission and we don't have it, but we want to know the reason why that permission is requested to do an "exists()" when it should not be necessary since we have been able to do other writing methods and it does not ask for this permission.
I understand that the solution is to activate that permission, but this doesn't make sense, right?
from google-cloud-php.
Yes this seems strange. That's why I wanted you to post a script where you're experiencing to troubleshoot this further.
from google-cloud-php.
`<?php
use Google\Cloud\Storage\StorageClient;
$storageClient = new StorageClient([
"projectId" => 'xxx',
"apiEndpoint" => 'xxx'
]);
$nameImage = 'image.jpg';
$bucket = $storageClient->bucket($this->bucketName, true);
$object = $bucket->object($nameImage);
try {
$object->exists();
} catch (Throwable $e) {
die("Our problem is here " . $e->getMessage());
}`
from google-cloud-php.
Can you tell me how do you authenticate in the library? (Service Account, gcloud auth login, Impersonated Service Account, External Account Credentials . . . )
from google-cloud-php.
Hi @yash30201 , I'm Lope's teammate. He is on vacaction. We use Service Account to authenticate.
from google-cloud-php.
Hey @glesende , I ran the following script which you provided with a Service Account which only has the Storage Admin permission. I didn't face any issue.
<?php
use Google\Cloud\Storage\StorageClient;
require_once __DIR__ . '/../vendor/autoload.php';
$storage = new StorageClient([
'projectId' => getenv('GOOGLE_PROJECT_ID'),
'keyFilePath' => getenv('GOOGLE_CLOUD_STORAGE_SA')
]);
$bucket = $storage->bucket('testing-bucket');
$object = $bucket->object('test.image');
try {
$object->exists();
} catch (Throwable $e) {
die("Our problem is here " . $e->getMessage());
}
So this rules out the fact that $object->exists()
requires an extra IAM permission.
I think the issue is that your service account which the library is picking doesn't has the proper permissions to access the project which you're trying to bill the api calls.
from google-cloud-php.
Than you, we will check this with our SRE team.
from google-cloud-php.
Hey @glesende , thanks for opening this issue.
I'm closing this for now. Please reopen if it still persists and you're sure it's coming from this library.
from google-cloud-php.
Related Issues (20)
- Fatal Error in RequestHandler class with emulator without GRPC extension HOT 7
- ci: enable flakybot for test failure detection HOT 3
- Fatal error: Uncaught Error: Undefined class constant 'RETRY_HEADER_KEY' HOT 8
- Cohort report not returning expected values. HOT 1
- storage: Support Storage Control Quickstart HOT 2
- Feature Request: Move python dependency on "gcs-updater" to the backend
- AppsMeet Package Permission denied on resource Space error HOT 6
- PHP Reference Docs not generating for new releases HOT 4
- Can't make analytics calls work through a proxy server HOT 3
- FR: Support for Storage HNS enablement HOT 1
- Database::executePartitionedUpdate() returns string instead of int
- Feature Request: move all .repo-metadata.json into one .repo-metadata-full.json
- batchAnnotateFiles failing silently (and taking php thread with it) HOT 2
- Speech API: Cannot use explicit_decoding_config with encoding = ENCODING_UNSPECIFIED HOT 1
- Remove unnecessary abstraction of bytes type or give an option to skip that abstraction HOT 2
- Doesn't return all rows, only the first "package" HOT 6
- Uploading a stream resource's contents to a bucket results in the resource being closed HOT 2
- API key HOT 1
- Storage: Add HNS folders samples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-cloud-php.