Deploy Report · phantom/backend · share

Share service: merge to production, with three root causes in between

PR #29920 merged at 19:43 UTC and the service was verified live in production at 00:13 UTC — staging was clean the whole way, while the prod bring-up surfaced a wedged PreSync job, missing database provisioning, and a deploy-approval staleness trap. All diagnosed and resolved; no user impact (net-new service, no traffic).

service share merge 5c75319d prod image sha-11311d1 window Jul 31 19:43 → Aug 1 00:13 UTC
LIVE
staging + production, all 3 endpoints
4h30m
merge → prod verified
3
root causes found & fixed
5
infra/deploy PRs & runs landed
0
user impact (net-new service)
01

Timeline (UTC)

19:43
PR #29920 merged

chore(share): share service and OG cards — merge commit 5c75319d. Images build green on main.

20:10
Deploy Services dispatched

Workflow opens deploy PR #30555 pinning prod tag. Staging needs no pin — it tracks image digests via ArgoCD Image Updater.

20:36
Infra provisioning config lands

phantom/infra #6851 adds the share database, client, and role to all three CockroachDB Pulumi stacks. Its production deploy run parks at the environment approval gate.

20:45–21:28
Parallel wiring fixes land

#30560 wires the service.cockroachdb block (DATABASE_URL) into the overlays; #30566 gives pods their own service account.

22:35
pham deploy → PR #30572 merged

Prod values pin global.deployment.tag: sha-14a8076. ArgoCD app backend-share created.

22:39
Prod sync fails — Degraded

PreSync job backend-share-migrate fails: it was created by the first sync before any tag existed, ran a pre-merge image, and yarn workspace share did not exist in it. The dead Job then blocks every later sync.

22:47
Staging verified live

staging-api.phantom.app/share/* answers with the service's own 404 — pods up, DB migrated, routing good.

23:10
Stale Job deleted, sync still fails

Fresh syncs now surface the deeper failure: ExternalSecret backend-share-cockroachdb.client.share → "Secret does not exist" (33 failures since 13:48). Prod has no cockroachdb/client/share secret in AWS Secrets Manager.

23:39
Infra approval arrives — too late

Gustavo approves the 3-hour-old Pulumi run; all three production deploy jobs refuse: "Refusing stale deployment: current main moved." Staging had deployed earlier while the commit was still head.

23:54
Three fresh dispatch runs

workflow_dispatch from current main for cockroachdb/databases, clients, and roles (production) — one project per dispatch, three approvals.

00:05
Infra stacks deploy green

share role + database + grants created, client cert generated, cockroachdb/client/share written to Secrets Manager with cross-region replicas.

00:11
Sync succeeds — rollout Healthy

ESO materializes the secret, migrate job passes, pods start at 11311d1.

00:13
Production verified live

api.phantom.app/share/* returns {"message":"Share not found"} — a real CRDB-backed response through the prod gateway.

02

Root causes

1

Immutable stale-image Job

The first ArgoCD sync ran before any image tag was pinned, so the PreSync migrate Job was created from a pre-merge image with no share workspace. Kubernetes Jobs are immutable — the dead Job wedged every subsequent sync until manually deleted.

RESOLUTION Delete the stuck Job; later syncs recreate it from the pinned image.

2

Missing prod DB provisioning

cockroachdb/client/share (and the prod share database/role themselves) did not exist. The infra PR that provisions them was correct — but its production Pulumi deploy sat unapproved for 3 hours.

RESOLUTION Approve + deploy the infra stacks; ESO picks up the secret within a minute.

3

Staleness guard vs slow approval

By the time the approval came, infra main had moved, and the deploy guard refused the stale commit — silently turning an approved run into a no-op failure.

RESOLUTION Re-dispatch fresh runs from current main (one per project), re-approve, deploy.

03

Final verification

CheckResult
Prod probe — GET api.phantom.app/share/AAAAAAAAAAservice 404 — DB-backed response
Staging probe — GET staging-api.phantom.app/share/*service 404
ArgoCD rollout backend-shareHealthy @ 11311d1
Presync migration jobpassed — 3 tables in prod CRDB
cockroachdb/client/share secret (ca-central-1 + replicas)created, ESO synced
Error logs since rolloutonly startup-probe noise during boot
Datadog monitors/SLOs (3 routes, tier1)active
ArgoCD autosyncstill disabled — re-enable via pham infra → [a]
04

Follow-ups

Re-enable autosync on backend-share (one keystroke in pham infra; reconciles the image pin 11311d1 → git tag sha-14a8076, identical share code). Worth raising with platform: a PreSync job created before the first tag pin can wedge new services (immutable Job + no BeforeHookCreation recovery path surfaced), and environment-gated infra deploys silently die on the staleness guard when approval lags — a re-dispatch hint in the failure annotation would have saved an hour.