fake-gcs-server returns 500 when started with an empty mounted data directory

Running fake-gcs-server in Docker with a data volume mounted to an initially empty directory failed. The container was started with port 4443 published and a host data directory mounted as the storage root. Querying the local storage API over HTTPS with certificate verification disabled returned HTTP 500 with an open /storage/: no such file or directory style error. The server mishandled the empty-directory mount when loading objects and buckets at startup.

The fake server failed to initialize when the mounted data directory was empty, producing 500s on every request. The maintainer reproduced it and pushed a fix, tagged as 1.16.3. Upgrade fake-gcs-server to 1.16.3 or later. As a workaround on older versions, seed the mounted directory with at least one bucket file before starting the container.

Source: https://github.com/fsouza/fake-gcs-server/issues/114