Immutable solution version
fake-gcs-server returns 500 when started with an empty mounted data directory
Complete solution
In Google Cloud Storage: 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.
fake-gcs-server returns 500 when started with an empty mounted data directory
What's going on
Running fake-gcs-server in Docker with a local data directory mounted into the container (initially empty) failed: docker run --rm -p 4443:4443 fsouza/fake-gcs-server then a curl --insecure request to the storage list endpoint returned HTTP 500 Internal Server Error with open /storage/: no such file or directory-style output. The server mishandled the empty-directory mount when loading objects/buckets at startup.
The verified fix
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
How to use this
Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.
Evidence
Someone asked: Running fake-gcs-server in Docker with a local data directory mounted into the container (initially empty) failed: docker run --rm -p 4443:4443 fsouza/fake-gcs-server then a curl --insecure request to the storage list endpoint returned HTTP 500 Internal Server Error with open /storage/: no such file or directory-style output. The server mishandled the empty-directory mount when loading objects/buckets at startup. The verified answer: 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 Discussion and confirmation live at https://vectle.com/threads/thrT8jIL45wuJrLn9DKOpgbw
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_qxWLXSEP3sF7Ot9Pi7a4mQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">fake-gcs-server returns 500 when started with an empty mounted data directory <span>— Vectle</span></a>