Hello, I'm using latest Metabase (0.45.2) with Postgres DB.
Turning on model cache works ok with most models, but it fails with models that contains a JOIN operation.
Model works great before turning model cache on, but once the caching is "completed" it does not longer works with this message:
ERROR: column "#" does not exist Position: 1801
Column name is always the first available column and it changes if I remove it from the model.
- I've tried inverting the JOIN tables and modes with same results.
- As Soon as I change the model it starts working again (until the refresh kicks in) so its definitely related to the cache,
Thanks!
LOG:
etabase | 2023-01-20 16:05:15,192 INFO api.dataset :: Source query for this query is Card 301
metabase | 2023-01-20 16:05:15,245 INFO middleware.fetch-source-query :: Found substitute cached query for card 301 from metabase_cache_d24ac_42.null
metabase | 2023-01-20 16:05:15,417 INFO middleware.fetch-source-query :: Found substitute cached query for card 301 from metabase_cache_d24ac_42.null
metabase | 2023-01-20 16:05:15,528 INFO middleware.fetch-source-query :: Found substitute cached query for card 301 from metabase_cache_d24ac_42.null
metabase | 2023-01-20 16:05:16,212 ERROR middleware.catch-exceptions :: Error processing query: ERROR: column "#" does not exist
metabase | Position: 1801
metabase | {:database_id 42,
metabase | :started_at #t "2023-01-20T16:05:15.204195Z[GMT]",
metabase | :via
metabase | [{:status :failed,
metabase | :class clojure.lang.ExceptionInfo,
metabase | :error "Error executing query: ERROR: column \"#\" does not exist\n Position: 1801",
metabase | :stacktrace
metabase | ["--> driver.sql_jdbc.execute$execute_reducible_query$fn__56063.invoke(execute.clj:501)"
metabase | "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:498)"
metabase | "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)"
metabase | "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:493)"
metabase | "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)"
metabase | "driver.sql_jdbc$fn__88491.invokeStatic(sql_jdbc.clj:58)"
metabase | "driver.sql_jdbc$fn__88491.invoke(sql_jdbc.clj:56)"
metabase | "query_processor.context$executef.invokeStatic(context.clj:59)"
metabase | "query_processor.context$executef.invoke(context.clj:48)"
metabase | "query_processor.context.default$default_runf.invokeStatic(default.clj:67)"
metabase | "query_processor.context.default$default_runf.invoke(default.clj:65)"
metabase | "query_processor.context$runf.invokeStatic(context.clj:45)"
metabase | "query_processor.context$runf.invoke(context.clj:39)"
metabase | "query_processor.reducible$identity_qp.invokeStatic(reducible.clj:12)"
metabase | "query_processor.reducible$identity_qp.invoke(reducible.clj:9)"
metabase | "query_processor.middleware.cache$maybe_return_cached_results$maybe_return_cached_results_STAR___53569.invoke(cache.clj:220)"
metabase | "query_processor.middleware.permissions$check_query_permissions$fn__49259.invoke(permissions.clj:109)"
metabase | "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__52514.invoke(mbql_to_native.clj:23)"
metabase | "query_processor$fn__55045$combined_post_process__55050$combined_post_process_STAR___55051.invoke(query_processor.clj:212)"
metabase | "query_processor$fn__55045$combined_pre_process__55046$combined_pre_process_STAR___55047.invoke(query_processor.clj:209)"
metabase | "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53490$fn__53495.invoke(resolve_database_and_driver.clj:35)"
metabase | "driver$do_with_driver.invokeStatic(driver.clj:76)"
metabase | "driver$do_with_driver.invoke(driver.clj:72)"
metabase | "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53490.invoke(resolve_database_and_driver.clj:34)"
metabase | "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__49525.invoke(fetch_source_query.clj:310)"
metabase | "query_processor.middleware.store$initialize_store$fn__49715$fn__49716.invoke(store.clj:11)"
metabase | "query_processor.store$do_with_store.invokeStatic(store.clj:45)"
metabase | "query_processor.store$do_with_store.invoke(store.clj:39)"
metabase | "query_processor.middleware.store$initialize_store$fn__49715.invoke(store.clj:10)"
metabase | "query_processor.middleware.normalize_query$normalize$fn__53762.invoke(normalize_query.clj:22)"
metabase | "query_processor.middleware.constraints$add_default_userland_constraints$fn__50803.invoke(constraints.clj:53)"
metabase | "query_processor.middleware.process_userland_query$process_userland_query$fn__53701.invoke(process_userland_query.clj:145)"
metabase | "query_processor.middleware.catch_exceptions$catch_exceptions$fn__54073.invoke(catch_exceptions.clj:167)"
metabase | "query_processor.reducible$async_qp$qp_STAR___45514$thunk__45516.invoke(reducible.clj:100)"
metabase | "query_processor.reducible$async_qp$qp_STAR___45514.invoke(reducible.clj:106)"
metabase | "query_processor.reducible$async_qp$qp_STAR___45514.invoke(reducible.clj:91)"
metabase | "query_processor.reducible$sync_qp$qp_STAR___45525.doInvoke(reducible.clj:126)"
metabase | "query_processor$process_userland_query.invokeStatic(query_processor.clj:331)"
metabase | "query_processor$process_userland_query.doInvoke(query_processor.clj:327)"
metabase | "query_processor$fn__55092$process_query_and_save_execution_BANG___55101$fn__55104.invoke(query_processor.clj:342)"
metabase | "query_processor$fn__55092$process_query_and_save_execution_BANG___55101.invoke(query_processor.clj:335)"
metabase | "query_processor$fn__55136$process_query_and_save_with_max_results_constraints_BANG___55145$fn__55148.invoke(query_processor.clj:354)"
metabase | "query_processor$fn__55136$process_query_and_save_with_max_results_constraints_BANG___55145.invoke(query_processor.clj:347)"
metabase | "api.dataset$run_query_async$fn__70498.invoke(dataset.clj:69)"
metabase | "query_processor.streaming$streaming_response_STAR_$fn__40610$fn__40611.invoke(streaming.clj:162)"
metabase | "query_processor.streaming$streaming_response_STAR_$fn__40610.invoke(streaming.clj:161)"
metabase | "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
metabase | "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
metabase | "async.streaming_response$do_f_async$task__20021.invoke(streaming_response.clj:84)"],
metabase | :error_type :invalid-query,
metabase | :ex-data
metabase | {:sql
<QUERY_HERE>
....
etabase | :params nil,
metabase | :type :invalid-query}}],
metabase | :state "42703",
metabase | :error_type :invalid-query,
metabase | :json_query
metabase | {:type "query",
metabase | :database 42,
metabase | :query {:source-table "card__301"},
metabase | :parameters [],
metabase | :middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
metabase | :native
metabase | {:query
<QUERY_HERE>