nats-io/nats-server · error

no impl

Error message

no impl

What it means

memStore.Snapshot is not implemented for the memory store, so any request for a stream state snapshot (used by mirror/source replication and backups) on a memory-backed stream fails immediately with this sentinel-style error.

Source

Thrown at server/memstore.go:2640

	ms.mu.Unlock()
	return nil
}

func (ms *memStore) Consumers() iter.Seq[ConsumerStore] {
	return func(yield func(ConsumerStore) bool) {
		ms.mu.RLock()
		defer ms.mu.RUnlock()

		for _, v := range ms.consumers {
			if !yield(v) {
				return
			}
		}
	}
}

func (ms *memStore) Snapshot(_ time.Duration, _, _ bool) (*SnapshotResult, error) {
	return nil, fmt.Errorf("no impl")
}

// Binary encoded state snapshot, >= v2.10 server.
func (ms *memStore) EncodedStreamState(failed uint64, withSources bool) ([]byte, error) {
	ms.mu.RLock()
	defer ms.mu.RUnlock()

	withSources = withSources && len(ms.sources) > 0
	version := streamStateVersion

	// Quick calculate num deleted.
	numDeleted := int((ms.state.LastSeq - ms.state.FirstSeq + 1) - ms.state.Msgs)
	if numDeleted < 0 {
		numDeleted = 0
	}

	// Encoded is Msgs, Bytes, FirstSeq, LastSeq, Failed, NumDeleted and optional DeletedBlocks.
	// Calculate the exact encoded size up front so the buffer is allocated once.

View on GitHub (pinned to 3a66a489d2)

Solutions

  1. Use a file-backed stream when snapshot support is required
  2. Use EncodedStreamState instead, which memory stores do implement
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/memstore.go:2640 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02). Data as JSON: /api/errors/24125727d58f6787. Report an issue: GitHub.