Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Expected native source query to be a string, got: clojure.lang.PersistentArrayMap" on nested queries #32121

Closed
paoliniluis opened this issue Jul 4, 2023 · 6 comments · Fixed by #32189
Assignees
Labels
.Backend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Processor .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

@paoliniluis
Copy link
Contributor

Describe the bug

When using "explore results", there's something we're sending wrong to the backend which causes the exception

To Reproduce

  1. new GUI query -> invoices -> count by account plan and source. See the SQL and convert it so SQL. Save it
  2. the click explore results, see the BE exception

Expected behavior

It should work

Logs

2023-07-04 15:10:34,726 ERROR middleware.catch-exceptions :: Error processing query: Expected native source query to be a string, got: clojure.lang.PersistentArrayMap
{:database_id 2,
 :started_at #t "2023-07-04T15:10:34.406006Z[GMT]",
 :error_type :invalid-query,
 :json_query
 {:database 2,
  :query {:source-table "card__9"},
  :type "query",
  :parameters [],
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
 :native nil,
 :status :failed,
 :class clojure.lang.ExceptionInfo,
 :stacktrace
 ["--> driver.sql.query_processor$sql_source_query.invokeStatic(query_processor.clj:60)"
  "driver.sql.query_processor$sql_source_query.invoke(query_processor.clj:56)"
  "driver.sql.query_processor$apply_source_query.invokeStatic(query_processor.clj:1403)"
  "driver.sql.query_processor$apply_source_query.invoke(query_processor.clj:1391)"
  "driver.sql.query_processor$apply_clauses.invokeStatic(query_processor.clj:1420)"
  "driver.sql.query_processor$apply_clauses.invoke(query_processor.clj:1412)"
  "driver.sql.query_processor$mbql__GT_honeysql.invokeStatic(query_processor.clj:1447)"
  "driver.sql.query_processor$mbql__GT_honeysql.invoke(query_processor.clj:1438)"
  "driver.sql.query_processor$mbql__GT_native.invokeStatic(query_processor.clj:1456)"
  "driver.sql.query_processor$mbql__GT_native.invoke(query_processor.clj:1452)"
  "driver.sql$fn__86643.invokeStatic(sql.clj:42)"
  "driver.sql$fn__86643.invoke(sql.clj:40)"
  "query_processor.middleware.mbql_to_native$query__GT_native_form.invokeStatic(mbql_to_native.clj:14)"
  "query_processor.middleware.mbql_to_native$query__GT_native_form.invoke(mbql_to_native.clj:9)"
  "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__75446.invoke(mbql_to_native.clj:21)"
  "query_processor$fn__77554$combined_post_process__77559$combined_post_process_STAR___77560.invoke(query_processor.clj:260)"
  "query_processor$fn__77554$combined_pre_process__77555$combined_pre_process_STAR___77556.invoke(query_processor.clj:257)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__76232$fn__76237.invoke(resolve_database_and_driver.clj:36)"
  "driver$do_with_driver.invokeStatic(driver.clj:91)"
  "driver$do_with_driver.invoke(driver.clj:86)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__76232.invoke(resolve_database_and_driver.clj:35)"
  "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__72216.invoke(fetch_source_query.clj:312)"
  "query_processor.middleware.store$initialize_store$fn__72397$fn__72398.invoke(store.clj:12)"
  "query_processor.store$do_with_store.invokeStatic(store.clj:56)"
  "query_processor.store$do_with_store.invoke(store.clj:50)"
  "query_processor.middleware.store$initialize_store$fn__72397.invoke(store.clj:11)"
  "query_processor.middleware.normalize_query$normalize$fn__76528.invoke(normalize_query.clj:36)"
  "metabase_enterprise.audit_app.query_processor.middleware.handle_audit_queries$handle_internal_queries$fn__82999.invoke(handle_audit_queries.clj:131)"
  "query_processor.middleware.constraints$add_default_userland_constraints$fn__73922.invoke(constraints.clj:54)"
  "query_processor.middleware.process_userland_query$process_userland_query$fn__76457.invoke(process_userland_query.clj:151)"
  "query_processor.middleware.catch_exceptions$catch_exceptions$fn__76854.invoke(catch_exceptions.clj:171)"
  "query_processor.reducible$async_qp$qp_STAR___66414$thunk__66416.invoke(reducible.clj:103)"
  "query_processor.reducible$async_qp$qp_STAR___66414.invoke(reducible.clj:109)"
  "query_processor.reducible$async_qp$qp_STAR___66414.invoke(reducible.clj:94)"
  "query_processor.reducible$sync_qp$qp_STAR___66426.doInvoke(reducible.clj:129)"
  "query_processor$process_userland_query.invokeStatic(query_processor.clj:383)"
  "query_processor$process_userland_query.doInvoke(query_processor.clj:379)"
  "query_processor$fn__77603$process_query_and_save_execution_BANG___77612$fn__77615.invoke(query_processor.clj:394)"
  "query_processor$fn__77603$process_query_and_save_execution_BANG___77612.invoke(query_processor.clj:387)"
  "query_processor$fn__77648$process_query_and_save_with_max_results_constraints_BANG___77657$fn__77660.invoke(query_processor.clj:406)"
  "query_processor$fn__77648$process_query_and_save_with_max_results_constraints_BANG___77657.invoke(query_processor.clj:399)"
  "api.dataset$run_query_async$fn__98388.invoke(dataset.clj:74)"
  "query_processor.streaming$streaming_response_STAR_$fn__60960$fn__60961.invoke(streaming.clj:166)"
  "query_processor.streaming$streaming_response_STAR_$fn__60960.invoke(streaming.clj:165)"
  "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:69)"
  "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:67)"
  "async.streaming_response$do_f_async$task__39730.invoke(streaming_response.clj:88)"],
 :card_id 9,
 :context :ad-hoc,
 :error "Expected native source query to be a string, got: clojure.lang.PersistentArrayMap",
 :row_count 0,
 :running_time 0,
 :preprocessed
 {:database 2,
  :query
  {:source-card-id 9,
   :source-metadata
   [{:display_name "accounts__via__account_id__plan",
     :field_ref [:field "accounts__via__account_id__plan" {:base-type :type/Text}],
     :name "accounts__via__account_id__plan",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 1, :nil% 0.0},
      :type
      {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :percent-state 0.0, :average-length 5.0}}}}
    {:display_name "accounts__via__account_id__source",
     :field_ref [:field "accounts__via__account_id__source" {:base-type :type/Text}],
     :name "accounts__via__account_id__source",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type :type/Source,
     :fingerprint
     {:global {:distinct-count 1, :nil% 0.0},
      :type
      {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :percent-state 0.0, :average-length 8.0}}}}
    {:display_name "count",
     :field_ref [:field "count" {:base-type :type/BigInteger}],
     :name "count",
     :base_type :type/BigInteger,
     :effective_type :type/BigInteger,
     :semantic_type :type/Quantity,
     :fingerprint
     {:global {:distinct-count 1, :nil% 0.0},
      :type {:type/Number {:min 1962.0, :q1 1962.0, :q3 1962.0, :max 1962.0, :sd nil, :avg 1962.0}}}}],
   :fields
   [[:field "accounts__via__account_id__plan" {:base-type :type/Text}]
    [:field "accounts__via__account_id__source" {:base-type :type/Text}]
    [:field "count" {:base-type :type/BigInteger}]],
   :source-query
   {:collection "invoices",
    :native
    {:collection "invoices",
     :query
     "SELECT\n  \"accounts__via__account_id\".\"plan\" AS \"accounts__via__account_id__plan\",\n  \"accounts__via__account_id\".\"source\" AS \"accounts__via__account_id__source\",\n  COUNT(*) AS \"count\"\nFROM\n  \"public\".\"invoices\"\n \nLEFT JOIN \"public\".\"accounts\" AS \"accounts__via__account_id\" ON \"public\".\"invoices\".\"account_id\" = \"accounts__via__account_id\".\"id\"\nGROUP BY\n  \"accounts__via__account_id\".\"plan\",\n  \"accounts__via__account_id\".\"source\"\nORDER BY\n  \"accounts__via__account_id\".\"plan\" ASC,\n  \"accounts__via__account_id\".\"source\" ASC"}},
   :limit 1048575,
   :metabase.query-processor.middleware.limit/original-limit nil},
  :type :query,
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true},
  :info {:executed-by 1, :context :ad-hoc, :card-id 9}},
 :ex-data
 {:type :invalid-query,
  :query
  {:collection "invoices",
   :query
   "SELECT\n  \"accounts__via__account_id\".\"plan\" AS \"accounts__via__account_id__plan\",\n  \"accounts__via__account_id\".\"source\" AS \"accounts__via__account_id__source\",\n  COUNT(*) AS \"count\"\nFROM\n  \"public\".\"invoices\"\n \nLEFT JOIN \"public\".\"accounts\" AS \"accounts__via__account_id\" ON \"public\".\"invoices\".\"account_id\" = \"accounts__via__account_id\".\"id\"\nGROUP BY\n  \"accounts__via__account_id\".\"plan\",\n  \"accounts__via__account_id\".\"source\"\nORDER BY\n  \"accounts__via__account_id\".\"plan\" ASC,\n  \"accounts__via__account_id\".\"source\" ASC"}},
 :data {:rows [], :cols []}}

Information about your Metabase installation

v47.0-RC2

Severity

P1

Additional context

No response

@paoliniluis paoliniluis added Type:Bug Product defects Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Processor .Backend .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Blocker labels Jul 4, 2023
@kulyk kulyk self-assigned this Jul 5, 2023
@lbrdnk
Copy link
Contributor

lbrdnk commented Jul 5, 2023

Underlying problem is, that after #31111 POST request to /api/dataset contains native.collection key. If query of this shape is saved and later fetched, metabase.query-processor.middleware.fetch-source-query/source-query is used to transform fetched query for later use. This transformation checks :collection key of native query to decide whether it is mongo query. This approach worked before #31111.

Possible solution could be either 1. using collection key only with mongo queries on the frontend, or 2. modify fetch-source-query/source-query to check if query is mongo in a more robust way, eg. using metabase.driver.util/database->driver with :database_id, or 3. explore the possibility of changing around middleware's order, so metabase.driver/*driver* is accessible in fetch-source-query/source-query. It looks like that could also work on the first glance.

I wanted to write that I'd like to try to implement the fix, but in a meantime @kulyk got assigned the issue :)

@darksciencebase
Copy link
Contributor

Hey there @lbrdnk. Thank you for sharing your spot-on analysis of the problem :) As the bug is a high-priority blocker for the next release, we'll take care of this one in-house.

@bshepherdson bshepherdson self-assigned this Jul 5, 2023
@bshepherdson
Copy link
Contributor

Status: I have a fix for this that seems to work without breaking anything else.

I'm having trouble getting the yarn test-cypress-open-qa working so I can add two e2e tests: one for this issue itself, and also that the fix doesn't break actual Mongo questions.

bshepherdson added a commit that referenced this issue Jul 6, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.
bshepherdson added a commit that referenced this issue Jul 14, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.
@bshepherdson bshepherdson added backport Automatically create PR on current release branch on merge and removed backport Automatically create PR on current release branch on merge labels Jul 14, 2023
github-actions bot pushed a commit that referenced this issue Jul 14, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.
@bshepherdson bshepherdson added this to the 0.46.7 milestone Jul 14, 2023
metabase-bot bot added a commit that referenced this issue Jul 14, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
bshepherdson added a commit that referenced this issue Jul 14, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.
bshepherdson added a commit that referenced this issue Jul 17, 2023
Previously this was done by checking if the FE had included
`:collection "some_table"` on the native query, but that's been
included for SQL queries lately, and broke "Explore Results".

Includes new e2e tests: one for this issue itself, and another
that the fix doesn't break real Mongo native queries.

Fixes #32121.
@beshoyabdelmalak
Copy link

I still get this error whenever I press the Explore result button on an SQL question. I thought that should have been resolved once the fix was released in v46.6.1, but apparently the problem is still there.

Metabase installation: v0.46.6.1

Logs:

2023-07-24 09:24:24,321 ERROR middleware.catch-exceptions :: Error processing query: Expected native source query to be a string, got: clojure.lang.PersistentArrayMap
{:database_id 2,
 :started_at #t "2023-07-24T09:24:23.758709Z[GMT]",
 :error_type :invalid-query,
 :json_query
 {:database 2,
  :query {:source-table "card__2"},
  :type "query",
  :parameters [],
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
 :native nil,
 :status :failed,
 :class clojure.lang.ExceptionInfo,
 :stacktrace
 ["--> driver.sql.query_processor$sql_source_query.invokeStatic(query_processor.clj:60)"
  "driver.sql.query_processor$sql_source_query.invoke(query_processor.clj:56)"
  "driver.sql.query_processor$apply_source_query.invokeStatic(query_processor.clj:1391)"
  "driver.sql.query_processor$apply_source_query.invoke(query_processor.clj:1379)"
  "driver.sql.query_processor$apply_clauses.invokeStatic(query_processor.clj:1408)"
  "driver.sql.query_processor$apply_clauses.invoke(query_processor.clj:1400)"
  "driver.sql.query_processor$mbql__GT_honeysql.invokeStatic(query_processor.clj:1433)"
  "driver.sql.query_processor$mbql__GT_honeysql.invoke(query_processor.clj:1424)"
  "driver.sql.query_processor$mbql__GT_native.invokeStatic(query_processor.clj:1442)"
  "driver.sql.query_processor$mbql__GT_native.invoke(query_processor.clj:1438)"
  "driver.sql$fn__101616.invokeStatic(sql.clj:42)"
  "driver.sql$fn__101616.invoke(sql.clj:40)"
  "query_processor.middleware.mbql_to_native$query__GT_native_form.invokeStatic(mbql_to_native.clj:14)"
  "query_processor.middleware.mbql_to_native$query__GT_native_form.invoke(mbql_to_native.clj:9)"
  "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__68127.invoke(mbql_to_native.clj:21)"
  "query_processor$fn__70755$combined_post_process__70760$combined_post_process_STAR___70761.invoke(query_processor.clj:243)"
  "query_processor$fn__70755$combined_pre_process__70756$combined_pre_process_STAR___70757.invoke(query_processor.clj:240)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__69147$fn__69152.invoke(resolve_database_and_driver.clj:36)"
  "driver$do_with_driver.invokeStatic(driver.clj:90)"
  "driver$do_with_driver.invoke(driver.clj:86)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__69147.invoke(resolve_database_and_driver.clj:35)"
  "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__65018.invoke(fetch_source_query.clj:312)"
  "query_processor.middleware.store$initialize_store$fn__65196$fn__65197.invoke(store.clj:12)"
  "query_processor.store$do_with_store.invokeStatic(store.clj:47)"
  "query_processor.store$do_with_store.invoke(store.clj:41)"
  "query_processor.middleware.store$initialize_store$fn__65196.invoke(store.clj:11)"
  "query_processor.middleware.normalize_query$normalize$fn__69436.invoke(normalize_query.clj:25)"
  "query_processor.middleware.constraints$add_default_userland_constraints$fn__66374.invoke(constraints.clj:54)"
  "query_processor.middleware.process_userland_query$process_userland_query$fn__69372.invoke(process_userland_query.clj:151)"
  "query_processor.middleware.catch_exceptions$catch_exceptions$fn__69749.invoke(catch_exceptions.clj:171)"
  "query_processor.reducible$async_qp$qp_STAR___59517$thunk__59519.invoke(reducible.clj:103)"
  "query_processor.reducible$async_qp$qp_STAR___59517.invoke(reducible.clj:109)"
  "query_processor.reducible$async_qp$qp_STAR___59517.invoke(reducible.clj:94)"
  "query_processor.reducible$sync_qp$qp_STAR___59529.doInvoke(reducible.clj:129)"
  "query_processor$process_userland_query.invokeStatic(query_processor.clj:366)"
  "query_processor$process_userland_query.doInvoke(query_processor.clj:362)"
  "query_processor$fn__70804$process_query_and_save_execution_BANG___70813$fn__70816.invoke(query_processor.clj:377)"
  "query_processor$fn__70804$process_query_and_save_execution_BANG___70813.invoke(query_processor.clj:370)"
  "query_processor$fn__70849$process_query_and_save_with_max_results_constraints_BANG___70858$fn__70861.invoke(query_processor.clj:389)"
  "query_processor$fn__70849$process_query_and_save_with_max_results_constraints_BANG___70858.invoke(query_processor.clj:382)"
  "api.dataset$run_query_async$fn__86648.invoke(dataset.clj:73)"
  "query_processor.streaming$streaming_response_STAR_$fn__54380$fn__54381.invoke(streaming.clj:166)"
  "query_processor.streaming$streaming_response_STAR_$fn__54380.invoke(streaming.clj:165)"
  "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:69)"
  "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:67)"
  "async.streaming_response$do_f_async$task__36968.invoke(streaming_response.clj:88)"],
 :card_id 2,
 :context :ad-hoc,
 :error "Expected native source query to be a string, got: clojure.lang.PersistentArrayMap",
 :row_count 0,
 :running_time 0,
 :preprocessed
 {:database 2,
  :query
  {:source-card-id 2,
   :source-metadata
   [{:display_name "id",
     :field_ref [:field "id" {:base-type :type/Integer}],
     :name "id",
     :base_type :type/Integer,
     :effective_type :type/Integer,
     :semantic_type :type/PK,
     :fingerprint nil}
    {:display_name "created_at",
     :field_ref [:field "created_at" {:base-type :type/DateTimeWithLocalTZ, :temporal-unit :default}],
     :name "created_at",
     :base_type :type/DateTimeWithLocalTZ,
     :effective_type :type/DateTimeWithLocalTZ,
     :semantic_type :type/CreationTimestamp,
     :fingerprint {:global {:distinct-count 0, :nil% nil}, :type {:type/DateTime {:earliest nil, :latest nil}}}}
    {:display_name "updated_at",
     :field_ref [:field "updated_at" {:base-type :type/DateTimeWithLocalTZ, :temporal-unit :default}],
     :name "updated_at",
     :base_type :type/DateTimeWithLocalTZ,
     :effective_type :type/DateTimeWithLocalTZ,
     :semantic_type :type/UpdatedTimestamp,
     :fingerprint {:global {:distinct-count 0, :nil% nil}, :type {:type/DateTime {:earliest nil, :latest nil}}}}
    {:display_name "type",
     :field_ref [:field "type" {:base-type :type/Text}],
     :name "type",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type :type/Category,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "model_id",
     :field_ref [:field "model_id" {:base-type :type/Integer}],
     :name "model_id",
     :base_type :type/Integer,
     :effective_type :type/Integer,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type {:type/Number {:min nil, :q1 nil, :q3 nil, :max nil, :sd nil, :avg nil}}}}
    {:display_name "name",
     :field_ref [:field "name" {:base-type :type/Text}],
     :name "name",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type :type/Name,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "description",
     :field_ref [:field "description" {:base-type :type/Text}],
     :name "description",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type :type/Description,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "parameters",
     :field_ref [:field "parameters" {:base-type :type/Text}],
     :name "parameters",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "parameter_mappings",
     :field_ref [:field "parameter_mappings" {:base-type :type/Text}],
     :name "parameter_mappings",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "visualization_settings",
     :field_ref [:field "visualization_settings" {:base-type :type/Text}],
     :name "visualization_settings",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "public_uuid",
     :field_ref [:field "public_uuid" {:base-type :type/Text}],
     :name "public_uuid",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}
    {:display_name "made_public_by_id",
     :field_ref [:field "made_public_by_id" {:base-type :type/Integer}],
     :name "made_public_by_id",
     :base_type :type/Integer,
     :effective_type :type/Integer,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type {:type/Number {:min nil, :q1 nil, :q3 nil, :max nil, :sd nil, :avg nil}}}}
    {:display_name "creator_id",
     :field_ref [:field "creator_id" {:base-type :type/Integer}],
     :name "creator_id",
     :base_type :type/Integer,
     :effective_type :type/Integer,
     :semantic_type :type/Author,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type {:type/Number {:min nil, :q1 nil, :q3 nil, :max nil, :sd nil, :avg nil}}}}
    {:display_name "archived",
     :field_ref [:field "archived" {:base-type :type/Boolean}],
     :name "archived",
     :base_type :type/Boolean,
     :effective_type :type/Boolean,
     :semantic_type nil,
     :fingerprint {:global {:distinct-count 0, :nil% nil}}}
    {:display_name "entity_id",
     :field_ref [:field "entity_id" {:base-type :type/Text}],
     :name "entity_id",
     :base_type :type/Text,
     :effective_type :type/Text,
     :semantic_type nil,
     :fingerprint
     {:global {:distinct-count 0, :nil% nil},
      :type
      {:type/Text
       {:percent-json nil, :percent-url nil, :percent-email nil, :percent-state nil, :average-length nil}}}}],
   :fields
   [[:field "id" {:base-type :type/Integer}]
    [:field "created_at" {:base-type :type/DateTimeWithLocalTZ, :temporal-unit :default}]
    [:field "updated_at" {:base-type :type/DateTimeWithLocalTZ, :temporal-unit :default}]
    [:field "type" {:base-type :type/Text}]
    [:field "model_id" {:base-type :type/Integer}]
    [:field "name" {:base-type :type/Text}]
    [:field "description" {:base-type :type/Text}]
    [:field "parameters" {:base-type :type/Text}]
    [:field "parameter_mappings" {:base-type :type/Text}]
    [:field "visualization_settings" {:base-type :type/Text}]
    [:field "public_uuid" {:base-type :type/Text}]
    [:field "made_public_by_id" {:base-type :type/Integer}]
    [:field "creator_id" {:base-type :type/Integer}]
    [:field "archived" {:base-type :type/Boolean}]
    [:field "entity_id" {:base-type :type/Text}]],
   :source-query
   {:collection "action",
    :native
    {:collection "action",
     :query
     "SELECT \"public\".\"action\".\"id\" AS \"id\", \"public\".\"action\".\"created_at\" AS \"created_at\", \"public\".\"action\".\"updated_at\" AS \"updated_at\", \"public\".\"action\".\"type\" AS \"type\", \"public\".\"action\".\"model_id\" AS \"model_id\", \"public\".\"action\".\"name\" AS \"name\", \"public\".\"action\".\"description\" AS \"description\", \"public\".\"action\".\"parameters\" AS \"parameters\", \"public\".\"action\".\"parameter_mappings\" AS \"parameter_mappings\", \"public\".\"action\".\"visualization_settings\" AS \"visualization_settings\", \"public\".\"action\".\"public_uuid\" AS \"public_uuid\", \"public\".\"action\".\"made_public_by_id\" AS \"made_public_by_id\", \"public\".\"action\".\"creator_id\" AS \"creator_id\", \"public\".\"action\".\"archived\" AS \"archived\", \"public\".\"action\".\"entity_id\" AS \"entity_id\"\nFROM \"public\".\"action\"\nLIMIT 1048575"}},
   :limit 1048575,
   :metabase.query-processor.middleware.limit/original-limit nil},
  :type :query,
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true},
  :info {:executed-by 1, :context :ad-hoc, :card-id 2}},
 :ex-data
 {:type :invalid-query,
  :query
  {:collection "action",
   :query
   "SELECT \"public\".\"action\".\"id\" AS \"id\", \"public\".\"action\".\"created_at\" AS \"created_at\", \"public\".\"action\".\"updated_at\" AS \"updated_at\", \"public\".\"action\".\"type\" AS \"type\", \"public\".\"action\".\"model_id\" AS \"model_id\", \"public\".\"action\".\"name\" AS \"name\", \"public\".\"action\".\"description\" AS \"description\", \"public\".\"action\".\"parameters\" AS \"parameters\", \"public\".\"action\".\"parameter_mappings\" AS \"parameter_mappings\", \"public\".\"action\".\"visualization_settings\" AS \"visualization_settings\", \"public\".\"action\".\"public_uuid\" AS \"public_uuid\", \"public\".\"action\".\"made_public_by_id\" AS \"made_public_by_id\", \"public\".\"action\".\"creator_id\" AS \"creator_id\", \"public\".\"action\".\"archived\" AS \"archived\", \"public\".\"action\".\"entity_id\" AS \"entity_id\"\nFROM \"public\".\"action\"\nLIMIT 1048575"}},
 :data {:rows [], :cols []}}

@darksciencebase
Copy link
Contributor

@beshoyabdelmalak the fix is coming in 46.7, 46.6.1 is a security patch.

@beshoyabdelmalak
Copy link

Okay, thanks for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Processor .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants