alibaba/nacos · error · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
Only reviewing version can be published: {version} What it means
Thrown inside doPublish when the version exists but its status is none of reviewing/reviewed/online. Only versions that have entered (or completed) review may be published; a 'draft' or 'offline' version cannot be published directly. Maps to PARAMETER_VALIDATE_ERROR (INVALID_PARAM). Note the message text ('Only reviewing version can be published') is narrower than the code, which also permits reviewed and online as no-op/idempotent paths.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:968
private AiResourceVersion doPublish(String namespaceId, String name, String type,
String version, boolean checkVisibility, String operator, String clientIp)
throws NacosException {
AiResource meta = requireMeta(namespaceId, name, type);
if (checkVisibility) {
VisibilityHelper.checkWritableResource(meta);
}
ResourceVersionInfo info = requireVersionInfo(meta);
AiResourceVersion v =
aiResourceVersionPersistService.find(namespaceId, name, type, version);
if (v == null) {
throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,
type + " version not found: " + name + "@" + version);
}
if (!AiResourceConstants.VERSION_STATUS_REVIEWING.equalsIgnoreCase(v.getStatus())
&& !AiResourceConstants.VERSION_STATUS_REVIEWED.equalsIgnoreCase(v.getStatus())
&& !AiResourceConstants.VERSION_STATUS_ONLINE.equalsIgnoreCase(v.getStatus())) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Only reviewing version can be published: " + version);
}
PublishPipelineInfo pipelineInfo = parsePublishPipelineInfo(v.getPublishPipelineInfo());
if (pipelineInfo != null && StringUtils.isNotBlank(pipelineInfo.getExecutionId())) {
PipelineExecution execution =
pipelineExecutionRepository.findById(pipelineInfo.getExecutionId());
if (execution == null) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Pipeline execution not found, cannot publish: " + version);
}
if (execution.getStatus() != PipelineExecutionStatus.APPROVED) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Pipeline not approved, cannot publish: " + version);
}View on GitHub (pinned to 9b989acdf1)
Solutions
- Submit the version to review (moveToReviewing) and wait for review approval before publishing.
- If the version is offline, create a new draft from it and run the full submit→review→publish flow.
- Use force-publish (doForcePublish) only if policy explicitly permits bypassing review.
Example fix
// before: publishing a draft version manager.doPublish(ns, name, type, "v1.0", ...); // throws, v1.0 is draft // after: submit to review, then publish once reviewed manager.moveToReviewing(ns, name, type, "v1.0", meta, info); // ... after review approval ... manager.doPublish(ns, name, type, "v1.0", ...);
Defensive patterns
Strategy: validation
Validate before calling
Set<String> publishable = Set.of("reviewing", "reviewed", "online");
if (!publishable.contains(v.getStatus().toLowerCase())) {
// submit to review first
} Try / catch
try {
manager.doPublish(ns, name, type, version, ...);
} catch (NacosApiException e) {
if (e.getErrCode() == NacosException.INVALID_PARAM
&& e.getMessage().contains("can be published")) {
// run moveToReviewing then wait for approval, then publish
} else { throw e; }
} Prevention
- Publish only versions that have completed review.
- For offline versions, start a fresh draft/submit/review cycle rather than direct publish.
When it happens
Trigger: Publishing a draft version that was never submitted to review; publishing an offline version directly (must go through a new draft/submit/review cycle); publishing a version still in draft.
Common situations: Operator tries to publish straight from draft, skipping review; the version was offline and someone attempts a direct re-publish.
Related errors
- Agent publish request must not be null
- 20002
- RESOURCE_NOT_FOUND
- Online Agent Version must contain callInterfaces
- Agent Version namespaceId does not match request
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/66eb97490a8daaa7.
Report an issue: GitHub.