[GH-ISSUE #1714] Golang: Can't get object by name error in example code #212

Closed
opened 2026-03-03 12:09:12 +03:00 by kerem · 1 comment
Owner

Originally created by @sondrehd on GitHub (Aug 12, 2024).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1714

Using the official google storage sdk version 1.43.0 I get the error code "object doesn't exists" when trying to fetch an object that is in fact there.
I preloaded data and have tried and have also tried to write the file first. It shows up if i iterate over all objects in the bucket, but if i try to create a NewReader it will yield "object doesn't exist".

To start the emulator i run:
docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http

Then i run the example code
go run ./examples/go/main.go
It outputs :

buckets: [some_file.txt]
2024/08/12 12:28:03 storage: object doesn't exist
exit status 1

I am able to get the file with curl:
curl --insecure "http://localhost:4443/storage/v1/b/sample-bucket/o/some_file.txt?alt=media"

Perhaps something has changed in the client library?

Originally created by @sondrehd on GitHub (Aug 12, 2024). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1714 Using the official google storage sdk version 1.43.0 I get the error code "object doesn't exists" when trying to fetch an object that is in fact there. I preloaded data and have tried and have also tried to write the file first. It shows up if i iterate over all objects in the bucket, but if i try to create a NewReader it will yield "object doesn't exist". To start the emulator i run: `docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http` Then i run the example code `go run ./examples/go/main.go` It outputs : ``` buckets: [some_file.txt] 2024/08/12 12:28:03 storage: object doesn't exist exit status 1 ``` I am able to get the file with curl: `curl --insecure "http://localhost:4443/storage/v1/b/sample-bucket/o/some_file.txt?alt=media"` Perhaps something has changed in the client library?
kerem closed this issue 2026-03-03 12:09:12 +03:00
Author
Owner

@snorrealv commented on GitHub (Feb 25, 2025):

Hey, did you find a solution to this issue?

<!-- gh-comment-id:2682150085 --> @snorrealv commented on GitHub (Feb 25, 2025): Hey, did you find a solution to this issue?
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#212
No description provided.