SigNoz/signoz · warning · model.ApiError

query %s doesn't exist

Error message

query %s doesn't exist

What it means

NotFoundError from getQueryTracker when the requested queryId has no entry in the in-memory tracker — either the query was never registered via ReportQueryStarted, it already finished and was removed, or it was registered on a different query-service replica (the tracker is per-process, in-memory).

Source

Thrown at pkg/query-service/app/clickhouseReader/query_progress/inmemory_tracker.go:87

	if queryTracker != nil {
		delete(tracker.queries, queryId)
	}
	tracker.lock.Unlock()

	if queryTracker != nil {
		queryTracker.onFinished()
	}
}

func (tracker *inMemoryQueryProgressTracker) getQueryTracker(
	queryId string,
) (*queryTracker, *model.ApiError) {
	tracker.lock.RLock()
	defer tracker.lock.RUnlock()

	queryTracker := tracker.queries[queryId]
	if queryTracker == nil {
		return nil, model.NotFoundError(fmt.Errorf(
			"query %s doesn't exist", queryId,
		))
	}

	return queryTracker, nil
}

// Tracks progress and manages subscriptions for a single query
type queryTracker struct {
	logger     *slog.Logger
	queryId    string
	isFinished bool

	progress      *model.QueryProgress
	subscriptions map[string]*queryProgressSubscription

	lock sync.Mutex
}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Verify ReportQueryStarted succeeded and returned a cleanup func for that exact queryId
  2. Subscribe/report before the query finishes and keep the ID from the start call
  3. Use sticky routing (same client to same replica) or move to a shared tracker backend for multi-replica setups
  4. Treat NotFound as terminal: don't loop retrying a finished query's progress
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the query is registered on this instance before reporting
if _, apiErr := tracker.GetTracker(queryId); apiErr != nil {
    return fmt.Errorf("query not tracked here; route to owning replica")
}

Type guard

func isQueryNotTracked(apiErr *model.ApiError) bool {
    return apiErr != nil && apiErr.Typ == model.ErrorNotFound && strings.Contains(apiErr.Err.Error(), "doesn't exist")
}

Try / catch

if _, apiErr := tracker.ReportQueryProgress(ctx, queryId, p); isQueryNotTracked(apiErr) {
    // finished or wrong replica: stop reporting, don't retry blindly
    return nil
}

Prevention

When it happens

Trigger: Calling ReportQueryProgress or SubscribeToQueryProgress with a queryId that was never started, after postQueryCleanup removed it, or against a different instance behind a load balancer.

Common situations: Multi-replica query-service deployments where progress reports/subscription requests land on a different pod than the one running the query; subscribing after the query finished; stale IDs from a restarted service.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/4b975474607b3176. Report an issue: GitHub.