iflytek/astron-agent · critical · BusinessException

REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED

REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED

Error message

REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED

What it means

BusinessException REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED thrown by applyPushResult when, for an AIUI-RAG compatible source, every knowledge point sent to the external embedding/knowledge service failed (failedKnowledge.size() >= knowledgeList.size()). A total failure means nothing was embedded, so the operation is aborted rather than partially applied. Partial failures are tolerated by disabling only the failed points.

Solutions

  1. Check AIUI service health/credentials: validate API key/token and that the target dataset still exists.
  2. Inspect logs for the per-batch errors from addKnowledge4AIUI (they precede this aggregate error) to find the root failure (auth vs. payload vs. network).
  3. Retry the embed/confirm operation after the external service recovers; state on the local side is only changed after this throw.
  4. Reduce maxSaveCount batch size if payloads are being rejected for size, and verify chunk contents for invalid characters.

Example fix

// before
if (!push.failedKnowledge.isEmpty() && push.failedKnowledge.size() >= knowledgeList.size()) {
    throw new BusinessException(ResponseEnum.REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED);
}
// after (bounded retry before giving up)
if (allFailed && retryCount < MAX_RETRIES) {
    push = pushChunksBySource(fileId, uuid, addArray); // retry batch
} else if (allFailed) {
    throw new BusinessException(ResponseEnum.REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED);
}
Defensive patterns

Strategy: retry

Validate before calling

// before embedding, ping the AIUI endpoint
datasetHealth = knowledgeV2ServiceCallHandler.checkDataset(coreRepoId, ragflowDatasetId);
if (!datasetHealth.isOk()) { alertOps(); return; }

Try / catch

try { embeddingFlow.confirm(fileId); } catch (BusinessException e) { if ("REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED".equals(e.getCode())) { scheduleRetryWithBackoff(fileId); } else { throw e; } }

Prevention

When it happens

Trigger: Confirm/embed flow (pushChunksBySource -> addKnowledge4AIUI) where every batch insert into the AIUI knowledge base failed — e.g., AIUI service down, auth/token invalid, dataset id wrong, request payloads rejected (size/format), or network timeouts causing each batch's exception to mark its chunk ids failed.

Common situations: AIUI RAG endpoint credentials expired or quota exhausted. Wrong ragflowDatasetId/coreRepoId configured for the repo. Large documents whose chunks exceed AIUI batch limits. Network partition between console backend and AIUI service.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/454c6c884fa3a467. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/KnowledgeService.java:1194

                        log.error("Failed to get CBG task result", e);
                    }
                }
            } finally {
                pool.shutdown();
            }
            return r;
        }

        // Unknown source: no external push
        return r;
    }

    private void applyPushResult(List<Knowledge> knowledgeList, List<Knowledge> oldAuto, PushResult push, Long fileId) {
        if (ProjectContent.isAiuiRagCompatible(push.source)) {
            // Throw error if all failed
            if (!push.failedKnowledge.isEmpty() && push.failedKnowledge.size() >= knowledgeList.size()) {
                log.error("All knowledge points embedding failed, fileId:{}, failed:{}, total:{}", fileId, push.failedKnowledge.size(), knowledgeList.size());
                throw new BusinessException(ResponseEnum.REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED);
            }
            if (!CollectionUtils.isEmpty(push.failedKnowledge)) {
                for (Knowledge k : knowledgeList) {
                    if (push.failedKnowledge.contains(k.getId())) {
                        k.setEnabled(0);
                    }
                }
            }
            return;
        }

        if (ProjectContent.isCbgRagCompatible(push.source)) {
            // Map dataIndex -> id back to Knowledge.id
            for (Knowledge k : knowledgeList) {
                String dataIndex = k.getContent().getString("dataIndex");
                k.setId(push.cbgKnowledgeMap.get(dataIndex));
            }
            // CBG scenario: will delete oldAuto and save new data later, logic consistent with original

View on GitHub (pinned to 5e758547a8)