Skip to content
Latchkey

Fastly service version not activated after deploy in CI

The Fastly config change did not take effect because the new service version was cloned and edited as a draft but never activated. Only an activated version serves traffic; a draft sits inactive.

What this error means

The pipeline reports success creating and updating a version, yet the live service behaves as before. Listing versions shows the new one with "active": false.

Fastly API
{ "number": 42, "active": false, "locked": false, "comment": "ci: update backend" }
# new version exists but was never activated, so version 41 still serves traffic

Common causes

The activate step was omitted

The workflow clones the active version and edits the draft but stops before calling activate, so the change never goes live.

Activation failed validation and was skipped

A validate error left the draft unactivated, and the pipeline continued without failing, so the old version remains active.

How to fix it

Validate then activate the new version

  1. Clone the active version and apply changes to the draft.
  2. Validate the draft version.
  3. Activate it so the edge serves the new configuration.
Terminal
# validate, then activate version $VER
curl -sS "https://api.fastly.com/service/${SID}/version/${VER}/validate" \
  -H "Fastly-Key: ${FASTLY_API_TOKEN}"
curl -sS -X PUT "https://api.fastly.com/service/${SID}/version/${VER}/activate" \
  -H "Fastly-Key: ${FASTLY_API_TOKEN}"

Fail the job if activation does not succeed

Treat a non-active result as a failure so a silent draft does not pass CI.

Terminal
active=$(curl -s "https://api.fastly.com/service/${SID}/version/${VER}" \
  -H "Fastly-Key: ${FASTLY_API_TOKEN}" | jq -r .active)
[ "$active" = "true" ] || { echo "version not activated"; exit 1; }

How to prevent it

  • Always follow a version edit with validate and activate.
  • Assert the new version is active before finishing the job.
  • Fail the deploy when activation does not report active true.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →