fix: minio bucket seed race (#820)

* fix(workflows): retry MinIO bucket creation to survive post-boot format window

A freshly duplicated cio-minio's HTTP listener accepts connections
before it finishes formatting its storage backend (confirmed via its
own boot logs: "Formatting 1st pool, 1 set(s), 1 drives per set."),
so a bucket-creation call landing in that window can transiently fail
with a misleading "specified bucket does not exist" response even
though auth and connectivity (mc alias set) already succeeded. Retry
bucket creation up to 10 times with a 5s backoff instead of failing
the whole run on what's usually just a not-ready-yet response.

* fix(workflows): truncate env name slug to fit Railway's length limit

railway environment new failed with "Error in name - Invalid input"
for a 48-char name (pr-cursor-notes-workspace-feedback-6d09-0e6aa7c9)
derived from a long auto-generated branch name. Railway docs cite a
32-char limit for service names; environment names hit the same wall.

The collision-resistant hash suffix (added for the earlier CodeRabbit
finding) is what actually guarantees uniqueness -- the slug is only
there for readability -- so cap the slug at 18 chars instead of
dropping the hash. pr-<slug><=18>-<hash8> stays at or under 30 chars.

* fix(workflows): retry mc anonymous set for the same boot-race window

The mb retry loop worked as intended in the latest test run (attempt
1 failed on all three buckets during cio-minio's post-boot format
window, attempt 2 succeeded), but the very next call -- anonymous set
download on cio/media -- hit the identical "specified bucket does not
exist" error right after mb had just succeeded. Same underlying race,
one command later. Wrap it in the same retry pattern.

* update workflow

* fix: silen error on db:seed

* update workflow

* update workflow

* update workflow
This commit is contained in:
Abdulmuizz Hamzat
2026-08-03 02:05:10 +01:00
committed by GitHub
parent e79d920aeb
commit 8af0675895
2 changed files with 122 additions and 24 deletions
@@ -45,7 +45,7 @@ jobs:
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
slug=$(echo "$HEAD_REF" | tr '[:upper:]/_.' '[:lower:]---' | sed 's/[^a-z0-9-]//g' | sed 's/--*/-/g; s/^-//; s/-$//')
slug=$(echo "$HEAD_REF" | tr '[:upper:]/_.' '[:lower:]---' | sed 's/[^a-z0-9-]//g' | sed 's/--*/-/g; s/^-//; s/-$//' | cut -c1-18 | sed 's/-$//')
hash=$(echo -n "$HEAD_REF" | sha256sum | cut -c1-8)
env_name="pr-${slug}-${hash}"
echo "Attempting to delete environment: ${env_name}"