Cannot include saved questions as starting data in custom question

Hi, first of all congrats for version 38

I’m trying to include a saved questions as starting data in custom question, but when I click on Saved questions, no question appear

This is diagnostic info

{
“browser-info”: {
“language”: “en”,
“platform”: “Linux x86_64”,
“userAgent”: “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.6+10-LTS”,
“java.vendor”: “Amazon.com Inc.”,
“java.vendor.url”: “https://aws.amazon.com/corretto/”,
“java.version”: “11.0.6”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.6+10-LTS”,
“os.name”: “Linux”,
“os.version”: “4.14.173-137.228.amzn2.x86_64”,
“user.language”: “en”,
“user.timezone”: “UTC”
},
“metabase-info”: {
“databases”: [
“redshift”,
“postgres”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “10.4”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.18”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2021-02-19”,
“tag”: “v0.38.0.1”,
“branch”: “release-x.38.x”,
“hash”: “0635914”
},
“settings”: {
“report-timezone”: “UTC”
}
}
}

I obtaine this error on log when I click on “Saved Questions”

[2a1f1ee1-d769-454e-8a6a-e3feefa6b9f3] 2021-02-22T12:17:27+01:00 ERROR metabase.server.middleware.log GET /api/database/-1337/schemas 500 363.2 ms (12 DB calls) 
{:via [{:type java.lang.Exception, :message "Not something with an ID: 2", :at [metabase.util$the_id invokeStatic "util.clj" 500]}],
 :trace
 [[metabase.util$the_id invokeStatic "util.clj" 500]
  [metabase.util$the_id invoke "util.clj" 491]
  [metabase.driver.util$database__GT_driver_STAR_ invokeStatic "util.clj" 63]
  [metabase.driver.util$database__GT_driver_STAR_ invoke "util.clj" 60]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 665]
  [clojure.core$apply invoke "core.clj" 660]
  [clojure.core.memoize$through_STAR_$fn__4818 invoke "memoize.clj" 107]
  [clojure.core.cache$through$fn__4541 invoke "cache.clj" 55]
  [clojure.core.memoize$through_STAR_$fn__4814$fn__4815 invoke "memoize.clj" 106]
  [clojure.core.memoize.RetryingDelay deref "memoize.clj" 47]
  [clojure.core$deref invokeStatic "core.clj" 2320]
  [clojure.core$deref invoke "core.clj" 2306]
  [clojure.core.memoize$cached_function$fn__4882 doInvoke "memoize.clj" 231]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.AFunction$1 doInvoke "AFunction.java" 31]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [metabase.api.database$card_database_supports_nested_queries_QMARK_ invokeStatic "database.clj" 77]
  [metabase.api.database$card_database_supports_nested_queries_QMARK_ invoke "database.clj" 75]
  [metabase.api.database$card_can_be_used_as_source_query_QMARK_ invokeStatic "database.clj" 110]
  [metabase.api.database$card_can_be_used_as_source_query_QMARK_ invoke "database.clj" 107]
  [clojure.core$filter$fn__5889$fn__5890 invoke "core.clj" 2805]
  [clojure.core$completing$fn__8440 invoke "core.clj" 6868]
  [clojure.core$map$fn__5862$fn__5863 invoke "core.clj" 2742]
  [clojure.java.jdbc$init_reduce_rs invokeStatic "jdbc.clj" 1205]
  [clojure.java.jdbc$init_reduce_rs invoke "jdbc.clj" 1197]
  [clojure.java.jdbc$reducible_result_set_STAR_$reify__27251 reduce "jdbc.clj" 1227]
  [clojure.core$reduce invokeStatic "core.clj" 6827]
  [clojure.core$reduce invoke "core.clj" 6810]
  [clojure.java.jdbc$query_reducer$fn__27257$fn__27260 invoke "jdbc.clj" 1262]
  [clojure.java.jdbc$execute_query_with_params invokeStatic "jdbc.clj" 1091]
  [clojure.java.jdbc$execute_query_with_params invoke "jdbc.clj" 1084]
  [clojure.java.jdbc$db_query_with_resultset_STAR_ invokeStatic "jdbc.clj" 1113]
  [clojure.java.jdbc$db_query_with_resultset_STAR_ invoke "jdbc.clj" 1093]
  [clojure.java.jdbc$reducible_query$reify__27274 reduce "jdbc.clj" 1357]
  [clojure.core$transduce invokeStatic "core.clj" 6883]
  [clojure.core.Eduction reduce "core.clj" 7682]
  [clojure.core$transduce invokeStatic "core.clj" 6883]
  [clojure.core$transduce invoke "core.clj" 6870]
  [metabase.api.database$source_query_cards invokeStatic "database.clj" 126]
  [metabase.api.database$source_query_cards doInvoke "database.clj" 122]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [metabase.api.database$cards_virtual_tables invokeStatic "database.clj" 150]
  [metabase.api.database$cards_virtual_tables doInvoke "database.clj" 145]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [metabase.api.database$fn__62198 invokeStatic "database.clj" 687]
  [metabase.api.database$fn__62198 invoke "database.clj" 682]
  [compojure.core$wrap_response$fn__1993 invoke "core.clj" 160]
  [compojure.core$wrap_route_middleware$fn__1977 invoke "core.clj" 132]
  [compojure.core$wrap_route_info$fn__1982 invoke "core.clj" 139]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 151]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [metabase.server.middleware.auth$enforce_authentication$fn__73703 invoke "auth.clj" 14]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [compojure.core$make_context$handler__2033 invoke "core.clj" 287]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 296]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [metabase.api.routes$fn__73824$fn__73826 invoke "routes.clj" 69]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [clojure.lang.AFn applyToHelper "AFn.java" 160]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 665]
  [clojure.core$apply invoke "core.clj" 660]
  [metabase.server.routes$fn__76006$fn__76007 doInvoke "routes.clj" 57]
  [clojure.lang.RestFn invoke "RestFn.java" 436]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [compojure.core$make_context$handler__2033 invoke "core.clj" 287]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 296]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [metabase.server.routes$fn__75994$fn__75996 invoke "routes.clj" 41]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [metabase.server.middleware.exceptions$catch_uncaught_exceptions$fn__73815 invoke "exceptions.clj" 96]
  [metabase.server.middleware.exceptions$catch_api_exceptions$fn__73812 invoke "exceptions.clj" 84]
  [metabase.server.middleware.log$log_api_call$fn__75922$fn__75923 invoke "log.clj" 195]
  [toucan.db$_do_with_call_counting invokeStatic "db.clj" 216]
  [toucan.db$_do_with_call_counting invoke "db.clj" 209]
  [metabase.server.middleware.log$log_api_call$fn__75922 invoke "log.clj" 189]
  [metabase.server.middleware.security$add_security_headers$fn__73778 invoke "security.clj" 142]
  [metabase.server.middleware.json$wrap_json_body$fn__75703 invoke "json.clj" 62]
  [metabase.server.middleware.json$wrap_streamed_json_response$fn__75721 invoke "json.clj" 98]
  [ring.middleware.keyword_params$wrap_keyword_params$fn__76263 invoke "keyword_params.clj" 55]
  [ring.middleware.params$wrap_params$fn__76279 invoke "params.clj" 69]
  [metabase.server.middleware.misc$maybe_set_site_url$fn__35083 invoke "misc.clj" 58]
  [metabase.server.middleware.session$bind_current_user$fn__41826$fn__41827 invoke "session.clj" 277]
  [metabase.server.middleware.session$do_with_current_user invokeStatic "session.clj" 258]
  [metabase.server.middleware.session$do_with_current_user invoke "session.clj" 250]
  [metabase.server.middleware.session$bind_current_user$fn__41826 invoke "session.clj" 276]
  [metabase.server.middleware.session$wrap_current_user_info$fn__41813 invoke "session.clj" 236]
  [metabase.server.middleware.session$wrap_session_id$fn__41799 invoke "session.clj" 182]
  [metabase.server.middleware.auth$wrap_api_key$fn__73711 invoke "auth.clj" 27]
  [ring.middleware.cookies$wrap_cookies$fn__76183 invoke "cookies.clj" 216]
  [metabase.server.middleware.misc$add_content_type$fn__35066 invoke "misc.clj" 27]
  [metabase.server.middleware.misc$disable_streaming_buffering$fn__35091 invoke "misc.clj" 75]
  [ring.middleware.gzip$wrap_gzip$fn__76225 invoke "gzip.clj" 86]
  [metabase.server.middleware.misc$bind_request$fn__35094 invoke "misc.clj" 92]
  [metabase.server.middleware.ssl$redirect_to_https_middleware$fn__75939 invoke "ssl.clj" 48]
  [metabase.server$async_proxy_handler$fn__75536 invoke "server.clj" 71]
  [metabase.server.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a handle nil -1]
  [org.eclipse.jetty.server.handler.HandlerWrapper handle "HandlerWrapper.java" 127]
  [org.eclipse.jetty.server.Server handle "Server.java" 516]
  [org.eclipse.jetty.server.HttpChannel lambda$handle$1 "HttpChannel.java" 383]
  [org.eclipse.jetty.server.HttpChannel dispatch "HttpChannel.java" 556]
  [org.eclipse.jetty.server.HttpChannel handle "HttpChannel.java" 375]
  [org.eclipse.jetty.server.HttpConnection onFillable "HttpConnection.java" 273]
  [org.eclipse.jetty.io.AbstractConnection$ReadCallback succeeded "AbstractConnection.java" 311]
  [org.eclipse.jetty.io.FillInterest fillable "FillInterest.java" 105]
  [org.eclipse.jetty.io.ChannelEndPoint$1 run "ChannelEndPoint.java" 104]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill runTask "EatWhatYouKill.java" 336]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill doProduce "EatWhatYouKill.java" 313]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill tryProduce "EatWhatYouKill.java" 171]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill run "EatWhatYouKill.java" 129]
  [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 "Not something with an ID: 2",
 :message "Not something with an ID: 2",
 :type java.lang.Exception}

Hi @aris_pg
I think you have a corruption - I have now seen this problem a couple of time, but I’m unsure what leads to the problem. If you know, or think you know, then please tell, since I would love to reproduce the problem, so we can have a fix for it.
Have a read in this topic: Unable to pick a saved query, no query is shown in the list

Hi @flamber,

maybe I had open metabase with some question when I upgrade metabase to version 38.

Do you think that could be the reason?

@aris_pg No. It’s a corruption, but I don’t know how it occurs.

@flamber, I mean the reason it has become a corruption

I stopped service

I upgrade metabase jar file to v38

I restarted service

I had open metabase with some question during this process

@aris_pg No, that’s not the reason. Metabase doesn’t run during upgrade.
Check the table report_card in the application database for a question with ID=2 (that’s your error reference).

@flamber I localized question with id = 2

I unarchived it

I modify it and copy all fields from other “correct” question.

But still happening the same error when I click on Saved questions

Any ideas about how to solve it?

@aris_pg I don’t understand, but have you tried permanent deleting the question after archiving it? Archive it, then go to the Archive and click the trash-icon next to the question to permanently delete it.

@flamber I did it but still the same problem

[2a1f1ee1-d769-454e-8a6a-e3feefa6b9f3] 2021-02-22T16:35:29+01:00 ERROR metabase.server.middleware.log GET /api/database/-1337/schemas 500 806.5 ms (12 DB calls) 
{:via [{:type java.lang.Exception, :message "Not something with an ID: 2", :at [metabase.util$the_id invokeStatic "util.clj" 500]}],
 :trace
 [[metabase.util$the_id invokeStatic "util.clj" 500]
  [metabase.util$the_id invoke "util.clj" 491]
  [metabase.driver.util$database__GT_driver_STAR_ invokeStatic "util.clj" 63]
  [metabase.driver.util$database__GT_driver_STAR_ invoke "util.clj" 60]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 665]
  [clojure.core$apply invoke "core.clj" 660]
  [clojure.core.memoize$through_STAR_$fn__4818 invoke "memoize.clj" 107]
  [clojure.core.cache$through$fn__4541 invoke "cache.clj" 55]
  [clojure.core.memoize$through_STAR_$fn__4814$fn__4815 invoke "memoize.clj" 106]
  [clojure.core.memoize.RetryingDelay deref "memoize.clj" 47]
  [clojure.core$deref invokeStatic "core.clj" 2320]
  [clojure.core$deref invoke "core.clj" 2306]
  [clojure.core.memoize$cached_function$fn__4882 doInvoke "memoize.clj" 231]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.AFunction$1 doInvoke "AFunction.java" 31]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [metabase.api.database$card_database_supports_nested_queries_QMARK_ invokeStatic "database.clj" 77]
  [metabase.api.database$card_database_supports_nested_queries_QMARK_ invoke "database.clj" 75]
  [metabase.api.database$card_can_be_used_as_source_query_QMARK_ invokeStatic "database.clj" 110]
  [metabase.api.database$card_can_be_used_as_source_query_QMARK_ invoke "database.clj" 107]
  [clojure.core$filter$fn__5889$fn__5890 invoke "core.clj" 2805]
  [clojure.core$completing$fn__8440 invoke "core.clj" 6868]
  [clojure.core$map$fn__5862$fn__5863 invoke "core.clj" 2742]
  [clojure.java.jdbc$init_reduce_rs invokeStatic "jdbc.clj" 1205]
  [clojure.java.jdbc$init_reduce_rs invoke "jdbc.clj" 1197]
  [clojure.java.jdbc$reducible_result_set_STAR_$reify__27251 reduce "jdbc.clj" 1227]
  [clojure.core$reduce invokeStatic "core.clj" 6827]
  [clojure.core$reduce invoke "core.clj" 6810]
  [clojure.java.jdbc$query_reducer$fn__27257$fn__27260 invoke "jdbc.clj" 1262]
  [clojure.java.jdbc$execute_query_with_params invokeStatic "jdbc.clj" 1091]
  [clojure.java.jdbc$execute_query_with_params invoke "jdbc.clj" 1084]
  [clojure.java.jdbc$db_query_with_resultset_STAR_ invokeStatic "jdbc.clj" 1113]
  [clojure.java.jdbc$db_query_with_resultset_STAR_ invoke "jdbc.clj" 1093]
  [clojure.java.jdbc$reducible_query$reify__27274 reduce "jdbc.clj" 1357]
  [clojure.core$transduce invokeStatic "core.clj" 6883]
  [clojure.core.Eduction reduce "core.clj" 7682]
  [clojure.core$transduce invokeStatic "core.clj" 6883]
  [clojure.core$transduce invoke "core.clj" 6870]
  [metabase.api.database$source_query_cards invokeStatic "database.clj" 126]
  [metabase.api.database$source_query_cards doInvoke "database.clj" 122]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [metabase.api.database$cards_virtual_tables invokeStatic "database.clj" 150]
  [metabase.api.database$cards_virtual_tables doInvoke "database.clj" 145]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [metabase.api.database$fn__62198 invokeStatic "database.clj" 687]
  [metabase.api.database$fn__62198 invoke "database.clj" 682]
  [compojure.core$wrap_response$fn__1993 invoke "core.clj" 160]
  [compojure.core$wrap_route_middleware$fn__1977 invoke "core.clj" 132]
  [compojure.core$wrap_route_info$fn__1982 invoke "core.clj" 139]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 151]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 153]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [metabase.server.middleware.auth$enforce_authentication$fn__73703 invoke "auth.clj" 14]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [compojure.core$make_context$handler__2033 invoke "core.clj" 287]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 296]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 297]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [metabase.api.routes$fn__73824$fn__73826 invoke "routes.clj" 69]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [clojure.lang.AFn applyToHelper "AFn.java" 160]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 665]
  [clojure.core$apply invoke "core.clj" 660]
  [metabase.server.routes$fn__76006$fn__76007 doInvoke "routes.clj" 57]
  [clojure.lang.RestFn invoke "RestFn.java" 436]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [compojure.core$make_context$handler__2033 invoke "core.clj" 287]
  [compojure.core$make_context$fn__2035 invoke "core.clj" 296]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [compojure.core$wrap_route_matches$fn__1986 invoke "core.clj" 152]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005$f__2006$respond_SINGLEQUOTE___2007 invoke "core.clj" 197]
  [metabase.server.routes$fn__75994$fn__75996 invoke "routes.clj" 41]
  [compojure.core$routes$fn__2005$f__2006 invoke "core.clj" 198]
  [compojure.core$routes$fn__2005 invoke "core.clj" 200]
  [metabase.server.middleware.exceptions$catch_uncaught_exceptions$fn__73815 invoke "exceptions.clj" 96]
  [metabase.server.middleware.exceptions$catch_api_exceptions$fn__73812 invoke "exceptions.clj" 84]
  [metabase.server.middleware.log$log_api_call$fn__75922$fn__75923 invoke "log.clj" 195]
  [toucan.db$_do_with_call_counting invokeStatic "db.clj" 216]
  [toucan.db$_do_with_call_counting invoke "db.clj" 209]
  [metabase.server.middleware.log$log_api_call$fn__75922 invoke "log.clj" 189]
  [metabase.server.middleware.security$add_security_headers$fn__73778 invoke "security.clj" 142]
  [metabase.server.middleware.json$wrap_json_body$fn__75703 invoke "json.clj" 62]
  [metabase.server.middleware.json$wrap_streamed_json_response$fn__75721 invoke "json.clj" 98]
  [ring.middleware.keyword_params$wrap_keyword_params$fn__76263 invoke "keyword_params.clj" 55]
  [ring.middleware.params$wrap_params$fn__76279 invoke "params.clj" 69]
  [metabase.server.middleware.misc$maybe_set_site_url$fn__35083 invoke "misc.clj" 58]
  [metabase.server.middleware.session$bind_current_user$fn__41826$fn__41827 invoke "session.clj" 277]
  [metabase.server.middleware.session$do_with_current_user invokeStatic "session.clj" 258]
  [metabase.server.middleware.session$do_with_current_user invoke "session.clj" 250]
  [metabase.server.middleware.session$bind_current_user$fn__41826 invoke "session.clj" 276]
  [metabase.server.middleware.session$wrap_current_user_info$fn__41813 invoke "session.clj" 236]
  [metabase.server.middleware.session$wrap_session_id$fn__41799 invoke "session.clj" 182]
  [metabase.server.middleware.auth$wrap_api_key$fn__73711 invoke "auth.clj" 27]
  [ring.middleware.cookies$wrap_cookies$fn__76183 invoke "cookies.clj" 216]
  [metabase.server.middleware.misc$add_content_type$fn__35066 invoke "misc.clj" 27]
  [metabase.server.middleware.misc$disable_streaming_buffering$fn__35091 invoke "misc.clj" 75]
  [ring.middleware.gzip$wrap_gzip$fn__76225 invoke "gzip.clj" 86]
  [metabase.server.middleware.misc$bind_request$fn__35094 invoke "misc.clj" 92]
  [metabase.server.middleware.ssl$redirect_to_https_middleware$fn__75939 invoke "ssl.clj" 48]
  [metabase.server$async_proxy_handler$fn__75536 invoke "server.clj" 71]
  [metabase.server.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a handle nil -1]
  [org.eclipse.jetty.server.handler.HandlerWrapper handle "HandlerWrapper.java" 127]
  [org.eclipse.jetty.server.Server handle "Server.java" 516]
  [org.eclipse.jetty.server.HttpChannel lambda$handle$1 "HttpChannel.java" 383]
  [org.eclipse.jetty.server.HttpChannel dispatch "HttpChannel.java" 556]
  [org.eclipse.jetty.server.HttpChannel handle "HttpChannel.java" 375]
  [org.eclipse.jetty.server.HttpConnection onFillable "HttpConnection.java" 273]
  [org.eclipse.jetty.io.AbstractConnection$ReadCallback succeeded "AbstractConnection.java" 311]
  [org.eclipse.jetty.io.FillInterest fillable "FillInterest.java" 105]
  [org.eclipse.jetty.io.ChannelEndPoint$1 run "ChannelEndPoint.java" 104]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill runTask "EatWhatYouKill.java" 336]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill doProduce "EatWhatYouKill.java" 313]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill tryProduce "EatWhatYouKill.java" 171]
  [org.eclipse.jetty.util.thread.strategy.EatWhatYouKill run "EatWhatYouKill.java" 129]
  [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 "Not something with an ID: 2",
 :message "Not something with an ID: 2",
 :type java.lang.Exception}

@aris_pg Then I guess you have another question, which is using ID=2 as it’s source-table.
Try searching in report_card.dataset_query containing card__2

I found it!

There was a question with source question another Saved Questions.

The original saved question was not correct to use it as starting data (“Saved Question”), so there was an error when opening the corrupted question.

I just archive this question and now everything is working.

Just if this can help: `I didn’t identify id=2 in any place, just search a question with “card__” in report_card.dataset_query"

Thanks @flamber for your quick answers!

@aris_pg Excellent.
So you’re saying that you had another question which was based on a Saved Question - unrelated to question ID=2 ?
Is it the nested question or Saved Question source that was corrupt?
What was the error when opening the question?

@flamber I answer your questions

So you’re saying that you had another question which was based on a Saved Question - unrelated to question ID=2

Yes, nothing to be with question ID = 2

Is it the nested question or Saved Question source that was corrupt?

Nested was corrupted

What was the error when opening the question?

This is the error when loading nested question

[2a1f1ee1-d769-454e-8a6a-e3feefa6b9f3] 2021-02-23T07:05:57+01:00 ERROR metabase.query-processor.middleware.process-userland-query Error saving query execution info
org.postgresql.util.PSQLException: ERROR: column "database_id" is of type integer but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 196
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:130)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:462)
	at clojure.java.jdbc$db_do_execute_prepared_return_keys$exec_and_return_keys__27192.invoke(jdbc.clj:979)
	at clojure.java.jdbc$db_do_execute_prepared_return_keys.invokeStatic(jdbc.clj:1007)
	at clojure.java.jdbc$db_do_execute_prepared_return_keys.invoke(jdbc.clj:963)
	at clojure.java.jdbc$db_do_prepared_return_keys.invokeStatic(jdbc.clj:1038)
	at clojure.java.jdbc$db_do_prepared_return_keys.invoke(jdbc.clj:1015)
	at clojure.java.jdbc$db_do_prepared_return_keys.invokeStatic(jdbc.clj:1040)
	at clojure.java.jdbc$db_do_prepared_return_keys.invoke(jdbc.clj:1015)
	at toucan.db$simple_insert_many_BANG_$iter__28088__28092$fn__28093$fn__28094.invoke(db.clj:563)
	at toucan.db$simple_insert_many_BANG_$iter__28088__28092$fn__28093.invoke(db.clj:561)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.RT.seq(RT.java:535)
	at clojure.core$seq__5402.invokeStatic(core.clj:137)
	at clojure.core$dorun.invokeStatic(core.clj:3133)
	at clojure.core$doall.invokeStatic(core.clj:3148)
	at clojure.core$doall.invoke(core.clj:3148)
	at toucan.db$simple_insert_many_BANG_.invokeStatic(db.clj:560)
	at toucan.db$simple_insert_many_BANG_.invoke(db.clj:546)
	at toucan.db$simple_insert_BANG_.invokeStatic(db.clj:593)
	at toucan.db$simple_insert_BANG_.invoke(db.clj:582)
	at toucan.db$insert_BANG_.invokeStatic(db.clj:610)
	at toucan.db$insert_BANG_.invoke(db.clj:597)
	at metabase.query_processor.middleware.process_userland_query$save_query_execution_BANG__STAR_.invokeStatic(process_userland_query.clj:34)
	at metabase.query_processor.middleware.process_userland_query$save_query_execution_BANG__STAR_.invoke(process_userland_query.clj:28)
	at metabase.query_processor.middleware.process_userland_query$save_query_execution_BANG_$fn__47048.invoke(process_userland_query.clj:50)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
[2a1f1ee1-d769-454e-8a6a-e3feefa6b9f3] 2021-02-23T07:05:57+01:00 ERROR metabase.query-processor.middleware.catch-exceptions Error processing query: null
#error {
 :cause "Don't know how to create ISeq from: clojure.lang.ExceptionInfo"
 :via
 [{:type java.lang.IllegalArgumentException
   :message "Don't know how to create ISeq from: clojure.lang.ExceptionInfo"
   :at [clojure.lang.RT seqFrom "RT.java" 557]}]
 :trace
 [[clojure.lang.RT seqFrom "RT.java" 557]
  [clojure.lang.RT seq "RT.java" 537]
  [clojure.lang.APersistentMap cons "APersistentMap.java" 40]
  [clojure.lang.RT conj "RT.java" 677]
  [clojure.core$conj__5390 invokeStatic "core.clj" 85]
  [clojure.core$merge$fn__5958 invoke "core.clj" 3049]
  [clojure.core$reduce1 invokeStatic "core.clj" 944]
  [clojure.core$reduce1 invokeStatic "core.clj" 934]
  [clojure.core$merge invokeStatic "core.clj" 3048]
  [clojure.core$merge doInvoke "core.clj" 3041]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [metabase.query_processor.middleware.catch_exceptions$format_exception_STAR_ invokeStatic "catch_exceptions.clj" 141]
  [metabase.query_processor.middleware.catch_exceptions$format_exception_STAR_ invoke "catch_exceptions.clj" 136]
  [metabase.query_processor.middleware.catch_exceptions$catch_exceptions$fn__45548$raisef_STAR___45554 invoke "catch_exceptions.clj" 168]
  [metabase.query_processor.middleware.process_userland_query$process_userland_query$fn__47072$raisef_STAR___47076 invoke "process_userland_query.clj" 130]
  [metabase.query_processor.middleware.process_userland_query$process_userland_query$fn__47072 invoke "process_userland_query.clj" 137]
  [metabase.query_processor.middleware.catch_exceptions$catch_exceptions$fn__45548 invoke "catch_exceptions.clj" 173]
  [metabase.query_processor.reducible$async_qp$qp_STAR___37408$thunk__37409 invoke "reducible.clj" 103]
  [metabase.query_processor.reducible$async_qp$qp_STAR___37408$fn__37411 invoke "reducible.clj" 108]
  [clojure.core$binding_conveyor_fn$fn__5754 invoke "core.clj" 2030]
  [clojure.lang.AFn call "AFn.java" 18]
  [java.util.concurrent.FutureTask run "FutureTask.java" 264]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
  [java.lang.Thread run "Thread.java" 834]]}