Dashboard filter not working for my mongodb question

Below is the variable filters :- {"$match" : {"status": {{status}}}},{"$match" : {"createdAt": {$gte :{{createdAt}}}}},{"$match" : {"eventType": {{eventType}}}}

These filters are working properly in the question itself.
and in dashboard also, visulisation is visible for the default values but when i am trying to change values in filter, it is not working. Do you have any idea what is the issue.

Hi @oshimmahajan
Post "Diagnostic Info" from Admin > Troubleshooting.
So you are saying that you can apply the filters on the native question, but they don't work on dashboards?
What exactly is not working? If you are getting an error, then post the error.

Yes, it is working on the native question but don't work on dashboards.
I am getting : "There was a problem displaying this chart." however when i am clicking on the same question and redirecting to the native question ...i can see the output.

@oshimmahajan

  1. Post "Diagnostic Info" from Admin > Troubleshooting.
  2. Check the logs for detailed errors - Admin > Troubleshooting > Logs.

Below is the error from logs. [fd25b37a-a706-4b39-86a3-54deca97f2cb] 2022-05-06T14:14:23+05:30 DEBUG metabase.server.middleware.log GET /api/database/3/autocomplete_suggestions 200 12.5 ms (6 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (4 idle, 0 queued) (143 total active threads) Queries in flight: 1 (0 queued)
[fd25b37a-a706-4b39-86a3-54deca97f2cb] 2022-05-06T14:14:27+05:30 DEBUG metabase.server.middleware.log POST /api/dataset 202 [ASYNC: completed] 4.8 s (22 DB calls) App DB connections: 1/15 Jetty threads: 2/50 (5 idle, 0 queued) (144 total active threads) Queries in flight: 1 (0 queued); redshift DB 3 connections: 4/5 (0 threads blocked)
[fd25b37a-a706-4b39-86a3-54deca97f2cb] 2022-05-06T14:14:48+05:30 ERROR metabase.query-processor.middleware.catch-exceptions Error processing query: null
{:database_id 3,
:started_at #t "2022-05-06T08:44:48.132927Z[GMT]",
:via
[{:status :failed,
:class clojure.lang.ExceptionInfo,
:error "Error executing query: ERROR: syntax error at or near "cast"\n Position: 285",
:stacktrace
["--> driver.sql_jdbc.execute$execute_reducible_query$fn__53323.invoke(execute.clj:504)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
"driver.sql_jdbc$fn__82025.invokeStatic(sql_jdbc.clj:54)"
"driver.sql_jdbc$fn__82025.invoke(sql_jdbc.clj:52)"
"query_processor.context$executef.invokeStatic(context.clj:59)"
"query_processor.context$executef.invoke(context.clj:48)"
"query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
"query_processor.context.default$default_runf.invoke(default.clj:66)"
"query_processor.context$runf.invokeStatic(context.clj:45)" and so on........

@oshimmahajan

  1. Post "Diagnostic Info" from Admin > Troubleshooting.
  2. Post the entire stacktrace, not just a snippet.

If you don't provide the information that I'm asking for, then I cannot help you.

Diagnostic info : {
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.14.1+1",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.14.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.14.1+1",
"os.name": "Linux",
"os.version": "5.4.181-99.354.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"redshift",
"postgres",
"h2",
"mongo"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "10.20 (Debian 10.20-1.pgdg110+1)"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.23"
}
},
"run-mode": "prod",
"version": {
"date": "2022-04-07",
"tag": "v0.42.4",
"branch": "release-x.42.x",
"hash": "7c3ce2d"
},
"settings": {
"report-timezone": null
}
}
} Let me know if this what you need.

Post the entire stacktrace, not just a snippet.

flamber, above mentioned is from "diagnostic info" only.
from where should i posted?

@oshimmahajan You need to provide the full detailed stacktrace error from Admin > Troubleshooting > Logs, since I have no idea why you are getting errors because you are not providing much information.

flamber : this is what i am getting from diagnostic info " Diagnostic Info

Please include these details in support requests. Thank y" and the detail above is the same which you are asking. Also, I have mentioned error details from logs. These are the only things which i am getting from logs and diagnostic info.

@oshimmahajan I can guarantee you that Metabase does not end the stacktrace errors with
and so on........

  1. Create the error on the dashboard
  2. Then go to Admin > Troubleshooting > LOGS and copy everything and upload it somewhere and post a link to the logs.

Logs : https://bitbucket.org/engineering_raena/workspace/snippets/yX5k9e

@oshimmahajan There's several errors, like on Postgres/Redshift:
invalid reference to FROM-clause entry for table
Which is caused using table aliases when using Field Filters:
https://www.metabase.com/learn/sql-questions/field-filters.html#field-filter-gotchas

But the Mongo error is
Unable to parse query: JSON reader was expecting a value but found '('.
Which is caused by a regression in the new filters introduced in 0.42, but it's specific to Text variable.
I've created an issue for it:
https://github.com/metabase/metabase/issues/22486 - upvote by clicking :+1: on the first post