Must be a valid instance of one of these clauses: :field-id, :field-literal

Hi -

I’m currently on the hosted version of Metabase.
Version: v1.36.6

If I add a custom column using the sample data set or any data set to do a calculation I always get this error:
Must be a valid instance of one of these clauses: :field-id, :field-literal

Hi @adamb
I cannot reproduce on 1.36.6.
I’m not completely sure why you’re seeing this - I have seen this error before, but in other context, not just with a simple table with a custom column.
Can you post the full error from Admin > Troubleshooting > Logs?

Blockquote
{:database_id 7,
:started_at #t “2020-11-17T20:01:55.212343Z[GMT]”,
:error_type :invalid-query,
:json_query
{:constraints {:max-results 10000, :max-results-bare-rows 2000},
:type :query,
:middleware {:js-int-to-string? true},
:database 7,
:query {:source-table 2014, :expressions {:TEST [:* [:field-id 22232] 1]}},
:parameters [],
:async? true,
:cache-ttl nil},
:native nil,
:status :failed,
:class clojure.lang.ExceptionInfo,
:stacktrace
["–> mbql.util$fn__26619$unwrap_field_clause__26624.invoke(util.clj:430)"
“mbql.util$fn__26678$field_clause__GT_id_or_literal__26683$fn__26684.invoke(util.clj:459)”
“mbql.util$fn__26678$field_clause__GT_id_or_literal__26683.invoke(util.clj:449)”
“query_processor.middleware.large_int_id$convert_id_to_string$fn__48698$fn__48701.invoke(large_int_id.clj:36)”
“query_processor.middleware.large_int_id$convert_id_to_string$fn__48698.invoke(large_int_id.clj:44)”
“query_processor.middleware.limit$limit$fn__48723.invoke(limit.clj:38)”
“query_processor.middleware.format_rows$format_rows$fn__48678.invoke(format_rows.clj:81)”
“query_processor.middleware.desugar$desugar$fn__48152.invoke(desugar.clj:22)”
“query_processor.middleware.binning$update_binning_strategy$fn__47174.invoke(binning.clj:229)”
“query_processor.middleware.resolve_fields$resolve_fields$fn__47690.invoke(resolve_fields.clj:24)”
“query_processor.middleware.add_dimension_projections$add_remapping$fn__46026.invoke(add_dimension_projections.clj:311)”
“query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__46229.invoke(add_implicit_clauses.clj:141)”
“metabase_enterprise.sandbox.query_processor.middleware.row_level_restrictions$apply_row_level_permissions$fn__50694.invoke(row_level_restrictions.clj:252)”
“query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__46622.invoke(add_source_metadata.clj:105)”
“metabase_enterprise.sandbox.query_processor.middleware.column_level_perms_check$maybe_apply_column_level_perms_check$fn__50463.invoke(column_level_perms_check.clj:24)”
“query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__49617.invoke(reconcile_breakout_and_order_by_bucketing.clj:98)”
“query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__46815.invoke(auto_bucket_datetimes.clj:125)”
“query_processor.middleware.resolve_source_table$resolve_source_tables$fn__47737.invoke(resolve_source_table.clj:46)”
“query_processor.middleware.parameters$substitute_parameters$fn__49402.invoke(parameters.clj:114)”
“query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__47789.invoke(resolve_referenced.clj:80)”
“query_processor.middleware.expand_macros$expand_macros$fn__48408.invoke(expand_macros.clj:158)”
“query_processor.middleware.add_timezone_info$add_timezone_info$fn__46631.invoke(add_timezone_info.clj:15)”
“query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__50314.invoke(splice_params_in_response.clj:32)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49628$fn__49632.invoke(resolve_database_and_driver.clj:33)”
“driver$do_with_driver.invokeStatic(driver.clj:61)”
“driver$do_with_driver.invoke(driver.clj:57)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49628.invoke(resolve_database_and_driver.clj:27)”
“query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__48626.invoke(fetch_source_query.clj:267)”
“query_processor.middleware.store$initialize_store$fn__50323$fn__50324.invoke(store.clj:11)”
“query_processor.store$do_with_store.invokeStatic(store.clj:46)”
“query_processor.store$do_with_store.invoke(store.clj:40)”
“query_processor.middleware.store$initialize_store$fn__50323.invoke(store.clj:10)”
“query_processor.middleware.cache$maybe_return_cached_results$fn__47666.invoke(cache.clj:209)”
“query_processor.middleware.validate$validate_query$fn__50332.invoke(validate.clj:10)”
“query_processor.middleware.normalize_query$normalize$fn__48750.invoke(normalize_query.clj:22)”
“query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__46491.invoke(add_rows_truncated.clj:36)”
“metabase_enterprise.audit.query_processor.middleware.handle_audit_queries$handle_internal_queries$fn__31362.invoke(handle_audit_queries.clj:165)”
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__50299.invoke(results_metadata.clj:147)”
“query_processor.middleware.constraints$add_default_userland_constraints$fn__48029.invoke(constraints.clj:42)”
“query_processor.middleware.process_userland_query$process_userland_query$fn__49491.invoke(process_userland_query.clj:136)”
“query_processor.middleware.catch_exceptions$catch_exceptions$fn__47972.invoke(catch_exceptions.clj:174)”
“query_processor.reducible$async_qp$qp_STAR___39734$thunk__39735.invoke(reducible.clj:103)”
“query_processor.reducible$async_qp$qp_STAR___39734$fn__39737.invoke(reducible.clj:108)”],
:context :question,
:error “Must be a valid instance of one of these clauses: :field-id, :field-literal”,
:row_count 0,
:running_time 0,
:preprocessed nil,
:ex-data {:type :schema.core/error, :value nil, :error (named (not (some-matching-condition? nil)) “Must be a valid instance of one of these clauses: :field-id, :field-literal”)},
:data {:rows [], :cols []}}

Sure - Pasted below

@adamb Now I see it. It’s because we never officially released 1.36.6, so I was testing with 1.36.6.4, but you’re actually using 1.36.5.1.
https://github.com/metabase/metabase/issues/13241
Please contact support via email and request an upgrade of your instance - please include a 15 minute time-window (and your timezone), where you prefer the upgrade to be done. Upgrade usually takes 2-3 minutes.

Thanks for your help! I saw the bug but was confused because the UI lists this.

Request sent to Support.