{"record":{"id":"df7dc472315ffdc5","repo":"SigNoz/signoz","slug":"error-while-executing-meter-name-query-s","errorCode":null,"errorMessage":"error while executing meter name query: %s","messagePattern":"error while executing meter name query: (.+?)","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/query-service/app/clickhouseReader/reader.go","lineNumber":3065,"sourceCode":"\t\tinstrumentationtypes.CodeFunctionName: \"GetMeterAggregateAttributes\",\n\t})\n\tvar response v3.AggregateAttributeResponse\n\t// Query all relevant metric names from time_series_v4, but leave metadata retrieval to cache/db\n\tquery := fmt.Sprintf(\n\t\t`SELECT metric_name,type,temporality,is_monotonic\n\t\t FROM %s.%s\n\t\t WHERE metric_name ILIKE $1\n\t\t GROUP BY metric_name,type,temporality,is_monotonic`,\n\t\tsignozMeterDBName, signozMeterSamplesName)\n\n\tif req.Limit != 0 {\n\t\tquery = query + fmt.Sprintf(\" LIMIT %d;\", req.Limit)\n\t}\n\n\trows, err := r.db.Query(ctx, query, fmt.Sprintf(\"%%%s%%\", req.SearchText))\n\tif err != nil {\n\t\tr.logger.Error(\"Error while querying meter names\", errorsV2.Attr(err))\n\t\treturn nil, fmt.Errorf(\"error while executing meter name query: %s\", err.Error())\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar name string\n\t\tvar typ string\n\t\tvar temporality string\n\t\tvar isMonotonic bool\n\t\tif err := rows.Scan(&name, &typ, &temporality, &isMonotonic); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error while scanning meter name: %s\", err.Error())\n\t\t}\n\n\t\t// Non-monotonic cumulative sums are treated as gauges\n\t\tif typ == \"Sum\" && !isMonotonic && temporality == string(v3.Cumulative) {\n\t\t\ttyp = \"Gauge\"\n\t\t}\n\n\t\t// unlike traces/logs `tag`/`resource` type, the `Type` will be metric type","sourceCodeStart":3047,"sourceCodeEnd":3083,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/clickhouseReader/reader.go#L3047-L3083","documentation":"GetMeterName query failure: the SELECT listing metric meters (name, type, temporality, isMonotonic) filtered by search text failed to execute against ClickHouse. The %s carries the driver-level error for diagnosis. Analogous to error 349 but for the meters listing API.","triggerScenarios":"Calling the meters listing endpoint when the metrics tables are absent, ClickHouse is unreachable, or a version skew makes the four-column meter query invalid against the deployed schema.","commonSituations":"Fresh install with no metrics; missing migrations after upgrade; datasource misconfig; ClickHouse restart mid-request.","solutions":["Read the appended %s error text for the root cause","Create/verify the metrics tables via SigNoz migrations and confirm data exists","Verify ClickHouse connectivity and retry once healthy","Check for schema drift if the meter query references columns added in a newer version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm meters data exists: SELECT count() FROM signoz_metrics.time_series","typeGuard":null,"tryCatchPattern":"if err != nil {\n  if isTransientClickhouseErr(err) { return nil, retry(ctx) }\n  if strings.Contains(err.Error(), \"UNKNOWN_TABLE\") { return []model.MeterInfo{}, nil }\n  return nil, err\n}","preventionTips":["Migrations before first meters listing; sanitize SearchText; monitor ClickHouse health"],"tags":["clickhouse","metrics","meters","query-execution"],"backgroundTag":"database-query-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}