Comments (4)
I ran into the same issue today, and after some investigation I believe I've discovered the cause.
The download process first resolves the blob to an object resource and then uses the mediaLink
property to determine where to download the resource from.
Unfortunately, the mediaLink
is constructed from the base_url
of the server, which is usually 0.0.0.0
when running the emulator inside of docker-compose. Since docker containers in docker-compose are generally addressed via DNS, its likely that you have your STORAGE_EMULATOR_HOST
set to the name of the service where the emulator is running.
This in turn means that when you try to download the blob in the container different from the one where the emulator is running, you end up making the download request to 0.0.0.0
rather than the hostname of the container where the emulator service is running.
I think a relatively straightforward solution to this might be to allow for a STORAGE_HOST
environment variable that defaults to DEFAULT_HOST
if not provided. The mediaLink
can then be constructed from STORAGE_HOST
allowing it to work inside of the docker network.
I'd be happy to set this up if PR's are welcome on the project?
from gcp-storage-emulator.
I don't use Docker Compose, so I don't really know what's going on. If you'll provide a minimal test case, I could try to reproduce it at some point.
from gcp-storage-emulator.
Ran into the same issue. Did you find anything later? @JeffryCA
from gcp-storage-emulator.
I was able to get things working with a combination of #82 (comment) and #82 (comment). looks like this works around the issue @Gradecak mentioned?
from gcp-storage-emulator.
Related Issues (20)
- upload_from_file() with content type "application/json" not working HOT 3
- Installing gcp-storage-emulator==2022.4.9 breaks tests HOT 1
- Bucket or Object not found HOT 4
- Bucket Upload notification to PubSub HOT 1
- cannot upload a file in nodejs HOT 2
- CredentialsError on first Client() logon HOT 2
- Feature request: Example of how to implement with CORS and SSL via docker HOT 3
- Connecting to emulator through PySpark HOT 1
- AttributeError: 'str' object has no attribute 'get_payload' HOT 1
- Custom metadata not included in HTTP headers when using storage emulator
- Python API inside a Docker container fails HOT 1
- 404 on blob make_public() or make_private() function
- using the emulator, upload a file then downloading it return 404
- using the emulator, upload a file then downloading it return 404 HOT 4
- Emulator returns `0.0.0.0` address instead of `localhost` for resumable upload in Docker (.NET client) HOT 2
- Hive working with GCP storage emulator
- Implement IAM endpoints for GCP Buckets
- Does it work with current SDK versions? HOT 2
- Support signing URLs
- Support for streaming of files upload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcp-storage-emulator.