weaviate/weaviate · error

cannot parse rerank %v

Error message

cannot parse rerank %v

What it means

Type-guard failure in extractGroup: the 'rerank' additional property is present but is not []*additionalModels.RankAdditionalProperty (e.g. nil, a single object, or a different type). The rerank module attached its output in an unexpected shape, so reply serialization cannot proceed. Indicates a module/server version inconsistency rather than client misuse.

Source

Thrown at adapters/handlers/grpc/v1/prepare_reply.go:486

		}

		// grouped results are only added to the first object for GQL reasons
		// however, reranking can result in a different order, so we need to check every object
		// recording the result if it's present assuming that it is at least somewhere and will be caught
		if generateFmt.GroupedResult != nil && *generateFmt.GroupedResult != "" {
			groupedGenerativeResults = *generateFmt.GroupedResult
		}
	}

	if rerankEnabled {
		rerankRaw, ok := addProps["rerank"]
		if !ok {
			return nil, "", fmt.Errorf("rerank is not present %v", addProps)
		}

		rerank, ok := rerankRaw.([]*additionalModels.RankResult)
		if !ok {
			return nil, "", fmt.Errorf("cannot parse rerank %v", rerankRaw)
		}
		ret.Rerank = &pb.RerankReply{
			Score: *rerank[0].Score,
		}
	}

	// group results does not support more additional properties
	searchParams.AdditionalProperties = additional.Properties{
		ID:       searchParams.AdditionalProperties.ID,
		Vector:   searchParams.AdditionalProperties.Vector,
		Vectors:  searchParams.AdditionalProperties.Vectors,
		Distance: searchParams.AdditionalProperties.Distance,
	}

	// group objects are returned as a different type than normal results ([]map[string]interface{} vs []interface). As
	// the normal path is used much more often than groupBy, convert the []map[string]interface{} to []interface{}, even
	// though we cast it to map[string]interface{} in the extraction function.
	// This way we only do a copy for groupBy and not for the standard code-path which is used more often

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Verify the rerank module version matches the server
  2. Report as a bug with the observed type
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at adapters/handlers/grpc/v1/prepare_reply.go:486 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/fed531043040831d. Report an issue: GitHub.