Issues

Select view

Select search mode

 
28 of 28

GetReport and GetFilteredMetricsName fail if Plan summary filter's value with brackets is selected

Description

  1. Add MongoDB replica to PMM

  2. Open QAN and select EXPRESS_IXSCAN { id: 1 } or EXPRESS_IXSCAN { id: 1 }.EXPRESS_DELETE filter

 

Actual result: Internal server error is returned

 

In qan-api2.log:

time="2025-03-26T10:02:36.044+00:00" level=error msg="RPC /qan.v1.QANService/GetReport done in 385.285µs with unexpected error: expected string value in NamedValue for query parameter\ngithub.com/ClickHouse/clickhouse-go/v2.init\n\t<autogenerated>:1\nruntime.doInit1\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:7290\nruntime.doInit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:7257\nruntime.main\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:254\nruntime.goexit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700\nQueryxContext error\ngithub.com/percona/pmm/qan-api2/models.(*Reporter).Select\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/models/reporter.go:206\ngithub.com/percona/pmm/qan-api2/services/analytics.(*Service).GetReport\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/services/analytics/profile.go:117\ngithub.com/percona/pmm/api/qan/v1._QANService_GetReport_Handler.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:299\nmain.runGRPCServer.UnaryServerInterceptor.func4\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/validator/validator.go:47\nmain.runGRPCServer.ChainUnaryServer.func6.1\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:48\ngithub.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3\n\t/home/builder/go/pkg/mod/github.com/!percona-!lab/go-grpc-prometheus@v0.0.0-20230116133345-3487748d4592/server_metrics.go:114\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:99\ngithub.com/percona/pmm/qan-api2/utils/interceptors.logRequest\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:78\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:97\nmain.runGRPCServer.ChainUnaryServer.func6\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:53\ngithub.com/percona/pmm/api/qan/v1._QANService_GetReport_Handler\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:301\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1405\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1815\ngoogle.golang.org/grpc.(*Server).serveStreams.func2.1\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1035\nruntime.goexit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700" request=715e7e1d-0a29-11f0-8df7-5e24a9eee4b7

time="2025-03-26T10:02:36.045+00:00" level=info msg="Starting RPC /qan.v1.QANService/GetFilteredMetricsNames ..." request=715ec131-0a29-11f0-8df7-5e24a9eee4b7

time="2025-03-26T10:02:36.055+00:00" level=error msg="RPC /qan.v1.QANService/GetFilteredMetricsNames done in 9.863859ms with unexpected error: expected string value in NamedValue for query parameter\ngithub.com/ClickHouse/clickhouse-go/v2.init\n\t<autogenerated>:1\nruntime.doInit1\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:7290\nruntime.doInit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:7257\nruntime.main\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:254\nruntime.goexit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700\nfailed to select for QueryFilter \nSELECT\n    key,\n    value,\n    sum(main_metric_sum) AS main_metric_sum\nFROM\n(\n    SELECT\n        'node_type' AS key,\n        node_type AS value,\n        SUM(m_query_time_sum) AS main_metric_sum\n    FROM metrics\n    WHERE (period_start >= ?) AND (period_start <= ?)\n     AND (environment IN ('mongodb_rs_node')) AND (plan_summary IN ('EXPRESS_IXSCAN { _id: 1 }'))\n    GROUP BY node_type\n    UNION ALL\n    SELECT\n        'node_type' AS key,\n        node_type AS value,\n        0 AS main_metric_sum\n    FROM metrics\n    WHERE (period_start >= ?) AND (period_start <= ?)\n    GROUP BY node_type\n)\nGROUP BY\n    key,\n    value\n    WITH TOTALS\nORDER BY\n    main_metric_sum DESC,\n    value ASC\n\ngithub.com/percona/pmm/qan-api2/models.(*Reporter).queryFilters\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/models/reporter.go:551\ngithub.com/percona/pmm/qan-api2/models.(*Reporter).SelectFilters\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/models/reporter.go:491\ngithub.com/percona/pmm/qan-api2/services/analytics.(*Service).GetFilteredMetricsNames\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/services/analytics/filters.go:70\ngithub.com/percona/pmm/api/qan/v1._QANService_GetFilteredMetricsNames_Handler.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:317\nmain.runGRPCServer.UnaryServerInterceptor.func4\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/validator/validator.go:47\nmain.runGRPCServer.ChainUnaryServer.func6.1\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:48\ngithub.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3\n\t/home/builder/go/pkg/mod/github.com/!percona-!lab/go-grpc-prometheus@v0.0.0-20230116133345-3487748d4592/server_metrics.go:114\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:99\ngithub.com/percona/pmm/qan-api2/utils/interceptors.logRequest\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:78\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:97\nmain.runGRPCServer.ChainUnaryServer.func6\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:53\ngithub.com/percona/pmm/api/qan/v1._QANService_GetFilteredMetricsNames_Handler\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:319\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1405\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1815\ngoogle.golang.org/grpc.(*Server).serveStreams.func2.1\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1035\nruntime.goexit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700\ncannot select node_type dimension\ngithub.com/percona/pmm/qan-api2/models.(*Reporter).SelectFilters\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/models/reporter.go:493\ngithub.com/percona/pmm/qan-api2/services/analytics.(*Service).GetFilteredMetricsNames\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/services/analytics/filters.go:70\ngithub.com/percona/pmm/api/qan/v1._QANService_GetFilteredMetricsNames_Handler.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:317\nmain.runGRPCServer.UnaryServerInterceptor.func4\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/validator/validator.go:47\nmain.runGRPCServer.ChainUnaryServer.func6.1\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:48\ngithub.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3\n\t/home/builder/go/pkg/mod/github.com/!percona-!lab/go-grpc-prometheus@v0.0.0-20230116133345-3487748d4592/server_metrics.go:114\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary.func1\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:99\ngithub.com/percona/pmm/qan-api2/utils/interceptors.logRequest\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:78\ngithub.com/percona/pmm/qan-api2/utils/interceptors.Unary\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/qan-api2/utils/interceptors/interceptors.go:97\nmain.runGRPCServer.ChainUnaryServer.func6\n\t/home/builder/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/chain.go:53\ngithub.com/percona/pmm/api/qan/v1._QANService_GetFilteredMetricsNames_Handler\n\t/home/builder/rpm/BUILD/pmm-3.1.0/src/github.com/percona/pmm/api/qan/v1/service_grpc.pb.go:319\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1405\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1815\ngoogle.golang.org/grpc.(*Server).serveStreams.func2.1\n\t/home/builder/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1035\nruntime.goexit\n\t/home/builder/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700" request=715ec131-0a29-11f0-8df7-5e24a9eee4b7

How to test

None

How to document

None

Attachments

1

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

No

Planned Version/s

Fix versions

Story Points

Affects versions

Smart Checklist

Created March 26, 2025 at 10:09 AM
Updated last week

Activity