fsouza / fake-gcs-server

Google Cloud Storage emulator & testing library.

Home Page:https://pkg.go.dev/github.com/fsouza/fake-gcs-server/fakestorage?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unsupported protocol scheme ""

Geisha84 opened this issue · comments

Hi,

When writing to the storage bucket faker from a Golang project using the package sftp I get the following error message in my Go project:

Post "/upload/storage/v1/b/cc-acquiring-local-clearing-files/o?uploadType=resumable&name=mastercard%2F2023%2F05%2F16%2FYTF.AR.TR54.B.E0000000.D230516.T090025.txt&upload_id=b198a18a6a9c869741e648b294569fa5": unsupported protocol scheme ""

The logs of the storage faker however show:
storage_bucket |time="2023-05-16T18:15:56Z" level=info msg="10.4.1.1 - - [16/May/2023:18:15:56 +0000] \"POST /upload/storage/v1/b/cc-acquiring-local-clearing-files/o?alt=json&ifGenerationMatch=0&name=logs.txt&prettyPrint=false&projection=full&uploadType=resumable HTTP/1.1\" 200 479"

We create an io.WriteCloser from a BucketHandle object using the "cloud.google.com/go/storage".

Running this from a Mac (M1) with the env STORAGE_EMULATOR_HOST set to http://localhost:4443 using version v1.45.1.

I downgraded to v1.44.2 which doesn't has this issue.

Got the same issue in Java, both on Mac and Linux:

com.google.cloud.storage.StorageException: java.lang.IllegalArgumentException: java.net.MalformedURLException: no protocol: /upload/storage/v1/b/test-bucket-nnvvuz/o?uploadType=resumable&name=gcs-UKgsMN%2Ftopic-integrationtest-ikrtvr-2-0&upload_id=cdc521f66f2d5db9e2a252c08ae5c738

Downgrade to v1.44.2 fixed it.