[GH-ISSUE #114] "open /storage/: no such file or directory" - Docker on Windows #22

Closed
opened 2026-03-03 12:07:29 +03:00 by kerem · 12 comments
Owner

Originally created by @Tohaker on GitHub (Oct 31, 2019).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/114

I'm trying to run the server, here is my command to start the Docker container:
docker run -d --name fake-gcs-server -p 4443:4443 -v %CD%\bot\tests\data:/data fsouza/fake-gcs-server

It starts with no problems, but using both cURL and Postman gives the same response when hitting https://127.0.0.1:4443/storage/v1/b:

open /storage/: no such file or directory

I'm clearly missing something here, but can't think what...

Originally created by @Tohaker on GitHub (Oct 31, 2019). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/114 I'm trying to run the server, here is my command to start the Docker container: `docker run -d --name fake-gcs-server -p 4443:4443 -v %CD%\bot\tests\data:/data fsouza/fake-gcs-server` It starts with no problems, but using both cURL and Postman gives the same response when hitting `https://127.0.0.1:4443/storage/v1/b`: `open /storage/: no such file or directory` I'm clearly missing something here, but can't think what...
kerem closed this issue 2026-03-03 12:07:29 +03:00
Author
Owner

@fsouza commented on GitHub (Nov 7, 2019):

Hey @Tohaker, thanks for opening this issue. This is weird 😞 Do you see anything in the container logs or more information in the response data?

Sorry for the delayed response x)

<!-- gh-comment-id:550597033 --> @fsouza commented on GitHub (Nov 7, 2019): Hey @Tohaker, thanks for opening this issue. This is weird 😞 Do you see anything in the container logs or more information in the response data? Sorry for the delayed response x)
Author
Owner

@Tohaker commented on GitHub (Nov 8, 2019):

Here are the logs:

time="2019-11-08T18:19:27Z" level=warning msg="couldn't read file \"/data/bot-images/cropped\", skipping" error="read /data/bot-images/cropped: is a directory"
time="2019-11-08T18:19:27Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty"
time="2019-11-08T18:19:27Z" level=info msg="server started at https://[::]:4443"

Perhaps my folder structure is too deep? I assumed it would replicate the folder structure I give it.

<!-- gh-comment-id:551936788 --> @Tohaker commented on GitHub (Nov 8, 2019): Here are the logs: ``` time="2019-11-08T18:19:27Z" level=warning msg="couldn't read file \"/data/bot-images/cropped\", skipping" error="read /data/bot-images/cropped: is a directory" time="2019-11-08T18:19:27Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty" time="2019-11-08T18:19:27Z" level=info msg="server started at https://[::]:4443" ``` Perhaps my folder structure is too deep? I assumed it would replicate the folder structure I give it.
Author
Owner

@Tohaker commented on GitHub (Nov 8, 2019):

As suspected, I flattened the folder structure and it worked. Is there any way to make this work with nested folders? My real bucket has a directory structure that I'd like to test against.

<!-- gh-comment-id:551938047 --> @Tohaker commented on GitHub (Nov 8, 2019): As suspected, I flattened the folder structure and it worked. Is there any way to make this work with nested folders? My real bucket has a directory structure that I'd like to test against.
Author
Owner

@fsouza commented on GitHub (Nov 8, 2019):

@Tohaker gotcha, thanks for posting the logs. Yeah, currently we don't support recursively creating the objects, but we could implement it, checking for a file/directory here: github.com/fsouza/fake-gcs-server@10d4e3a3d2/main.go (L69)

I may be able to do it over the weekend depending on how cold it gets 😁

<!-- gh-comment-id:551940919 --> @fsouza commented on GitHub (Nov 8, 2019): @Tohaker gotcha, thanks for posting the logs. Yeah, currently we don't support recursively creating the objects, but we could implement it, checking for a file/directory here: https://github.com/fsouza/fake-gcs-server/blob/10d4e3a3d24667ab71ffd590c10f3046b6224e8c/main.go#L69 I may be able to do it over the weekend depending on how cold it gets 😁
Author
Owner

@Tohaker commented on GitHub (Nov 8, 2019):

That would be much appreciated 😄 Sadly I'm not familiar with GO otherwise I'd try to submit a PR myself.

<!-- gh-comment-id:552016496 --> @Tohaker commented on GitHub (Nov 8, 2019): That would be much appreciated 😄 Sadly I'm not familiar with GO otherwise I'd try to submit a PR myself.
Author
Owner

@fsouza commented on GitHub (Nov 8, 2019):

@Tohaker no worries, I got you

<!-- gh-comment-id:552017577 --> @fsouza commented on GitHub (Nov 8, 2019): @Tohaker no worries, I got you
Author
Owner

@gerardmrk commented on GitHub (Dec 9, 2019):

Same issue here, using Docker Desktop for MacOS. Part of the compose file:

...

blobstore:
    container_name: blobstore
    build:
      context: ./blobstore
      dockerfile: Dockerfile
    ports:
      - "4443:4443/tcp"
    volumes:
      - "/usr/local/var/blobstore:/data"

...

Running the example curls:

$ open /storage/: no such file or directory

Running docker logs:

$ time="2019-12-09T00:59:42Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty"
$ time="2019-12-09T00:59:42Z" level=info msg="server started at https://[::]:4443"

If this is useful info:

  • No issues with the volume mounting; it gets created on host at the specified path.
  • Volume directory stays empty before and after running the failed command (maybe that's normal).
  • OS: MacOS Catalina, shell: zsh.
<!-- gh-comment-id:563023097 --> @gerardmrk commented on GitHub (Dec 9, 2019): Same issue here, using Docker Desktop for MacOS. Part of the compose file: ``` ... blobstore: container_name: blobstore build: context: ./blobstore dockerfile: Dockerfile ports: - "4443:4443/tcp" volumes: - "/usr/local/var/blobstore:/data" ... ``` Running the example curls: ```bash $ open /storage/: no such file or directory ``` Running docker logs: ```bash $ time="2019-12-09T00:59:42Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty" $ time="2019-12-09T00:59:42Z" level=info msg="server started at https://[::]:4443" ``` If this is useful info: - No issues with the volume mounting; it gets created on host at the specified path. - Volume directory stays empty before and after running the failed command (maybe that's normal). - OS: `MacOS Catalina`, shell: `zsh`.
Author
Owner

@gerardmrk commented on GitHub (Dec 9, 2019):

Can confirm that mapping volume /tmp:/data works. My previous volume mapping /usr/local/var/blobstore:/data

<!-- gh-comment-id:563052896 --> @gerardmrk commented on GitHub (Dec 9, 2019): Can confirm that mapping volume `/tmp:/data` works. My previous volume mapping `/usr/local/var/blobstore:/data`
Author
Owner

@kaime commented on GitHub (Dec 21, 2019):

I'm having the same issue on Linux when mounting a data volume that's initially empty:

$ mkdir data
$ docker run --rm -p 4443:4443 -v ${PWD}/data:/data fsouza/fake-gcs-server  
time="2019-12-21T19:26:04Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty"
time="2019-12-21T19:26:04Z" level=info msg="server started at https://[::]:4443"
$ curl -i --insecure https://localhost:4443/storage/v1/b
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sat, 21 Dec 2019 19:31:05 GMT
Content-Length: 42

open /storage/: no such file or directory

Adding a trailing slash to the URL generates a different error:

$ curl -i --insecure https://localhost:4443/storage/v1/b/
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sat, 21 Dec 2019 19:31:38 GMT
Content-Length: 19

404 page not found
<!-- gh-comment-id:568206006 --> @kaime commented on GitHub (Dec 21, 2019): I'm having the same issue on Linux when mounting a data volume that's initially empty: ``` bash $ mkdir data $ docker run --rm -p 4443:4443 -v ${PWD}/data:/data fsouza/fake-gcs-server time="2019-12-21T19:26:04Z" level=info msg="couldn't load any objects or buckets from \"/data\", starting empty" time="2019-12-21T19:26:04Z" level=info msg="server started at https://[::]:4443" ``` ``` bash $ curl -i --insecure https://localhost:4443/storage/v1/b HTTP/1.1 500 Internal Server Error Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Sat, 21 Dec 2019 19:31:05 GMT Content-Length: 42 open /storage/: no such file or directory ``` Adding a trailing slash to the URL generates a different error: ``` bash $ curl -i --insecure https://localhost:4443/storage/v1/b/ HTTP/1.1 404 Not Found Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Sat, 21 Dec 2019 19:31:38 GMT Content-Length: 19 404 page not found ```
Author
Owner

@gerardmrk commented on GitHub (Dec 22, 2019):

@kaime try the technique mentioned above, don't do nested paths (unfortunately). just do /tmp/data or something more specific than data to avoid potential name conflicts in /tmp.

Alternatively, if you're using Go, checkout gocloud.dev, they provide seamless abstraction over your object storage solution, using either in-memory or local filesystem for local development.

<!-- gh-comment-id:568239788 --> @gerardmrk commented on GitHub (Dec 22, 2019): @kaime try the technique mentioned above, don't do nested paths (unfortunately). just do `/tmp/data` or something more specific than `data` to avoid potential name conflicts in `/tmp`. Alternatively, if you're using Go, checkout gocloud.dev, they provide seamless abstraction over your object storage solution, using either in-memory or local filesystem for local development.
Author
Owner

@fsouza commented on GitHub (Dec 27, 2019):

@gerardmrk sorry, seeing this now. Will reopen the issue so it's easier to track.

Is /usr/local/var/blobstore an empty directory?

<!-- gh-comment-id:569330604 --> @fsouza commented on GitHub (Dec 27, 2019): @gerardmrk sorry, seeing this now. Will reopen the issue so it's easier to track. Is ``/usr/local/var/blobstore`` an empty directory?
Author
Owner

@fsouza commented on GitHub (Dec 27, 2019):

Oh ok I see what the issue is. Just pushed a fix and will tag 1.16.3 shortly.

<!-- gh-comment-id:569332141 --> @fsouza commented on GitHub (Dec 27, 2019): Oh ok I see what the issue is. Just pushed a fix and will tag 1.16.3 shortly.
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#22
No description provided.