alibaba/nacos · critical · NacosApiException
30000
30000
Error message
Meta version missing
What it means
Thrown by updateMetaDescriptionCas when the passed AiResource meta is null or its metaVersion field is null. This is a server-side programming error (HTTP 500, SERVER_ERROR code 30000) indicating the caller invoked a CAS update without a properly loaded meta row. It should never reach end users under normal operation.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/prompt/PromptOperationServiceImpl.java:927
if (StringUtils.isBlank(json)) {
return null;
}
try {
return JacksonUtils.toObj(json, PromptVersionInfoPojo.class);
} catch (Exception e) {
return null;
}
}
private void updateMetaBizTagsCas(String namespaceId, AiResource meta, String bizTags)
throws NacosException {
resourceManager.updateBizTagsCas(namespaceId, meta, bizTags);
}
private void updateMetaDescriptionCas(String namespaceId, AiResource meta, String description)
throws NacosException {
if (meta == null || meta.getMetaVersion() == null) {
throw new NacosApiException(NacosException.SERVER_ERROR, ErrorCode.SERVER_ERROR,
"Meta version missing");
}
resourceManager.bumpMetaDescription(namespaceId, meta, description);
}
private void validateVersion(String version) throws NacosApiException {
if (!PromptVersionUtils.isValidVersion(version)) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Version must be in format major.minor.patch, got: " + version);
}
}
/**
* Load all version rows for a prompt by paginating through all pages.
*/
private List<AiResourceVersion> loadAllVersionRows(String namespaceId, String promptKey) {
List<AiResourceVersion> all = new ArrayList<>();View on GitHub (pinned to 9b989acdf1)
Solutions
- Ensure the caller reloads the meta immediately before the CAS update and handles NOT_FOUND gracefully.
- Add a null-check on meta before calling updateMetaDescriptionCas and throw a descriptive NOT_FOUND instead.
- Investigate why the meta row was deleted or has a null metaVersion — this indicates a data integrity issue.
- If seen in production, check for concurrent delete operations on the same prompt.
Example fix
// before AiResource meta = resourceManager.findMeta(ns, key, RESOURCE_TYPE_PROMPT); updateMetaDescriptionCas(ns, meta, newDesc); // meta may be null // after AiResource meta = resourceManager.requireMeta(ns, key, RESOURCE_TYPE_PROMPT); updateMetaDescriptionCas(ns, meta, newDesc);
Defensive patterns
Strategy: try-catch
Validate before calling
// Reload meta immediately before CAS update
AiResource meta = resourceManager.requireMeta(ns, key, RESOURCE_TYPE_PROMPT);
if (meta == null || meta.getMetaVersion() == null) {
// resource missing or corrupted — do not proceed
return;
} Type guard
boolean metaReadyForCas = meta != null && meta.getMetaVersion() != null;
Try / catch
try {
resourceManager.updateMetaDescriptionCas(ns, meta, newDesc);
} catch (NacosApiException e) {
if (e.getErrCode() == NacosException.SERVER_ERROR
&& e.getMessage().contains("Meta version missing")) {
// reload and retry once, or report data integrity issue
}
throw e;
} Prevention
- Always use requireMeta (which throws NOT_FOUND) instead of findMeta before CAS operations.
- Never pass a stale or manually-constructed AiResource to a CAS update.
- In code review, flag any path that calls updateMeta*Cas without a preceding fresh meta load.
When it happens
Trigger: Internal code path calls updateMetaDescriptionCas with a meta object obtained from findMeta that returned null (prompt deleted between the initial load and the CAS call), or with a meta that has a null metaVersion due to a corrupted/partially-inserted row.
Common situations: Race condition: prompt deleted after loadMeta but before description update; database inconsistency leaving metaVersion null; internal refactoring passing an unloaded meta reference.
Related errors
- 30000
- Invalid persisted Agent tags
- Persisted Agent tags must be a JSON array
- Persisted Agent tags must contain only strings
- Stored Agent versionInfo must not be null
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/57bab603de7298d9.
Report an issue: GitHub.