[GH-ISSUE #636] 404 when uploading to empty storage #111

Open
opened 2026-03-03 12:08:23 +03:00 by kerem · 5 comments
Owner

Originally created by @bkondakor on GitHub (Dec 15, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/636

When I start with a new empty instance and try to upload to it, it throws 404 error.
If I initialise it with some data, it works.

time="2021-12-15T09:33:35Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty"
time="2021-12-15T09:33:35Z" level=info msg="server started at http://localhost:8080"
time="2021-12-15T09:34:41Z" level=info msg="172.19.0.1 - - [15/Dec/2021:09:34:41 +0000] \"POST /upload/storage/v1/b/test_bucket/o?uploadType=multipart&name=a814275b4b9d61c850bfa612382821374c34b2c8 HTTP/1.1\" 404 59"
Originally created by @bkondakor on GitHub (Dec 15, 2021). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/636 When I start with a new empty instance and try to upload to it, it throws 404 error. If I initialise it with some data, it works. ``` time="2021-12-15T09:33:35Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty" time="2021-12-15T09:33:35Z" level=info msg="server started at http://localhost:8080" time="2021-12-15T09:34:41Z" level=info msg="172.19.0.1 - - [15/Dec/2021:09:34:41 +0000] \"POST /upload/storage/v1/b/test_bucket/o?uploadType=multipart&name=a814275b4b9d61c850bfa612382821374c34b2c8 HTTP/1.1\" 404 59" ```
Author
Owner

@fsouza commented on GitHub (Dec 29, 2021):

@bkondakor you may need to create the bucket before uploading to it. Can you share the code that you used to try to upload the file? Thanks!

<!-- gh-comment-id:1002630089 --> @fsouza commented on GitHub (Dec 29, 2021): @bkondakor you may need to create the bucket before uploading to it. Can you share the code that you used to try to upload the file? Thanks!
Author
Owner

@modosc commented on GitHub (Jan 31, 2022):

we're seeing the same issue. even with buckets created in the /data directory this call always fails:

 time="2022-01-31T20:16:28Z" level=info msg="172.17.0.1 - - [31/Jan/2022:20:16:28 +0000] \"POST /upload/storage/v1/b/bucketname/o?uploadType=multipart&name=foo.json HTTP/1.1\" 404 59"

this is with @google-cloud/storage@5.18.1

<!-- gh-comment-id:1026182243 --> @modosc commented on GitHub (Jan 31, 2022): we're seeing the same issue. even with buckets created in the `/data` directory this call always fails: ``` time="2022-01-31T20:16:28Z" level=info msg="172.17.0.1 - - [31/Jan/2022:20:16:28 +0000] \"POST /upload/storage/v1/b/bucketname/o?uploadType=multipart&name=foo.json HTTP/1.1\" 404 59" ``` this is with `@google-cloud/storage@5.18.1`
Author
Owner

@modosc commented on GitHub (Jun 2, 2022):

btw the solution we found was to add an empty file in the (empty) bucket directory. now we can reliably start a server and have all of our buckets exist .

<!-- gh-comment-id:1145200449 --> @modosc commented on GitHub (Jun 2, 2022): btw the solution we found was to add an empty file in the (empty) bucket directory. now we can reliably start a server and have all of our buckets exist .
Author
Owner

@fsouza commented on GitHub (Jun 2, 2022):

@modosc can you provide a reproducer?

<!-- gh-comment-id:1145401862 --> @fsouza commented on GitHub (Jun 2, 2022): @modosc can you provide a reproducer?
Author
Owner

@yassenb commented on GitHub (Apr 8, 2025):

Encountered the same issue. Should be trivial to reproduce - create a new bucket and then try to upload via a PUT request to a sub-directory in the bucket. 404 is returned. When an empty file is added after creating the bucket it works. @modosc , thanks a lot for the workaround.

<!-- gh-comment-id:2785635092 --> @yassenb commented on GitHub (Apr 8, 2025): Encountered the same issue. Should be trivial to reproduce - create a new bucket and then try to upload via a PUT request to a sub-directory in the bucket. 404 is returned. When an empty file is added after creating the bucket it works. @modosc , thanks a lot for the workaround.
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#111
No description provided.