mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #701] Missing generation field causes issues with official Google PHP Client #119
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @veteran29 on GitHub (Mar 2, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/701
When a file is uploaded to the bucket with the PHP client provided by Google it expects
generationfield in the response, see:https://github.com/googleapis/google-cloud-php-storage/blob/main/src/Bucket.php#L301
Could you please change it so this field is present with a
nullvalue instead of omitting it from serialization when it's not set?@fsouza commented on GitHub (Mar 2, 2022):
Oh interesting. Yeah that should be an easy change. Do you want to send a PR or do you want me to do it? I should be able to do it later today.
@veteran29 commented on GitHub (Mar 3, 2022):
I would be grateful if you could please do this. I do not code in Go (It looks pretty simple to get into though!) and just wanted to use this project with Google PHP SDK for Cloud Storage.
@fsouza commented on GitHub (Mar 3, 2022):
Sorry I didn't get to it today but I will make the change tomorrow.
@fsouza commented on GitHub (Mar 3, 2022):
Hmm I'm curious whether the GCS API returns
"","0"ornull. Do you have an example from a real request? If not, I can get one later.@veteran29 commented on GitHub (Mar 3, 2022):
I've done a quick test upload via their web interface and got
generation: "1646335421345034"for empty txt file.It looks like it's Epoch in microseconds as it matches upload time.
I've assumed it might be null by default as their PHP class for the StorageObject has null as its default value, but it might not be right.
@fsouza commented on GitHub (Apr 5, 2022):
@veteran29 sorry completely missed this, do you know what the API returns if generation is disabled in the bucket? I'll give it a try on the weekend.
@seniorcatDDL commented on GitHub (Jun 2, 2022):
Hi, any updates here? I have the same problem with php client
@fsouza commented on GitHub (Jun 2, 2022):
Sorry, still didn't get a chance to inspect what the value should be when the bucket has versioning disabled. Do you know what the API returns if generation is disabled in the bucket?
I know I can create a bucket and check, but wondering if this is something y'all can help with.
@mmetayer commented on GitHub (Jun 2, 2022):
As far as I understand the docs (https://cloud.google.com/storage/docs/object-versioning and https://cloud.google.com/storage/docs/metadata#generation-number) there is always a generation number returned, whether the versioning is enabled or not.
@fsouza commented on GitHub (Jun 2, 2022):
Oh gotcha, I missed this somehow. I guess we can always use the current time or something like that as the generation.
I'll try to take care of it over the coming weeks if no one beats me to it.
@seniorcatDDL commented on GitHub (Jun 3, 2022):
I can help with this issue, if you tell me where to edit the server response please
@fsouza commented on GitHub (Jun 4, 2022):
@veteran29 @seniorcatDDL I believe this is a limitation in the filesystem backend only? It should be solved when we fully implement versioning in that backend, but a quicker fix is available in #812. Could you give that a try?
Thanks for your patience!
@fsouza commented on GitHub (Jun 5, 2022):
Closed via
230d2a3d35.@seniorcatDDL commented on GitHub (Jun 6, 2022):
Thank you, I'll definitely try it today
@seniorcatDDL commented on GitHub (Jun 6, 2022):
Works great, thanks a lot!
Is it possible to update a docker image?
@fsouza commented on GitHub (Jun 6, 2022):
Should be up in a couple of minutes, I made a mistake when tagging it yesterday. Sorry about that.
@seniorcatDDL commented on GitHub (Jun 8, 2022):
Thanks a lot!