JuliusBrussee/caveman · error

generate probe

Error message

generate probe: %w

What it means

Probe wraps crypto/rand.Read failures with 'generate probe:'. Probe generates 32 random bytes to build a unique health-probe object key; the library throws this only when the OS cryptographic random source fails, which is essentially an environment-level failure.

Solutions

  1. Fix the environment so crypto/rand works: restore /dev/urandom access or allow the getrandom syscall in seccomp/apparmor profiles.
  2. Retry the call — the failure is often transient at the OS level only in degraded states.
  3. If it persists, replace the sandbox image with a standard base image; this is not fixable from application code.
Defensive patterns

Strategy: retry

Try / catch

if err := objectstore.Probe(ctx, store); err != nil && strings.Contains(err.Error(), "generate probe") {
    // OS entropy failure: retry once, then fail the deployment
    time.Sleep(100 * time.Millisecond)
    err = objectstore.Probe(ctx, store)
}

Prevention

When it happens

Trigger: Calling objectstore.Probe (directly or via FromEnv production mode) on a system where crypto/rand cannot read from its entropy source — e.g. broken /dev/urandom in a container, seccomp blocking getrandom(2), or a heavily degraded host.

Common situations: Minimal/locked-down containers missing /dev/urandom or blocking the getrandom syscall; unusual sandboxed CI runners; kernel/fips configuration issues.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/516f2f892db1beb6. Report an issue: GitHub.

Appendix: source

Thrown at shared/platform/objectstore/objectstore.go:235

		Secure: cfg.UseSSL,
		Region: cfg.Region,
	})
	if err != nil {
		return nil, fmt.Errorf("objectstore: minio client: %w", err)
	}
	return &minioStore{client: client, bucket: cfg.Bucket}, nil
}

// Probe proves the operations production retention needs instead of accepting a
// syntactically valid but unusable bucket configuration. The random probe body
// contains no tenant data and every version is removed before success returns.
func Probe(ctx context.Context, store Store) error {
	if store == nil {
		return errors.New("store is nil")
	}
	probe := make([]byte, 32)
	if _, err := rand.Read(probe); err != nil {
		return fmt.Errorf("generate probe: %w", err)
	}
	key := "_cave_health/" + base64.RawURLEncoding.EncodeToString(probe)
	if err := store.Put(ctx, key, probe, "application/octet-stream"); err != nil {
		return err
	}
	cleaned := false
	defer func() {
		if !cleaned {
			// Keep health checks within their caller deadline. A failed probe may
			// leave one random, tenant-free canary for lifecycle cleanup; readiness
			// must never hang on an unbounded background delete.
			_ = PurgeObject(ctx, store, key)
		}
	}()
	got, err := store.Get(ctx, key)
	if err != nil {
		return err
	}

View on GitHub (pinned to 3ee70a1026)