fake-gcs-server icon indicating copy to clipboard operation
fake-gcs-server copied to clipboard

404 when uploading to empty storage

Open bkondakor opened this issue 3 years ago • 4 comments

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"

bkondakor avatar Dec 15 '21 09:12 bkondakor

@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!

fsouza avatar Dec 29 '21 14:12 fsouza

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/[email protected]

modosc avatar Jan 31 '22 20:01 modosc

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 .

modosc avatar Jun 02 '22 18:06 modosc

@modosc can you provide a reproducer?

fsouza avatar Jun 02 '22 22:06 fsouza