{"record":{"id":"e855e74d4fef6b9d","repo":"SigNoz/signoz","slug":"errors-codeinternal","errorCode":"errors.CodeInternal","errorMessage":"ErrFailedToGetMeterKeys.Error()","messagePattern":"ErrFailedToGetMeterKeys\\.Error\\(\\)","errorType":"error_code","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/telemetrymetadata/metadata.go","lineNumber":1101,"sourceCode":"\t\trowCount++\n\t\t// reached the limit, we know there are more results\n\t\tif rowCount > limit {\n\t\t\tbreak\n\t\t}\n\n\t\tvar name string\n\t\terr = rows.Scan(&name)\n\t\tif err != nil {\n\t\t\treturn nil, false, errors.Wrap(err, errors.TypeInternal, errors.CodeInternal, ErrFailedToGetMeterKeys.Error())\n\t\t}\n\t\tkeys = append(keys, &telemetrytypes.TelemetryFieldKey{\n\t\t\tName:   name,\n\t\t\tSignal: telemetrytypes.SignalMetrics,\n\t\t})\n\t}\n\n\tif rows.Err() != nil {\n\t\treturn nil, false, errors.Wrap(rows.Err(), errors.TypeInternal, errors.CodeInternal, ErrFailedToGetMeterKeys.Error())\n\t}\n\n\t// hit the limit?\n\tcomplete := rowCount <= limit\n\n\treturn keys, complete, nil\n\n}\n\n// applyBackwardCompatibleKeys adds backward compatible key aliases to the map.\nfunc applyBackwardCompatibleKeys(mapOfKeys map[string][]*telemetrytypes.TelemetryFieldKey) {\n\t// Get backward compatible keys for all signals\n\tbackwardCompatKeysBySignal := map[telemetrytypes.Signal]BackwardCompatibleKeyMap{\n\t\ttelemetrytypes.SignalTraces:  GetBackwardCompatKeysForSignal(telemetrytypes.SignalTraces),\n\t\ttelemetrytypes.SignalLogs:    GetBackwardCompatKeysForSignal(telemetrytypes.SignalLogs),\n\t\ttelemetrytypes.SignalMetrics: GetBackwardCompatKeysForSignal(telemetrytypes.SignalMetrics),\n\t}\n","sourceCodeStart":1083,"sourceCodeEnd":1119,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/telemetrymetadata/metadata.go#L1083-L1119","documentation":"Returned by getMeterSourceMetricKeys when rows.Err() reports a failure after iterating the ClickHouse result set for meter metric keys. This indicates the row iteration itself failed mid-stream (network interruption, result set aborted, decode error) rather than a bad query or bad row. Wrapped as internal with errors.CodeInternal.","triggerScenarios":"Calling GetKeys/GetKeysMulti for metrics where the ClickHouse connection drops or the result stream errors during iteration of meter key rows, e.g. socket timeout, context cancellation, or server-side query kill.","commonSituations":"Large key cardinality causing long streaming reads that exceed idle/socket timeouts, ClickHouse server restarts mid-query, load balancer closing idle connections, or a cancelled request context.","solutions":["Check ClickHouse server logs for the corresponding query failure (timeouts, kills)","Increase ClickHouse read/socket timeouts or reduce the requested limit","Retry the call: transient stream errors often succeed on a second attempt","Verify network stability between the app and ClickHouse"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var keys []*telemetrytypes.TelemetryFieldKey\nerr := retry.Do(func() error {\n\tvar err error\n\tkeys, _, err = store.GetKeys(ctx, q)\n\treturn err\n}, retry.Attempts(3), retry.IsRetryable(isTransientClickHouseErr))","preventionTips":["Set ClickHouse read timeouts above expected result streaming duration","Bound limit parameters to keep result sets small","Monitor ClickHouse connection stability"],"tags":["clickhouse","rows-iteration","streaming","internal"],"backgroundTag":"database-result-stream-interrupted","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}