Issues filtering on column that is a foreign key

Hi there,

I’m having issues using a filter on a column that is a foreign key to another table.
My case:
Tabel: registration - column : recycleparkno -> this is a foreignkey to the ‘recyclepark’ tabel, which there use the column recycleparkname to show the user a name instead of a number.

When you then try to filter in that tabel based on the names you see, it always gives an error.


When i try to view it in SQL editor;
46

The thing is, this worked before on an other metabase instance i have running. Just the same links. No problem…

How it is configured:

Anyone got any idea why this suddenly fails?

I already tried multiple times to rescan the fields and the database scheme and restart metabase.

Hi @timothyv
Please post “Diagnostic Info” from Admin > Troubleshooting, and which database you’re querying.
And check for a more detailed error in Admin > Troubleshooting > Logs.

Diagnostic info:
{
“browser-info”: {
“language”: “nl-NL”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “Cp1252”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.9.1+1”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.9.1”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.9.1+1”,
“os.name”: “Windows 10”,
“os.version”: “10.0”,
“user.language”: “nl”,
“user.timezone”: “Europe/Berlin”
},
“metabase-info”: {
“databases”: [
“postgres”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “10.15”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2021-01-26”,
“tag”: “v0.37.8”,
“branch”: “release-x.37.x”,
“hash”: “490cea7”
},
“settings”: {
“report-timezone”: “Europe/Brussels”
}
}
}

in the log i see pretty mutch the same:

[org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread run “ReservedThreadExecutor.java” 375]
[org.eclipse.jetty.util.thread.QueuedThreadPool runJob “QueuedThreadPool.java” 773]
[org.eclipse.jetty.util.thread.QueuedThreadPool$Runner run “QueuedThreadPool.java” 905]
[java.lang.Thread run “Thread.java” 834]],
:cause "For input string: "Steenokkerzeel “”,
:message "Error filtering against :type/Integer Field: unable to parse String “Steenokkerzeel " to a :type/Integer”,
:type clojure.lang.ExceptionInfo}

@timothyv Please post the entire stacktrace.
I’m 99% sure you’re seeing this issue:
https://github.com/metabase/metabase/issues/13235 - upvote by clicking :+1: on the first post

but is it possible that this worked and suddenly broken again with a latest patch? Pretty sure that this worked before.

I can’t post the full logs as the message is too long for the forum.

[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:26+01:00 ERROR metabase.query-processor.middleware.catch-exceptions Fout bij het afhandelen van query: null
{:database_id 2,
:started_at #t “2021-02-17T16:45:25.739899200+01:00[Europe/Berlin]”,
:via
[{:status :failed,
:class clojure.lang.ExceptionInfo,
:error “Error filtering against :type/Integer Field: unable to parse String “Meise " to a :type/Integer”,
:stacktrace
[”–> query_processor.middleware.auto_parse_filter_values$fn__42166$parse_value_for_base_type__42171$fn__42172.invoke(auto_parse_filter_values.clj:26)"
“query_processor.middleware.auto_parse_filter_values$fn__42166$parse_value_for_base_type__42171.invoke(auto_parse_filter_values.clj:15)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“mbql.util.match$replace_in_collection.invokeStatic(match.clj:135)”
“mbql.util.match$replace_in_collection.invoke(match.clj:126)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“mbql.util.match$replace_in_collection$iter__26261__26265$fn__26266.invoke(match.clj:132)”
“mbql.util.match$replace_in_collection.invokeStatic(match.clj:131)”
“mbql.util.match$replace_in_collection.invoke(match.clj:126)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188.invoke(auto_parse_filter_values.clj:34)”
“mbql.util$update_in_unless_empty.invokeStatic(util.clj:183)”
“mbql.util$update_in_unless_empty.doInvoke(util.clj:178)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_.invokeStatic(auto_parse_filter_values.clj:34)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_.invoke(auto_parse_filter_values.clj:33)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__42204.invoke(auto_parse_filter_values.clj:44)”
“query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__45861.invoke(wrap_value_literals.clj:149)”
“query_processor.middleware.annotate$add_column_info$fn__41959.invoke(annotate.clj:575)”
“query_processor.middleware.permissions$check_query_permissions$fn__43281.invoke(permissions.clj:71)”
“query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__44813.invoke(pre_alias_aggregations.clj:40)”
“query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__43479.invoke(cumulative_aggregations.clj:61)”
“query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__45050.invoke(resolve_joined_fields.clj:36)”
“query_processor.middleware.resolve_joins$resolve_joins$fn__45369.invoke(resolve_joins.clj:183)”
“query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__37684.invoke(add_implicit_joins.clj:254)”
“query_processor.middleware.large_int_id$convert_id_to_string$fn__44091.invoke(large_int_id.clj:44)”
“query_processor.middleware.format_rows$format_rows$fn__44071.invoke(format_rows.clj:75)”
“query_processor.middleware.desugar$desugar$fn__43545.invoke(desugar.clj:22)”
“query_processor.middleware.binning$update_binning_strategy$fn__42563.invoke(binning.clj:229)”
“query_processor.middleware.resolve_fields$resolve_fields$fn__43081.invoke(resolve_fields.clj:24)”
“query_processor.middleware.add_dimension_projections$add_remapping$fn__37228.invoke(add_dimension_projections.clj:318)”
“query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__37435.invoke(add_implicit_clauses.clj:141)”
“query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__37833.invoke(add_source_metadata.clj:105)”
“query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__45010.invoke(reconcile_breakout_and_order_by_bucketing.clj:98)”
“query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__42151.invoke(auto_bucket_datetimes.clj:140)”
“query_processor.middleware.resolve_source_table$resolve_source_tables$fn__43128.invoke(resolve_source_table.clj:46)”
“query_processor.middleware.parameters$substitute_parameters$fn__44795.invoke(parameters.clj:114)”
“query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__43180.invoke(resolve_referenced.clj:80)”
“query_processor.middleware.expand_macros$expand_macros$fn__43801.invoke(expand_macros.clj:158)”
“query_processor.middleware.add_timezone_info$add_timezone_info$fn__37864.invoke(add_timezone_info.clj:15)”
“query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__45731.invoke(splice_params_in_response.clj:32)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__45021$fn__45025.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__45021.invoke(resolve_database_and_driver.clj:27)”
“query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__44019.invoke(fetch_source_query.clj:267)”
“query_processor.middleware.store$initialize_store$fn__45740$fn__45741.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__45740.invoke(store.clj:10)”
“query_processor.middleware.validate$validate_query$fn__45749.invoke(validate.clj:10)”
“query_processor.middleware.normalize_query$normalize$fn__44143.invoke(normalize_query.clj:22)”
“query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__37702.invoke(add_rows_truncated.clj:36)”
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__45716.invoke(results_metadata.clj:147)”
“query_processor.middleware.constraints$add_default_userland_constraints$fn__43422.invoke(constraints.clj:42)”
“query_processor.middleware.process_userland_query$process_userland_query$fn__44884.invoke(process_userland_query.clj:136)”
“query_processor.middleware.catch_exceptions$catch_exceptions$fn__43365.invoke(catch_exceptions.clj:174)”
“query_processor.reducible$async_qp$qp_STAR___36491$thunk__36492.invoke(reducible.clj:103)”
“query_processor.reducible$async_qp$qp_STAR___36491.invoke(reducible.clj:109)”
“query_processor.reducible$sync_qp$qp_STAR___36500$fn__36503.invoke(reducible.clj:135)”
“query_processor.reducible$sync_qp$qp_STAR___36500.invoke(reducible.clj:134)”
“query_processor$process_userland_query.invokeStatic(query_processor.clj:237)”
“query_processor$process_userland_query.doInvoke(query_processor.clj:233)”
“query_processor$fn__45907$process_query_and_save_execution_BANG___45916$fn__45919.invoke(query_processor.clj:249)”
“query_processor$fn__45907$process_query_and_save_execution_BANG___45916.invoke(query_processor.clj:241)”
“query_processor$fn__45951$process_query_and_save_with_max_results_constraints_BANG___45960$fn__45963.invoke(query_processor.clj:261)”
“query_processor$fn__45951$process_query_and_save_with_max_results_constraints_BANG___45960.invoke(query_processor.clj:254)”
“api.dataset$fn__52618$fn__52621.invoke(dataset.clj:59)”
“query_processor.streaming$streaming_response_STAR_$fn__52599$fn__52600.invoke(streaming.clj:73)”
“query_processor.streaming$streaming_response_STAR_$fn__52599.invoke(streaming.clj:72)”
“async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:66)”
“async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:64)”
“async.streaming_response$do_f_async$fn__24642.invoke(streaming_response.clj:85)”],
:error_type :invalid-query,
:ex-data {:type :invalid-query}}],
:error_type :invalid-query,
:json_query
{:type “query”,
:query {:source-table 74, :filter ["=" [“field-id” 863] "Meise "]},
:database 2,
:parameters [],
:middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
:native nil,
:status :failed,
:class java.lang.NumberFormatException,
:stacktrace
[“java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)”
“java.base/java.lang.Long.parseLong(Long.java:692)”
“java.base/java.lang.Long.parseLong(Long.java:817)”
“–> query_processor.middleware.auto_parse_filter_values$fn__42166$parse_value_for_base_type__42171$fn__42172.invoke(auto_parse_filter_values.clj:20)”
“query_processor.middleware.auto_parse_filter_values$fn__42166$parse_value_for_base_type__42171.invoke(auto_parse_filter_values.clj:15)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“mbql.util.match$replace_in_collection.invokeStatic(match.clj:135)”
“mbql.util.match$replace_in_collection.invoke(match.clj:126)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“mbql.util.match$replace_in_collection$iter__26261__26265$fn__26266.invoke(match.clj:132)”
“mbql.util.match$replace_in_collection.invokeStatic(match.clj:131)”
“mbql.util.match$replace_in_collection.invoke(match.clj:126)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188$replace_42189__42190.invoke(auto_parse_filter_values.clj:34)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_$fn__42188.invoke(auto_parse_filter_values.clj:34)”
“mbql.util$update_in_unless_empty.invokeStatic(util.clj:183)”
“mbql.util$update_in_unless_empty.doInvoke(util.clj:178)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_.invokeStatic(auto_parse_filter_values.clj:34)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values_STAR_.invoke(auto_parse_filter_values.clj:33)”
“query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__42204.invoke(auto_parse_filter_values.clj:44)”
“query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__45861.invoke(wrap_value_literals.clj:149)”
“query_processor.middleware.annotate$add_column_info$fn__41959.invoke(annotate.clj:575)”
“query_processor.middleware.permissions$check_query_permissions$fn__43281.invoke(permissions.clj:71)”
“query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__44813.invoke(pre_alias_aggregations.clj:40)”
“query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__43479.invoke(cumulative_aggregations.clj:61)”
“query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__45050.invoke(resolve_joined_fields.clj:36)”
“query_processor.middleware.resolve_joins$resolve_joins$fn__45369.invoke(resolve_joins.clj:183)”
“query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__37684.invoke(add_implicit_joins.clj:254)”
“query_processor.middleware.large_int_id$convert_id_to_string$fn__44091.invoke(large_int_id.clj:44)”
“query_processor.middleware.format_rows$format_rows$fn__44071.invoke(format_rows.clj:75)”
“query_processor.middleware.desugar$desugar$fn__43545.invoke(desugar.clj:22)”
“query_processor.middleware.binning$update_binning_strategy$fn__42563.invoke(binning.clj:229)”
“query_processor.middleware.resolve_fields$resolve_fields$fn__43081.invoke(resolve_fields.clj:24)”
“query_processor.middleware.add_dimension_projections$add_remapping$fn__37228.invoke(add_dimension_projections.clj:318)”
“query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__37435.invoke(add_implicit_clauses.clj:141)”
“query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__37833.invoke(add_source_metadata.clj:105)”
“query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__45010.invoke(reconcile_breakout_and_order_by_bucketing.clj:98)”
“query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__42151.invoke(auto_bucket_datetimes.clj:140)”
“query_processor.middleware.resolve_source_table$resolve_source_tables$fn__43128.invoke(resolve_source_table.clj:46)”
“query_processor.middleware.parameters$substitute_parameters$fn__44795.invoke(parameters.clj:114)”
“query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__43180.invoke(resolve_referenced.clj:80)”
“query_processor.middleware.expand_macros$expand_macros$fn__43801.invoke(expand_macros.clj:158)”
“query_processor.middleware.add_timezone_info$add_timezone_info$fn__37864.invoke(add_timezone_info.clj:15)”
“query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__45731.invoke(splice_params_in_response.clj:32)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__45021$fn__45025.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__45021.invoke(resolve_database_and_driver.clj:27)”
“query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__44019.invoke(fetch_source_query.clj:267)”
“query_processor.middleware.store$initialize_store$fn__45740$fn__45741.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__45740.invoke(store.clj:10)”
“query_processor.middleware.validate$validate_query$fn__45749.invoke(validate.clj:10)”
“query_processor.middleware.normalize_query$normalize$fn__44143.invoke(normalize_query.clj:22)”
“query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__37702.invoke(add_rows_truncated.clj:36)”
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__45716.invoke(results_metadata.clj:147)”
“query_processor.middleware.constraints$add_default_userland_constraints$fn__43422.invoke(constraints.clj:42)”
“query_processor.middleware.process_userland_query$process_userland_query$fn__44884.invoke(process_userland_query.clj:136)”
“query_processor.middleware.catch_exceptions$catch_exceptions$fn__43365.invoke(catch_exceptions.clj:174)”
“query_processor.reducible$async_qp$qp_STAR___36491$thunk__36492.invoke(reducible.clj:103)”
“query_processor.reducible$async_qp$qp_STAR___36491.invoke(reducible.clj:109)”
“query_processor.reducible$sync_qp$qp_STAR___36500$fn__36503.invoke(reducible.clj:135)”
“query_processor.reducible$sync_qp$qp_STAR___36500.invoke(reducible.clj:134)”
“query_processor$process_userland_query.invokeStatic(query_processor.clj:237)”
“query_processor$process_userland_query.doInvoke(query_processor.clj:233)”
“query_processor$fn__45907$process_query_and_save_execution_BANG___45916$fn__45919.invoke(query_processor.clj:249)”
“query_processor$fn__45907$process_query_and_save_execution_BANG___45916.invoke(query_processor.clj:241)”
“query_processor$fn__45951$process_query_and_save_with_max_results_constraints_BANG___45960$fn__45963.invoke(query_processor.clj:261)”
“query_processor$fn__45951$process_query_and_save_with_max_results_constraints_BANG___45960.invoke(query_processor.clj:254)”
“api.dataset$fn__52618$fn__52621.invoke(dataset.clj:59)”
“query_processor.streaming$streaming_response_STAR_$fn__52599$fn__52600.invoke(streaming.clj:73)”
“query_processor.streaming$streaming_response_STAR_$fn__52599.invoke(streaming.clj:72)”
“async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:66)”
“async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:64)”
“async.streaming_response$do_f_async$fn__24642.invoke(streaming_response.clj:85)”],
:context :ad-hoc,
:error "For input string: "Meise “”,
:row_count 0,
:running_time 0,
:preprocessed nil,
:data {:rows [], :cols []}}

[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:26+01:00 DEBUG metabase.middleware.log POST /api/dataset 202 [ASYNC: completed] 601,9 ms (46 DB-aanroepen) Applicatieverbindingen met DB: 0/15 Jetty-threads: 2/50 (6 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)
[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:34+01:00 DEBUG metabase.middleware.log GET /api/session/properties 200 6,7 ms (2 DB-aanroepen) Applicatieverbindingen met DB: 4/15 Jetty-threads: 7/50 (3 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)
[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:34+01:00 DEBUG metabase.middleware.log GET /api/setting 200 1,3 ms (0 DB-aanroepen) Applicatieverbindingen met DB: 1/15 Jetty-threads: 5/50 (3 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)
[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:34+01:00 DEBUG metabase.middleware.log GET /api/setup/admin_checklist 200 28,5 ms (13 DB-aanroepen) Applicatieverbindingen met DB: 14/15 Jetty-threads: 3/50 (6 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)
[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:35+01:00 DEBUG metabase.middleware.log GET /api/util/bug_report_details 200 2,8 ms (1 DB-aanroepen) Applicatieverbindingen met DB: 1/15 Jetty-threads: 3/50 (6 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)
[ab54268f-4a62-46fa-90df-aa27198d53da] 2021-02-17T16:45:37+01:00 DEBUG metabase.middleware.log GET /api/task/info 200 6,1 ms (0 DB-aanroepen) Applicatieverbindingen met DB: 0/15 Jetty-threads: 3/50 (6 wachtend, 0 in wachtrij) (63 totaal actieve threads) Querys actief nu: {0} (0 in wachtrij)

@timothyv Okay, it is the same issue. Which version were you using before?

I’m not sure anymore. I think 37.7 or something when i started

@timothyv There’s no program changes between 0.37.7 and 0.37.8 - it was a release to upgrade Docker image dependencies.
And I’ve just tested 0.37.0, 0.37.7, 0.37.8 and 0.38.0, and they all behave the same - not working.
Did you perhaps have it as a “Search” instead of “List of items”? See step 4 in the issue.

Hmm, as you say it is already longer broken / or not working, than it was probably set like that then.
At least it’s a ‘workaround’ that is usable for clients.
Thanks for pointing me in that direction. Did not saw that on the issue.