I already truncated query
and query_*
table.
Then I got this error
2024-11-11 09:22:38,509 ERROR middleware.log :: GET /api/dashboard/22/query_metadata 500 252.2 ms (14 DB calls) {:metabase-user-id 32}
0|metabase | {:via
0|metabase | [{:type clojure.lang.ExceptionInfo,
0|metabase | :message "ERROR: syntax error at or near \",\"\n Position: 47",
0|metabase | :data
0|metabase | {:toucan2/context-trace
0|metabase | [["execute SQL with class com.mchange.v2.c3p0.impl.NewProxyConnection"
0|metabase | {:toucan2.jdbc.query/sql-args
0|metabase | ["SELECT * FROM \"query\" WHERE \"query_hash\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
0|metabase | #object["[B" 0x30ffa758 "[B@30ffa758"]
...
:cause "ERROR: syntax error at or near \",\"\n Position: 47",
0|metabase | :message "ERROR: syntax error at or near \",\"\n Position: 47"}
When trying to render/view a dashboard ID
2024-11-11 09:22:44,930 ERROR middleware.process-userland-query :: Error saving query execution info
0|metabase | clojure.lang.ExceptionInfo: ERROR: syntax error at or near ")"
0|metabase | Position: 1688 {:toucan2/context-trace [["execute SQL with class com.mchange.v2.c3p0.impl.NewProxyConnection" {:toucan2.jdbc.query/sql-args ["UPDATE \"query\" SET \"query\" = ?, \"average_execution_time\" = CAST(ROUND((0.9 * \"average_execution_time\") + 29.0, 0) AS integer) WHERE (\"query_hash\" = ?) AND (\"query\" IS NULL)" "{\"constraints\":{\"max-results\":10000,\"max-results-bare-rows\":2000},\"type\":\"query\",\"middleware\":{\"js-int-to-string?\":true,\"ignore-cached-results?\":false,\"process-viz-settings?\":false,\"userland-query?\":true},\"cache-strategy\":null,\"viz-settings\":{\"graph.show_goal\":false,\"graph.show_values\":true,\"graph.x_axis.labels_enabled\":true,\"table.cell_column\":\"metadata → payment_in_response → statusCode\",\"graph.series_order_dimension\":null,\"graph.y_axis.labels_enabled\":false,\"graph.label_value_frequency\":\"all\",\"graph.metrics\":[\"sum\"],\"graph.y_axis.axis_enabled\":false,\"graph.show_stack_values\":\"all\",\"graph.label_value_formatting\":\"compact\",\"graph.series_order\":null,\"table.pivot_column\":\"metadata → payment_in_response → messages\",\"series_settings\":{\"sum\":{\"color\":\"#87BCEC\"},\"sum_2\":{\"color\":\"#F2A86F\"}},\"graph.dimensions\":[\"paid_at\",\"business_name\"],\"stackable.stack_type\":\"stacked\"},\"database\":2,\"query\":{\"aggregation\":[[\"sum\",[\"field\",\"requested_amount\",{\"base-type\":\"type/Decimal\"}]],[\"count\"]],\"breakout\":[[\"field\",\"paid_at\",{\"base-type\":\"type/DateTimeWithLocalTZ\",\"temporal-unit\":\"month\"}],[\"field\",\"business_name\",{\"base-type\":\"type/Text\"}],[\"field\",\"provider\",{\"base-type\":\"type/Text\"}]],\"order-by\":[[\"desc\",[\"aggregation\",0]]],\"source-table\":\"card__493\",\"filter\":[\"and\",[\"or\",[\"=\",[\"field\",\"status\",{\"base-type\":\"type/Text\"}],\"completed\"],[\"=\",[\"field\",\"status\",{\"base-type\":\"type/Text\"}],\"waiting_for_proceed\"]],[\"time-interval\",[\"field\",\"created_at\",{\"base-type\":\"type/DateTimeWithLocalTZ\"}],-3,\"month\",{\"include-current\":true}]]}}" #object["[B" 0x56c257ae "[B@56c257ae"]]}] ["resolve connection" {:toucan2.connection/connectable metabase.db.connection.ApplicationDB}] ["resolve connection" {:toucan2.connection/connectable :default}] ["resolve connection" {:toucan2.connection/connectable nil}] {:toucan2.pipeline/rf #object[clojure.core$completing$fn__8558 0x10c10127 "clojure.core$completing$fn__8558@10c10127"]}
...
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
0|metabase | Position: 1688
When trying to view questions (it works show a graph at FE, but failed to store some info on BE)
I thought it was my bad truncated query_*
table also, it should be just query
table? When I read those logs yesterday