SigNoz/signoz · warning · model.ApiError

ErrorNotFound

ErrorNotFound

Error message

Error/Exception not found

What it means

Thrown by ClickHouseReader.GetError/GetErrorFromGroupID-style lookup when the SQL query executed successfully but returned zero rows for the requested error/exception ID or group. It is a 404-style ErrorNotFound signal from the query-service layer, meaning the error event no longer exists in the distributed_signoz_errors table (or the passed ErrorID is wrong).

Source

Thrown at pkg/query-service/app/clickhouseReader/reader.go:2389

	})
	var getErrorWithSpanReponse []model.ErrorWithSpan

	query := fmt.Sprintf("SELECT errorID, exceptionType, exceptionStacktrace, exceptionEscaped, exceptionMessage, timestamp, spanID, traceID, serviceName, groupID FROM %s.%s WHERE timestamp = @timestamp AND groupID = @groupID LIMIT 1", r.TraceDB, r.errorTable)
	args := []interface{}{clickhouse.Named("groupID", queryParams.GroupID), clickhouse.Named("timestamp", strconv.FormatInt(queryParams.Timestamp.UnixNano(), 10))}

	err := r.db.Select(ctx, &getErrorWithSpanReponse, query, args...)

	r.logger.Info(query)

	if err != nil {
		r.logger.Error("Error in processing sql query", errorsV2.Attr(err))
		return nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("error in processing sql query")}
	}

	if len(getErrorWithSpanReponse) > 0 {
		return &getErrorWithSpanReponse[0], nil
	} else {
		return nil, &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("Error/Exception not found")}
	}

}

func (r *ClickHouseReader) GetNextPrevErrorIDs(ctx context.Context, queryParams *model.GetErrorParams) (*model.NextPrevErrorIDs, *model.ApiError) {

	if queryParams.ErrorID == "" {
		r.logger.Error("errorId missing from params")
		return nil, &model.ApiError{Typ: model.ErrorBadData, Err: fmt.Errorf("ErrorID missing from params")}
	}
	var apiErr *model.ApiError
	getNextPrevErrorIDsResponse := model.NextPrevErrorIDs{
		GroupID: queryParams.GroupID,
	}
	getNextPrevErrorIDsResponse.NextErrorID, getNextPrevErrorIDsResponse.NextTimestamp, apiErr = r.getNextErrorID(ctx, queryParams)
	if apiErr != nil {
		r.logger.Error("Unable to get next error ID due to err: ", errorsV2.Attr(apiErr))
		return nil, apiErr

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Verify the errorID exists by querying the errors table directly in ClickHouse (SELECT count() FROM signoz_errors.distributed_signoz_errors WHERE errorID = ...)
  2. Check the organization ID passed in the query matches the one the error was ingested under
  3. If the error is older than your retention window, it was TTL-deleted: re-ingest or accept the 404
  4. Treat this as a non-retryable 404 in the caller: show 'error not found' in the UI instead of retrying

Example fix

// before
err, apiErr := reader.GetError(ctx, params)
if apiErr != nil { return apiErr }

// after - distinguish not-found from exec failure
err, apiErr := reader.GetError(ctx, params)
if apiErr != nil {
  if apiErr.Typ == model.ErrorNotFound {
    return &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("error event expired or unknown: %s", params.ErrorID)}
  }
  return apiErr
}
Defensive patterns

Strategy: validation

Validate before calling

// before calling, confirm the error still exists (cheap count query or cache of recent IDs)
// e.g. guard UI navigation links on IDs fetched in the current session
if params.ErrorID == "" { return nil, errBadParam }

Try / catch

// treat ErrorNotFound as a terminal 404 — do not retry
if apiErr != nil && apiErr.Typ == model.ErrorNotFound {
  http.Error(w, "error event not found (possibly expired)", http.StatusNotFound)
  return
}

Prevention

When it happens

Trigger: Calling the errors API (GET /api/v1/errors/{errorId} or the span-error endpoint) with an ErrorID that was purged by ClickHouse TTL, belongs to another org/tenant, or was typo'd; also when the groupID lookup finds no matching exception record.

Common situations: Old error events expired via TTL by the time the user clicks a link in the UI; wrong org header routing the query to another dataset; stale UI links after retention cleanup; error table migration renamed columns.

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/df98ae5c00074089. Report an issue: GitHub.