Skip to content
Latchkey

Apigee "deploy ... revision failed" in CI

Apigee imported the proxy revision but the deployment to the environment failed. The bundle has a policy reference, resource, or target that the environment cannot resolve, so the revision does not go live.

What this error means

apigeecli apis deploy (or the management API) returns a deployment error naming the policy or resource, and the revision stays undeployed.

apigee
Error: deployment failed: Error in deployment for environment test.
The revision is deployed, but the deployment had errors: ...

Common causes

A policy references a missing resource

A JavaScript, XSL, or key-value map referenced by a policy is not in the bundle or environment, so deployment errors.

A target or flow misconfiguration

A broken target endpoint, route rule, or shared flow reference makes the environment reject the revision.

How to fix it

Resolve the policy or resource error

  1. Read the deployment error to find the failing policy or resource.
  2. Add the missing resource to the bundle or fix the reference.
  3. Re-import and re-deploy the revision.
Terminal
apigeecli apis deploy --name my-proxy --org "$ORG" \
  --env test --rev 7 -t "$APIGEE_TOKEN"

Validate the bundle before deploy

Lint the proxy bundle so policy and resource references are checked before the environment sees the revision.

Terminal
apigeelint -s apiproxy/ -f table.js

How to prevent it

  • Lint the proxy bundle in CI before importing.
  • Keep referenced resources (JS, KVM, shared flows) inside the bundle or env.
  • Deploy to a test environment before production.

Frequently asked questions

What causes "Apigee "deployment failed""?
A JavaScript, XSL, or key-value map referenced by a policy is not in the bundle or environment, so deployment errors.
How do I fix Apigee "deployment failed"?
Resolve the policy or resource error

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card