Tencent/WeKnora · error
empty embedding vector for chunk ID
Error message
empty embedding vector for chunk ID: %s
What it means
Elasticsearch v8 save guard: the converted embedding document for the chunk carries a zero-length vector, meaning the chunk was indexed without an embedding (embedding failure upstream or unsupported content), and the save is rejected because ES cannot index an empty dense vector.
Solutions
- Verify the embedding pipeline produced a vector for this chunk
- Skip non-embeddable chunks instead of saving them
- Check embedding dimension/model configuration
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/application/repository/retriever/elasticsearch/v8/repository.go:167 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/875fba51d09638e8.
Report an issue: GitHub.
Appendix: source
Thrown at internal/application/repository/retriever/elasticsearch/v8/repository.go:167
logger.GetLogger(ctx).Infof(
"[Elasticsearch] Storage size for %d indices: %d bytes", len(indexInfoList), totalStorageSize,
)
return totalStorageSize
}
// Save stores a single index document in Elasticsearch
// Returns an error if the operation fails
func (e *elasticsearchRepository) Save(ctx context.Context,
embedding *typesLocal.IndexInfo,
additionalParams map[string]any,
) error {
log := logger.GetLogger(ctx)
log.Debugf("[Elasticsearch] Saving index for chunk ID: %s", embedding.ChunkID)
// Convert to database format
embeddingDB := elasticsearchRetriever.ToDBVectorEmbedding(embedding, additionalParams)
if len(embeddingDB.Embedding) == 0 {
err := fmt.Errorf("empty embedding vector for chunk ID: %s", embedding.ChunkID)
log.Errorf("[Elasticsearch] %v", err)
return err
}
// Index the document
resp, err := e.client.Index(e.index).Request(embeddingDB).Do(ctx)
if err != nil {
log.Errorf("[Elasticsearch] Failed to save index: %v", err)
return err
}
log.Infof("[Elasticsearch] Successfully saved index for chunk ID: %s, document ID: %s", embedding.ChunkID, resp.Id_)
return nil
}
// BatchSave stores multiple index documents in Elasticsearch using bulk API
// Returns an error if the operation fails
func (e *elasticsearchRepository) BatchSave(ctx context.Context,View on GitHub (pinned to 988cbb0330)