apolloconfig/apollo · error · BadRequestException
release is not active
Error message
release is not active
What it means
Thrown as BadRequestException (HTTP 400) by ReleaseService.rollback when the target release.isAbandoned() is true. Rollback can only operate on an active release; an already-abandoned release cannot be rolled back again.
Source
Thrown at apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseService.java:458
release.setNamespaceName(namespace.getNamespaceName());
release.setConfigurations(GSON.toJson(configurations));
release = releaseRepository.save(release);
namespaceLockService.unlock(namespace.getId());
auditService.audit(Release.class.getSimpleName(), release.getId(), Audit.OP.INSERT,
release.getDataChangeCreatedBy());
return release;
}
@Transactional
public Release rollback(long releaseId, String operator) {
Release release = findOne(releaseId);
if (release == null) {
throw NotFoundException.releaseNotFound(releaseId);
}
if (release.isAbandoned()) {
throw new BadRequestException("release is not active");
}
String appId = release.getAppId();
String clusterName = release.getClusterName();
String namespaceName = release.getNamespaceName();
PageRequest page = PageRequest.of(0, 2);
List<Release> twoLatestActiveReleases =
findActiveReleases(appId, clusterName, namespaceName, page);
if (twoLatestActiveReleases == null || twoLatestActiveReleases.size() < 2) {
throw new BadRequestException(
"Can't rollback namespace(appId=%s, clusterName=%s, namespaceName=%s) because there is only one active release",
appId, clusterName, namespaceName);
}
release.setAbandoned(true);
release.setDataChangeLastModifiedBy(operator);
View on GitHub (pinned to d95fc18d11)
Solutions
- Pick the current latest ACTIVE release as the rollback target (query findActiveReleases).
- If you want that older configuration, publish a new release with the desired config instead of rolling back an abandoned one.
Example fix
// before releaseService.rollback(abandonedReleaseId, operator); // 400 // after Release active = releaseService.findLatestActiveRelease(appId, cluster, ns); releaseService.rollback(active.getId(), operator);
Defensive patterns
Strategy: validation
Validate before calling
Release release = releaseService.findOne(releaseId);
if (release == null || release.isAbandoned()) {
// resolve the latest ACTIVE release before rollback
} Try / catch
try {
releaseService.rollback(releaseId, operator);
} catch (BadRequestException e) {
if ("release is not active".equals(e.getMessage())) {
// pick latest active release and retry
} else throw e;
} Prevention
- Always resolve the latest active release before offering rollback.
- Avoid reusing cached/stale release ids.
When it happens
Trigger: Calling rollback(releaseId) for a release whose abandoned flag is already set (it was previously rolled back or abandoned).
Common situations: Re-rolling back an already-rolled-back release; pointing tooling at a stale release id that has since been abandoned.
Related errors
- Can't rollback namespace(appId=%s, clusterName=%s, namespace
- current release equal to target release
- value too long. length limit:%s
- key too long. length limit:%s
- type is invalid. type should be in [0, 3].
AI-assisted analysis of apolloconfig/apollo@d95fc18d11 (2026-08-14).
Data as JSON: /api/errors/9baa7cfe2d31df95.
Report an issue: GitHub.