-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid field selection name. (StorageObject exists() funciton) #6636
Comments
Hello! Is this an error you received after updating, or a new error you're
receiving now for the first time?
…On Sun, Sep 17, 2023, 3:47 AM Mahmoud Abd Elhalim ***@***.***> wrote:
First I use the package to upload the files bucket.
I got this error.
{
"error": {
"code": 400,
"message": "Invalid field selection name",
"errors": [
{
"message": "Invalid field selection name",
"domain": "global",
"reason": "invalidParameter",
"locationType": "parameter",
"location": "fields"
}
]
}
}
The error happens when I try to check if the file exists on the bucket.
the sample code:
$bucket = $storage->bucket($bucketName);
$object = $bucket->object($file_name);
$exists = $object->exists();
The " $object->exists(); " is the reason.
#0 /var/www/wetrn.ai/vendor/google/cloud-core/src/RequestWrapper.php(214): Google\\Cloud\\Core\\RequestWrapper->convertToGoogleException()#1 /var/www/wetrn.ai/vendor/google/cloud-core/src/RestTrait.php(102): Google\\Cloud\\Core\\RequestWrapper->send()#2 /var/www/wetrn.ai/vendor/google/cloud-storage/src/Connection/Rest.php(730): Google\\Cloud\\Storage\\Connection\\Rest->traitSend()#3 /var/www/wetrn.ai/vendor/google/cloud-storage/src/Connection/Rest.php(250): Google\\Cloud\\Storage\\Connection\\Rest->send()#4 /var/www/wetrn.ai/vendor/google/cloud-storage/src/StorageObject.php(147): Google\\Cloud\\Storage\\Connection\\Rest->getObject()#5 /var/www/wetrn.ai/app/Jobs/GoogleCloudStorageUploaderJob.php(67): Google\\Cloud\\Storage\\StorageObject->exists()
@bshaffer <https://github.com/bshaffer> @yash30201
<https://github.com/yash30201>
Thanks!
—
Reply to this email directly, view it on GitHub
<#6636>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZMBJCMDBFWE2JAVSOGNLX23IMNANCNFSM6AAAAAA43RA2LY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello Bshaffer, I use it to check if the file exists before uploading.
|
I was unable to replicate this error with my credentials. I copied your code directly, but substituted my own project, bucket, and credentials, and the call to Have you updated to the latest version of the storage client library and it's dependencies? |
Hi @mahmoudabdelhalim I'll be closing this issue for now but please feel free to reopen this if you are able to reproduce this issue. |
First I use the package to upload the files bucket.
I got this error.
The error happens when I try to check if the file exists on the bucket.
the sample code:
The " $object->exists(); " is the reason.
@bshaffer @yash30201
Thanks!
The text was updated successfully, but these errors were encountered: