weaviate/weaviate · error

get replication details for %q: %w

Error message

get replication details for %q: %w

What it means

ApplyReplicationScalePlan first lists existing replication operations for the target collection via GetReplicationDetailsByCollection before allowing a scale. This error wraps any failure of that lookup other than ErrReplicationOperationNotFound (which is treated as 'no ongoing ops'). It means the pre-flight check itself failed, so the scale plan is rejected without applying anything.

Source

Thrown at cluster/raft_replication_apply_endpoints.go:33

	"context"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
	"time"

	"github.com/go-openapi/strfmt"
	"github.com/google/uuid"
	"github.com/weaviate/weaviate/cluster/proto/api"
	"github.com/weaviate/weaviate/cluster/replication"
	replicationTypes "github.com/weaviate/weaviate/cluster/replication/types"
)

func (s *Raft) ApplyReplicationScalePlan(ctx context.Context, scalePlan api.ReplicationScalePlan) (opsUUIDs []strfmt.UUID, err error) {
	// while not strictly necessary, scaling while there are ongoing replications is disallowed
	ops, err := s.GetReplicationDetailsByCollection(ctx, scalePlan.Collection)
	if err != nil && !errors.Is(err, replicationTypes.ErrReplicationOperationNotFound) {
		return nil, fmt.Errorf("get replication details for %q: %w", scalePlan.Collection, err)
	}
	for _, op := range ops {
		if api.ShardReplicationState(op.Status.State) != api.CANCELLED && api.ShardReplicationState(op.Status.State) != api.READY {
			return nil, fmt.Errorf("cannot scale while there are ongoing replications for collection %q", scalePlan.Collection)
		}
	}

	// validate scale plan
	for shardName, shardActions := range scalePlan.ShardReplicationScaleActions {
		sourceNodeUsage := make(map[string]int)

		for newNode, sourceNode := range shardActions.AddNodes {
			if newNode == sourceNode {
				return nil, fmt.Errorf("node %q in shard %q cannot be added as replica from itself", newNode, shardName)
			}

			if _, isBeingRemoved := shardActions.RemoveNodes[newNode]; isBeingRemoved {
				return nil, fmt.Errorf("node %q in shard %q cannot be both removed and added", newNode, shardName)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Retry the scale-plan request once the node is fully started and the leader is stable.
  2. Check weaviate logs for the underlying error from GetReplicationDetailsByCollection to fix the storage/state cause.
  3. Increase the client request timeout if context deadline exceeded is the wrapped cause.
  4. If the replication state store is corrupted, restart the node or use force-delete replication endpoints to reset op state before scaling.
Defensive patterns

Strategy: retry

Validate before calling

// poll node readiness before scaling
// GET /v1/nodes → ensure all nodes report status HEALTHY and a leader exists

Try / catch

var ops []strfmt.UUID
err := retry.Do(func() error {
	ops, err = cluster.ApplyReplicationScalePlan(ctx, plan)
	if err != nil && strings.Contains(err.Error(), "get replication details") {
		return retry.RetryableError(err) // transient state-store/context issue
	}
	return err
}, retry.Attempts(3), retry.Delay(2*time.Second))

Prevention

When it happens

Trigger: Calling ApplyReplicationScalePlan (or the replication scale-plan REST/gRPC API) when the in-memory replication ops store is unavailable/errored, the context is cancelled or times out, or the collection lookup returns an unexpected error.

Common situations: Requesting a scale plan while the node is starting up or the replication state store is corrupted/reindexing; client timeouts cancelling the context mid-lookup; schema manager not ready after leader change.

Related errors


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