Release Failures#
Troubleshooting guide for errors during apx release and canonical CI.
Authentication & Permissions#
gh: not authenticated#
Error: gh: not authenticated. Run "gh auth login" to authenticate.
Cause: The GitHub CLI is required for PR-based releasing but is not authenticated.
Fix:
gh auth login
# Choose "GitHub.com" → "HTTPS" → authenticate via browser
CI: could not create installation token#
Error: could not create installation token for app
Cause: The GitHub App is not installed on the target repository, or the secrets are misconfigured.
Fix:
Ensure the GitHub App is installed on both the source and canonical repos
Verify org-level secrets:
APX_APP_ID— the GitHub App’s numeric IDAPX_APP_PRIVATE_KEY— the App’s PEM private key
Confirm the App has write access to Contents, Pull Requests, and Metadata
remote: Permission denied#
remote: Permission to org/apis.git denied to github-actions[bot]
Cause: The generated token doesn’t have write access to the canonical repo.
Fix:
Confirm the GitHub App is installed on the canonical repo (not just the source)
Check the App’s repository access settings in Organization → Settings → GitHub Apps
PR Creation Failures#
gh pr create fails with 422#
GraphQL: Validation Failed (422)
Cause: A PR with the same branch name already exists, or the branch is empty.
Fix:
Check for existing open PRs:
gh pr list --repo org/apis --head apx/release/proto/payments/ledger/v1/v1.0.0If a stale PR exists, close it and retry
Verify the snapshot actually contains file changes
PR opened but CI fails on canonical repo#
The canonical repo’s ci.yml re-validates schemas in the canonical context.
Common causes:
Conflicting proto packages — another API in the canonical repo uses the same proto package name
Inconsistent
buf.yaml— the canonical repo’sbuf.yamlhas different lint rulesBreaking changes detected —
apx breaking --against origin/mainfails because the baseline in the canonical repo differs from the app repo
Fix: Fix the issue locally, bump the version or correct the schema, and re-release.
Version & Release Errors#
version already released#
Release proto/payments/ledger/v1@v1.0.0 already exists with identical content (SHA-256 match)
This is an informational message, not an error. APX’s idempotency check detected that the exact same content was already released at this version. No action is needed.
version v2.0.0 is incompatible with API line v1#
The SemVer major version must match the declared API line. To release v2.0.0, create a new v2 API directory:
proto/payments/ledger/v2/
Then release with proto/payments/ledger/v2 as the API ID.
lifecycle "stable" requires a stable version#
Prerelease versions (e.g. -beta.1) cannot be released under the stable lifecycle. Either:
Change the lifecycle to
beta(allows prerelease versions)Remove the prerelease suffix to release a stable version
Release Pipeline Errors#
release state is "draft", expected "prepared"#
Error: cannot submit: release state is "draft", expected "prepared"
Cause: Attempted to run apx release submit before apx release prepare.
Fix: Follow the pipeline in order:
apx release prepare # 1. validate and stage (run by you, in app repo)
apx release submit # 2. create PR on canonical (run by you, in app repo)
# apx release finalize is run automatically by canonical CI after the PR merges — not by you
release submit on a non-existent canonical repo#
Error: repository "org/apis" not found
Fix:
Verify
canonical_repoinapx.yamlmatches the actual repo nameEnsure the GitHub App (CI) or your credentials (local) have access to the repo
Merge conflicts on canonical PR#
If another API was merged to the canonical repo between submit and merge, the PR may have conflicts.
Fix:
Close the existing PR
Re-run
apx release submit— it will create a fresh PR based on latestmain
Tag Errors#
tag already exists#
Error: tag proto/payments/ledger/v1/v1.0.0 already exists
Cause: The version was previously released and tagged.
Fix: Bump the version (patch at minimum) for any new release.
Dry Run#
Use --dry-run to preview the full release flow without creating branches, PRs, or tags:
apx release prepare proto/payments/ledger/v1 --version v1.0.0 --dry-run
apx release submit --dry-run
See Also#
Common Errors — general APX error reference
Release Guardrails — lifecycle and version enforcement
Release Commands — full command reference
CI Integration — CI workflow setup