alibaba/nacos · critical · NacosException

AI resource Version row is invalid: {name}

Error message

AI resource Version row is invalid: {name}

What it means

A SERVER_ERROR (HTTP 500) thrown by deleteResourceWithVersions when a listed version row is null or its version column is blank. It signals corrupt or half-inserted data rather than a caller mistake: normal API usage cannot create such a row. Per-version failures are collected and the first is rethrown (others attached via addSuppressed), so the trace lists every bad row.

Source

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

     */
    @FunctionalInterface
    public interface VersionStorageDeleter {
        
        void deleteStorage(AiResourceVersion version) throws NacosException;
    }
    
    /**
     * Delete meta and all version rows for a resource, invoking the given deleter for each version's storage.
     */
    public void deleteResourceWithVersions(String namespaceId, String name, String type,
        VersionStorageDeleter storageDeleter) throws NacosException {
        List<AiResourceVersion> versions = listAllVersions(namespaceId, name, type);
        NacosException firstFailure = null;
        for (AiResourceVersion v : versions) {
            String version = v == null ? "unknown" : v.getVersion();
            try {
                if (v == null || StringUtils.isBlank(version)) {
                    throw new NacosException(NacosException.SERVER_ERROR,
                        "AI resource Version row is invalid: " + name);
                }
                storageDeleter.deleteStorage(v);
            } catch (Exception e) {
                NacosException failure = e instanceof NacosException ? (NacosException) e
                    : new NacosException(NacosException.SERVER_ERROR,
                        "Failed to delete AI resource storage: " + name + '@' + version, e);
                if (firstFailure == null) {
                    firstFailure = failure;
                } else {
                    firstFailure.addSuppressed(failure);
                }
            }
        }
        if (firstFailure != null) {
            throw firstFailure;
        }
        aiResourcePersistService.delete(namespaceId, name, type);

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Query ai_resource_version for the named resource and find rows where version IS NULL or the row is malformed; backfill or delete them.
  2. Check the server log for the suppressed exceptions to see every offending row/version.
  3. If no manual data corruption exists, file a bug — this path indicates a data-integrity defect, not user input.
  4. Re-run the delete after cleanup.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    skillOp.deleteSkill(ns, name);
} catch (NacosException e) {
    if (e.getErrCode() == NacosException.SERVER_ERROR
            && e.getErrMsg().contains("Version row is invalid")) {
        // data-integrity defect: alert ops, inspect ai_resource_version for null version rows
        alertOpsCorruptVersionRows(ns, name, e.getSuppressed());
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Deleting a skill/prompt/agentSpec whose ai_resource_version table contains a row with null version or a null row object; reached via SkillOperationServiceImpl.deleteSkill, PromptOperationServiceImpl, or AgentSpecOperationServiceImpl delete paths.

Common situations: A failed schema migration that left orphaned/null version rows; manual SQL edits against the version table; a crashed earlier write that inserted the meta but not the version column; a storage-dialect plugin bug producing null versions.

Related errors


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