Skip to content
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

media_link & self_link in blob do not update when client option "api_endpoint" is set #1272

Closed
andrewlayer opened this issue May 9, 2024 · 2 comments
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. type: question Request for information or clarification. Not an issue.

Comments

@andrewlayer
Copy link

I am not sure this is intentional or not, but I had problems with it when using fake-gcs-server. I attempted to set the api_endpoint field to http://localhost:4443, but the media_link and self_link hosts continue to be 0.0.0.0. Here is the code used to configure the client:

client = storage.Client(
    credentials=AnonymousCredentials(),
    project="test",
    client_options={"api_endpoint": "http://localhost:4443"},
)

Here is an image of the blob during execution:
Screenshot 2024-05-09 at 7 00 18 PM

This become problematic because we are running in docker container that needs the hostname to be custom. Let me know if you need more details!

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label May 9, 2024
@ddelgrosso1
Copy link
Contributor

Hi @andrewlayer is this issue only happening when running against fake-gcs-server? If so, I would guess the issue might lie on the fake-gcs-server side as the library itself populates these fields based on the response received from the server. I took a quick look and looks like it might be something with the configuration of fake-gcs-server.

@ddelgrosso1 ddelgrosso1 added the type: question Request for information or clarification. Not an issue. label May 10, 2024
@andrewlayer
Copy link
Author

You were correct ddelgrosso1, I needed to add a flag in my YAML config for fake-gcs-server. Here is is for reference for anyone who stumbles across this:

  fake-gcs-server:
      container_name: fake-gcs-server
      image: fsouza/fake-gcs-server
      command: -scheme http -external-url http://fake-gcs-server:4443
      ports:
          - '4443:4443'
      volumes:
          - ${PWD}/bucket:/data
      networks:
          - net
      depends_on:
          - api
      profiles: 
          - "GCP_EMULATOR_MODE"

Thanks for you help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants