jaegertracing/jaeger · error

failed to check index existence: %w

Error message

failed to check index existence: %w

What it means

getLatestIndex checks IndexExists for each rotation candidate within the lookback window; a failure of the existence check itself is wrapped as 'failed to check index existence'. Distinct from the sentinel 'failed to find latest index' which means the checks succeeded but no index exists.

Source

Thrown at internal/storage/v1/elasticsearch/samplingstore/storage.go:171

func (s *SamplingStore) writeProbabilitiesAndQPS(indexName string, ts time.Time, pandqps dbmodel.ProbabilitiesAndQPS) error {
	// context.Background: see InsertThroughput.
	return s.batchWriter.WriteBatch(context.Background(), []esclient.BulkItem{{
		Index: indexName,
		Body: &dbmodel.TimeProbabilitiesAndQPS{
			Timestamp:           ts,
			ProbabilitiesAndQPS: pandqps,
		},
	}})
}

func (s *SamplingStore) getLatestIndex(ctx context.Context) (string, error) {
	now := s.now().UTC()
	candidates := s.rotation.ReadTargets(now.Add(-s.lookback), now)
	for _, idx := range candidates {
		exists, err := s.indexClient.IndexExists(ctx, idx)
		if err != nil {
			return "", fmt.Errorf("failed to check index existence: %w", err)
		}
		if exists {
			return idx, nil
		}
	}
	return "", errors.New("failed to find latest index")
}

func buildTSQuery(start, end time.Time) query.Query {
	return query.NewRangeQuery("timestamp").Gte(start).Lte(end)
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Check the wrapped cause and test the same IndexExists call manually against the cluster.
  2. Fix connectivity: addresses, TLS, credentials in the ES storage configuration.
  3. Verify the index-name prefix/rotation produces valid index names for the cluster.
  4. If the cause is 'failed to find latest index' instead, no fix to connectivity is needed — data simply hasn't been written.
Defensive patterns

Strategy: try-catch

Try / catch

probs, err := store.GetLatestProbabilities()
if err != nil {
  if strings.Contains(err.Error(), "failed to check index existence") {
    // ES client/connectivity problem — surface it
  } else if strings.Contains(err.Error(), "failed to find latest index") {
    // benign: no data yet — use defaults
  }
}

Prevention

When it happens

Trigger: Calling GetLatestProbabilities when the ES IndicesExists API call errors — cluster unreachable, authentication rejected, malformed index name pattern, or client misconfiguration.

Common situations: ES credentials rotated or revoked; wrong URL scheme/port in storage config; DNS or firewall issues; ES client version incompatible with the cluster's API.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/2df8fcaa049756f7. Report an issue: GitHub.