Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure AST and paser errors are recorded within Status objects for mo…
…re detailed error output (#1696) Summary: Ensure AST and parser errors are recorded within Status objects for more detailed error output When working with the standalone PEM, there are often pxl constructs that aren't supported. Running a script that contains these elements results in compilation failures that contain empty Status messages (as seen below). The lack of compilation error details makes debugging very difficult. ``` # Run the standalone PEM followed by the client from src/api/go/pxapi/examples/standalone_pem_example/BUILD.bazel in pixie#1444 $ PX_HOST_ID=testing bazel run -c dbg src/api/go/pxapi/examples/standalone_pem_example:standalone_pem_example Got error : rpc error: code = InvalidArgument desc = Failed to compile script, while streaming Execution Time: 0s Bytes received: 0 # See that the standalone PEM logs don't contain any errors. Even if the error was logged the msg is often blank. I20230906 15:28:52.238765 4180046 vizier_server.h:63] Executing Script I20230906 15:28:52.239073 4180046 vizier_server.h:124] Compiling and running query I20230906 15:29:00.377365 4180047 perf_profile_connector.cc:427] PerfProfileConnector statistics: kBPFMapSwitchoverEvent=1 kCumulativeSumOfAllStackTraces=48935 kLossHistoEvent=0 ``` Relevant Issues: N/A Type of change: /kind bug Test Plan: Verified with additional unit tests and with a variety of complex pxl scripts - [x] New tests pass - [x] Verified that the standalone pem surfaces the lack of plugin support when running the http metrics Otel script ``` I20230906 15:23:52.953277 4174704 vizier_server.h:63] Executing Script I20230906 15:23:52.953543 4174704 vizier_server.h:124] Compiling and running query W20230906 15:23:53.004771 4174704 vizier_server.h:131] Failed to compile script with error='No plugin config found. Make sure the script is run in a plugin context.' ``` - [x] Verified that the standalone pem surfaces the missing tables (bpftrace and tcp_stats_table) ``` # Standalone PEM logs W20230906 15:21:51.754878 4173793 vizier_server.h:131] Failed to compile script with error='Table 'tcp_stats_events' not found.' I20230906 15:21:51.704820 4173793 vizier_server.h:63] Executing Script I20230906 15:21:51.705090 4173793 vizier_server.h:124] Compiling and running query [ .. ] I20230906 15:22:17.746985 4174704 vizier_server.h:63] Executing Script I20230906 15:22:17.747223 4174704 vizier_server.h:124] Compiling and running query W20230906 15:22:17.797647 4174704 vizier_server.h:131] Failed to compile script with error='Table 'exec_table' not found.' # standalone PEM client logs Got error : rpc error: code = InvalidArgument desc = Failed to compile script with error='Table 'exec_table' not found.', while streaming Execution Time: 0s Bytes received: 0 ``` --------- Signed-off-by: Dom Del Nano <[email protected]>
- Loading branch information