[GH-ISSUE #198] python gcs client use generation as 0 when it is None, which is not supported/implemented yet. #2182

Closed
opened 2026-03-15 17:55:53 +03:00 by kerem · 3 comments
Owner

Originally created by @kc-panw on GitHub (Mar 20, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/198

GCS client forms the GET url with param generation=0 which is not implemented in the server.
So, if it's not implemented, the quick fix may be replacing all

if generationStr != ""

to

if generationStr != "" && generationStr != "0"

so that it uses Server.GetObject()

otherwise, get/download object will fail. We can easily reproduce this by running example code.

Just wonder if GetObjectWithGeneration() will be implemented soon or any other better fix?

Originally created by @kc-panw on GitHub (Mar 20, 2020). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/198 GCS client forms the GET url with param `generation=0` which is not implemented in the server. So, if it's not implemented, the quick fix may be replacing all `if generationStr != ""` to `if generationStr != "" && generationStr != "0"` so that it uses `Server.GetObject()` otherwise, get/download object will fail. We can easily reproduce this by running example code. Just wonder if `GetObjectWithGeneration()` will be implemented soon or any other better fix?
kerem closed this issue 2026-03-15 17:55:58 +03:00
Author
Owner

@fsouza commented on GitHub (Apr 20, 2020):

Hi @kc-panw, thanks for reporting and sorry for the delayed response. There aren't any plans for implementing GetObjectWithGeneration() at the moment, unfortunately.

Regarding generation being 0, I just pushed a fix.

<!-- gh-comment-id:616809314 --> @fsouza commented on GitHub (Apr 20, 2020): Hi @kc-panw, thanks for reporting and sorry for the delayed response. There aren't any plans for implementing `GetObjectWithGeneration()` at the moment, unfortunately. Regarding generation being 0, I just pushed a fix.
Author
Owner

@linjun9 commented on GitHub (May 6, 2020):

Hi @fsouza, I ran into the same issue again by running the python sample code. The problem is you only update the getObject function, but there are rewriteObject and downloadObject as well.

Is there a reason that you don't want to update those two functions? Thanks in advance.

<!-- gh-comment-id:624916974 --> @linjun9 commented on GitHub (May 6, 2020): Hi @fsouza, I ran into the same issue again by running the python sample code. The problem is you only update the `getObject` function, but there are `rewriteObject` and `downloadObject` as well. Is there a reason that you don't want to update those two functions? Thanks in advance.
Author
Owner

@fsouza commented on GitHub (May 6, 2020):

It was an oversight. Will push a fix, thanks for pinging me!

<!-- gh-comment-id:624921286 --> @fsouza commented on GitHub (May 6, 2020): It was an oversight. Will push a fix, thanks for pinging me!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#2182
No description provided.