[GH-ISSUE #1342] Object 404 when using Google Go client #192

Closed
opened 2026-03-03 12:09:03 +03:00 by kerem · 1 comment
Owner

Originally created by @Schachte on GitHub (Sep 27, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1342

I have the option for enabling custom endpoint during initialization in the Google go client:

	if cfg.CustomEndpoint != "" {
		clientOpts = append(clientOpts, option.WithEndpoint(cfg.CustomEndpoint))
	}

and configure like the following:

  fake-gcs-server:
    image: fsouza/fake-gcs-server
    ports:
      - "4443:4443"
    command:
    - '-scheme'
    - 'http'
    - '-port'
    - '4443'
    - '-public-host'
    - 'fake-gcs-server:4443'
    - '-external-url'
    - 'http://fake-gcs-server:4443'
    volumes:
      - ./fixtures/sample_videos:/data/my-cool-bucket
      - ./scripts/gcs_config.json:/data/config.json

I've manipulated the public-host and external-url params, but still just get a 404 on my objects. My current ENV for the hostname is set as :

GCS_CUSTOM_ENDPOINT=http://fake-gcs-server:4443/storage/v1

If I curl locally outside my test, I can see the data, but not while using the go client. Any ideas what could be going on here?

Originally created by @Schachte on GitHub (Sep 27, 2023). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1342 I have the option for enabling custom endpoint during initialization in the Google go client: ```go if cfg.CustomEndpoint != "" { clientOpts = append(clientOpts, option.WithEndpoint(cfg.CustomEndpoint)) } ``` and configure like the following: ```yaml fake-gcs-server: image: fsouza/fake-gcs-server ports: - "4443:4443" command: - '-scheme' - 'http' - '-port' - '4443' - '-public-host' - 'fake-gcs-server:4443' - '-external-url' - 'http://fake-gcs-server:4443' volumes: - ./fixtures/sample_videos:/data/my-cool-bucket - ./scripts/gcs_config.json:/data/config.json ``` I've manipulated the public-host and external-url params, but still just get a 404 on my objects. My current ENV for the hostname is set as : ``` GCS_CUSTOM_ENDPOINT=http://fake-gcs-server:4443/storage/v1 ``` If I curl locally outside my test, I can see the data, but not while using the go client. Any ideas what could be going on here?
kerem closed this issue 2026-03-03 12:09:03 +03:00
Author
Owner

@Schachte commented on GitHub (Sep 27, 2023):

Ugh, this is annoying (on my part) - I needed GCS_CUSTOM_ENDPOINT=http://fake-gcs-server:4443/storage/v1 to be suffixed with an additional /.

Awesome library by the way!

Before:

http://fake-gcs-server:4443/storage/v1

After:

http://fake-gcs-server:4443/storage/v1/
<!-- gh-comment-id:1737984115 --> @Schachte commented on GitHub (Sep 27, 2023): Ugh, this is annoying (on my part) - I needed `GCS_CUSTOM_ENDPOINT=http://fake-gcs-server:4443/storage/v1` to be suffixed with an additional `/`. **Awesome** library by the way! Before: ``` http://fake-gcs-server:4443/storage/v1 ``` After: ``` http://fake-gcs-server:4443/storage/v1/ ```
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#192
No description provided.