SigNoz/signoz · error · errors.Error

CodeNotFound

CodeNotFound

Error message

oidc: no id_token in token response

What it means

Default branch in reduceQuery (SigNoz metrics v3 query_builder.go). After building the inner series query it applies the requested ReduceToOperator (last, avg, max, min, sum, etc.); if the operator is not one of the recognized ReduceTo values it cannot wrap the inner query and returns this error.

Source

Thrown at ee/authn/callbackauthn/oidccallbackauthn/authn.go:218

	}

	return oidcProvider, &oauth2.Config{
		ClientID:     oidcConfig.ClientID,
		ClientSecret: oidcConfig.ClientSecret,
		Endpoint:     oidcProvider.Endpoint(),
		Scopes:       scopes,
		RedirectURL: (&url.URL{
			Scheme: siteURL.Scheme,
			Host:   siteURL.Host,
			Path:   path.Join(a.globalConfig.ExternalPath(), redirectPath),
		}).String(),
	}, nil
}

func (a *AuthN) claimsFromIDToken(ctx context.Context, authDomain *authtypes.AuthDomain, provider *oidc.Provider, token *oauth2.Token) (map[string]any, error) {
	rawIDToken, ok := token.Extra("id_token").(string)
	if !ok {
		return nil, errors.New(errors.TypeNotFound, errors.CodeNotFound, "oidc: no id_token in token response")
	}

	oidcConfig, err := authDomain.Config().OIDCConfig()
	if err != nil {
		return nil, err
	}

	verifier := provider.Verifier(&oidc.Config{ClientID: oidcConfig.ClientID})
	idToken, err := verifier.Verify(ctx, rawIDToken)
	if err != nil {
		return nil, errors.Newf(errors.TypeForbidden, errors.CodeForbidden, "oidc: failed to verify token").WithAdditional(err.Error())
	}

	var claims map[string]any
	if err := idToken.Claims(&claims); err != nil {
		return nil, errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, "oidc: failed to decode claims").WithAdditional(err.Error())
	}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Set reduceTo to a supported value: last, avg, max, min, sum, count, sum_rate, avg_rate, max_rate, min_rate, or no-op where allowed
  2. Validate/normalize the reduce field in your API layer before calling PrepareMetricQuery
  3. Upgrade frontend and query-service together so both support the same ReduceTo set

Example fix

// before
qp.ReduceTo = "latest" // unsupported value

// after
qp.ReduceTo = v3.ReduceToOperatorLast // maps to the lastIf(...) branch
Defensive patterns

Strategy: validation

Validate before calling

var validReduce = map[v3.ReduceToOperator]bool{v3.ReduceToOperatorLast: true, v3.ReduceToOperatorAvg: true, v3.ReduceToOperatorMax: true, v3.ReduceToOperatorMin: true, v3.ReduceToOperatorSum: true /* ... */}
if !validReduce[qp.ReduceTo] {
	qp.ReduceTo = v3.ReduceToOperatorLast
}

Type guard

null

Try / catch

if _, err := v3.PrepareMetricQuery(...); err != nil && strings.Contains(err.Error(), "unsupported reduce operator") {
	qp.ReduceTo = v3.ReduceToOperatorLast
	return v3.PrepareMetricQuery(...)
}

Prevention

When it happens

Trigger: PrepareMetricQuery with a qp having a ReduceTo value outside the handled set — empty string, a misspelled operator like 'latest', or a reduce operator introduced in a different SigNoz version — on a query that requires a reduce stage.

Common situations: Building 'current value' / single-datum widgets with an unset or invalid reduce field; version skew between UI and query-service; hand-writing dashboard JSON with a bad reduce value.

Related errors


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