-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload file to bucket: getting 404 #1753
Comments
Did you create a directory within |
Yeah upload will fail if the bucket doesn't exist. I'll keep this open to improve the error message or at least log that the bucket doesn't exist. |
Does the bucket need to be created with an API call after startup? I tried mounting a volume with a directory matching the bucket name, but that didn't help. Also, is services:
fake-gcs:
container_name: fake-gcs
image: fsouza/fake-gcs-server:latest
entrypoint: /bin/fake-gcs-server
command: -data /storage -scheme both -cors-headers x-goog-content-length-range -public-host fake-gcs
ports:
- "127.0.0.1:9023:4443"
- "127.0.0.1:8000:8000"
volumes:
- ${PWD}/.docker/gcs-emulator:/storage |
To answer my own question, Also, attaching a subdirectory to Would be really helpful if this was documented! So I can upload to the bucket using the gsutil example, but I still get 404 when trying to use a signed URL generated by the Node SDK 🤷 the container logs it so the request gets through, it just returns 404 This is how the logs look like, the first POST is the successful
|
Got it working! Apparently it was a services:
fake-gcs:
container_name: fake-gcs
image: fsouza/fake-gcs-server:latest
command: -scheme both -cors-headers x-goog-content-length-range,content-length -public-host 127.0.0.1:8000
ports:
- "127.0.0.1:9023:4443"
- "127.0.0.1:8000:8000"
volumes:
- ${PWD}/.docker/gcs-emulator:/data
app:
...
environment:
STORAGE_EMULATOR_HOST: http://127.0.0.1:8000 |
Error:
Writer.Close: googleapi: Error 404: Not Found, Not Found
docker service:
storage:
image: fsouza/fake-gcs-server
environment:
STORAGE_EMULATOR_HOST: localhost:4443
ports:
- '4443:4443'
command: -scheme http -port 4443 -public-host localhost:4443
volumes:
- .:/gcs_storage
client, err1 := storage.NewClient(context.TODO(), option.WithEndpoint("http://127.0.0.1:4443/storage/v1/"))
The text was updated successfully, but these errors were encountered: