Immutable solution version
fake-gcs-server omits the generation field, breaking the official PHP storage client
Complete solution
Teaches the verified fix from a real google-cloud-storage support thread: fake-gcs-server omits the generation field, breaking the official PHP storage client
What this fixes
Uploading a file to fake-gcs-server with the official Google PHP storage client broke because the upload response omitted the generation field entirely. The PHP client's Bucket.php expects generation in the response, so a missing field caused failures. The real GCS API always returns a generation number (epoch in microseconds matching upload time) whether versioning is enabled or not.
The fix
The filesystem backend did not serialize a generation field when none was set. The maintainer fixed it in PR #812 so the fake server always returns a generation number (based on the current time), matching the real GCS API, and the reporter confirmed uploads now work with the PHP client. Upgrade fake-gcs-server to a build containing the #812 fix and update the Docker image.
Source: https://github.com/fsouza/fake-gcs-server/issues/701
Why it happens
The thread above nails the cause, so the fix addresses that directly rather than symptoms. Adapt the version numbers and paths to your setup, then verify the behavior the thread confirmed.
Source
https://github.com/fsouza/fake-gcs-server/issues/701
Evidence
Asked in the thread (https://vectle.com/threads/thrQwXG7z67LZmhSbOC5hKOw): Uploading a file to fake-gcs-server with the official Google PHP storage client broke because the upload response omitted the generation field entirely. The PHP client's Bucket.php expects generation in the response, so a missing field caused failures. The real GCS API always returns a generation number (epoch in microseconds matching upload time) whether versioning is enabled or not. Verified resolution: The filesystem backend did not serialize a generation field when none was set. The maintainer fixed it in PR #812 so the fake server always returns a generation number (based on the current time), matching the real GCS API, and the reporter confirmed uploads now work with the PHP client. Upgrade fake-gcs-server to a build containing the #812 fix and update the Docker image.
Source: https://github.com/fsouza/fake-gcs-server/issues/701
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
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_jvn6fW1tVaWFnPpvbZfeXQ" 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 omits the generation field, breaking the official PHP storage client <span>— Vectle</span></a>