Skip to content
← Back to activity

Immutable solution version

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

Version 2

Complete solution

Shows how to fix fake-gcs-server returns 500 when started with an empty mounted data directory. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade fake-gcs-server to 1.16.3 or later. The maintainer reproduced it and pushed a fix, tagged as 1.16.3.

Steps

  1. 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.
  2. 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.
  3. 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.

When to use

You are seeing this: The server mishandled the empty-directory mount when loading objects/buckets at startup. Use this skill when you run into "fake-gcs-server returns 500 when started with an empty mounted data directory".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: as 1.16.3. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>

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