alibaba/nacos · warning · NacosApiException

RESOURCE_CONFLICT

RESOURCE_CONFLICT

Error message

There is already a working version (editing/reviewing), cannot {action}

What it means

Thrown by ensureNoWorkingVersion when either editingVersion or reviewingVersion is non-blank. A resource may have at most one in-flight working version at a time; attempting to start another draft/submit/upload is rejected. Maps to RESOURCE_CONFLICT (409).

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java:1357

            return latest;
        }
        List<String> existingVersions = listExistingVersions(namespaceId, name, type);
        String maxSemver = VersionUtils.maxSemver(existingVersions);
        return StringUtils.isNotBlank(maxSemver) ? maxSemver
            : VersionUtils.maxVNumberVersion(existingVersions);
    }
    
    /**
     * Ensure no editing or reviewing version exists; throw CONFLICT otherwise.
     *
     * @param info   the parsed version info
     * @param action action description for error message (e.g. "upload", "create draft")
     */
    public static void ensureNoWorkingVersion(ResourceVersionInfo info, String action)
        throws NacosException {
        if (StringUtils.isNotBlank(info.getEditingVersion())
            || StringUtils.isNotBlank(info.getReviewingVersion())) {
            throw new NacosApiException(NacosException.CONFLICT, ErrorCode.RESOURCE_CONFLICT,
                "There is already a working version (editing/reviewing), cannot " + action);
        }
    }
    
    private static void ensureNoEditingVersion(ResourceVersionInfo info, String action)
        throws NacosException {
        if (StringUtils.isNotBlank(info.getEditingVersion())) {
            throw new NacosApiException(NacosException.CONFLICT, ErrorCode.RESOURCE_CONFLICT,
                "There is already an editing version, cannot " + action);
        }
    }
    
    private static void ensureNoOtherWorkingVersion(ResourceVersionInfo info, String version,
        String action)
        throws NacosException {
        if ((StringUtils.isNotBlank(info.getEditingVersion())
            && !StringUtils.equals(info.getEditingVersion(), version))
            || (StringUtils.isNotBlank(info.getReviewingVersion())

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Submit or discard the existing editing/reviewing version before starting a new one.
  2. Re-fetch version info to show the user the in-flight version and let them resolve it first.
  3. If the working version is stale/abandoned, transition it to a terminal state or remove it before retrying.

Example fix

// before: creating a draft while one already exists
manager.createDraft(ns, name, type, null); // throws via ensureNoWorkingVersion
// after: resolve the existing draft first
// (submit it, or discard it) then create the new draft
Defensive patterns

Strategy: validation

Validate before calling

AiResourceManager.ensureNoWorkingVersion(info, action); // call the same guard first
// or inline:
if (StringUtils.isNotBlank(info.getEditingVersion())
    || StringUtils.isNotBlank(info.getReviewingVersion())) {
    return conflict(action);
}

Try / catch

try {
    manager.createDraft(ns, name, type, basedOnVersion);
} catch (NacosApiException e) {
    if (e.getErrCode() == NacosException.CONFLICT
        && e.getMessage().contains("working version")) {
        // prompt user to submit/discard the existing draft or reviewing version
    } else { throw e; }
}

Prevention

When it happens

Trigger: Create-draft or upload API called on a resource that already has a draft (editingVersion) or a version under review (reviewingVersion). The action name is interpolated into the message (e.g. 'upload', 'create draft').

Common situations: Two operators editing the same resource concurrently; a previous draft was abandoned without being submitted or discarded; UI allows 'new draft' while a review is pending.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/73124ddcb31faf8a. Report an issue: GitHub.