Hi Team! I have an issue with audit logs (StarRock...
# questions-and-troubleshooting
a
Hi Team! I have an issue with audit logs (StarRocks 3.5.6) We have a 3rd party app that calls StarRocks and for all of those queries I see "IsQuery=false" and numbers like Time, ScanBytes are 0. If I run the same query via DBeaver I see correct values in audit logs. Example of such log:
Copy code
2025-10-03 19:03:24.828Z [query] |Timestamp=1759518204824|Client=<http://xx.xx.xxx.xxx:8552%7CUser=user%7CAuthorizedUser='user'@'%'%7CResourceGroup=%7CCatalog=default_catalog%7CDb=%7CState=NOOP%7CErrorCode=%7CTime=4%7CScanBytes=0%7CScanRows=0%7CReturnRows=0%7CStmtId=36296%7CQueryId=xxx%7CIsQuery=false%7CfeIp=fe%7CStmt=SELECT|xx.xx.xxx.xxx:8552|User=user|AuthorizedUser='user'@'%'|ResourceGroup=|Catalog=default_catalog|Db=|State=NOOP|ErrorCode=|Time=4|ScanBytes=0|ScanRows=0|ReturnRows=0|StmtId=36296|QueryId=xxx|IsQuery=false|feIp=fe|Stmt=SELECT> `ta_1`.`a` AS `ca_1`, IFNULL(sum(CASE WHEN ( LOWER(`ta_1`.`b`) = 'c' AND LOWER(`ta_1`.`d`) = 'e' AND LOWER(`ta_1`.`f`) = 'g' ) THEN `ta_1`.`h` ELSE NULL END), 0) AS `ca_2`, IFNULL(sum(CASE WHEN ( LOWER(`ta_1`.`i`) = 'j' AND LOWER(`ta_1`.`k`) = 'l' AND LOWER(`ta_1`.`m`) = 'n' ) THEN `ta_1`.`q` ELSE NULL END), 0) AS `ca_3` FROM `db`.`table` AS `ta_1` WHERE ( ( LOWER(`ta_1`.`a`) <> 'abc' OR `ta_1`.`a` IS NULL ) AND `ta_1`.`o` AND `ta_1`.`date` >= '2025-09-03' AND `ta_1`.`date` < '2025-10-03' AND (LOWER(`ta_1`.`q`) IN ( 'all' )) ) GROUP BY `ca_1` LIMIT 5000 /* type: TYPE,
 storable: {"id":"xxx","name":"SomeName","owner":"xxx","type":"xxx"},
 vizId: xxx,
 userId: xxx,
 requestId: xxx,
 queryId: xxx,
 clusterId: xxx,
 task: TASK,
 isApplied: true*/|Digest=|Warehouse=default_warehouse|IsForwardToLeader=false|QueryFEAllocatedMemory=0|TransmittedBytes=0
What can be the issue here?
I've figured out that problem is with prepared statements. Looks like the log above is to prepare statement query. it would explain why query time always few millis and state NOOP. However, I see metrics like return rows, scanrows in totally different queries like
SET net_write_timeout=600
which probably is for prepared statement execute, but there is no way to connect the dots. Another problem is that metrics don't work correctly for prepared statements. For example, if prepared statement query times out on planning step then
starrocks_fe_query_analysis_err
(or similar error metrics) will not change. I see the same problem in 4.0.0 as well.