Open Raffaello opened 2 years ago
Bumping because I also have this issue, however mine is failing on creating a bucket and then trying to create a signedURL on that bucket.
Relevant logs:
storage_emulator_1 | "GET /storage/v1/b/test-bucket?alt=json&prettyPrint=false&projection=full HTTP/1.1" 404 -
storage_emulator_1 | [BUCKETS] Received request to create bucket with name test-bucket
storage_emulator_1 | "POST /storage/v1/b?alt=json&prettyPrint=false&project=test-project-id HTTP/1.1" 200 -
storage_emulator_1 | Resource not found:
storage_emulator_1 | resource 'storage' not found
storage_emulator_1 | "GET /storage/v1/b/test-bucket/iam?alt=json&optionsRequestedPolicyVersion=1&prettyPrint=false HTTP/1.1" 404 -
@EmandM if i recall it correctly i had to use an ENV parameter detection: when there is STORAGE_EMULATOR_URL or something i was changing slightly the URL i don't remember if it was for mounting the emulator or in the URL of the application . but something like that. anyway i can't help you more than this as i don't remember the workaround that i adopted completely.
This doesn't solve the issue I am having, but is the solution to the original issue https://github.com/googleapis/google-cloud-go/issues/4444#issuecomment-898716815
The issue is if you use STORAGE_EMULATOR_HOST=http://localhost:9090
the go storage api will overwrite a whole bunch of things. You have to set it as in the issue above. If you use just STORAGE_EMULATOR_HOST=localhost:9090
(i.e. without the http://
then it works fine.
I ran into this issue today. There's an open issue to address this in the nodejs-storage project.
In the meantime, I found a workaround - rather than setting the STORAGE_EMULATOR_HOST variable, set the apiEndpoint property in the options provided to the Storage constructor.
const storage = new Storage({ apiEndpoint: 'http://127.0.0.1:9023' });
That's working for both uploading and downloading a file for me. I haven't tried other operations.
Describe the bug A clear and concise description of what the bug is. uploading a file succesfully, then when try to downloading is returning 404.
the url to get
/b
is the standard GCP Storage url bucket/o
obect. it isn't expected to fail on aGET
/b
urlTo Reproduce A minimal, complete, and reproducible example to reproduce the behavior.
download:
Expected behavior it should download the file
System (please complete the following information):
Additional context Add any other context about the problem here.
Basically what is saying is "url not found" `b/" the b/ part of the path is the "bucket" in GCP storage. so it should just work without any further issue as it is the basic GCP storage url