Correct a broken dashboard?

Hello all,

Help!! I have a neat dashboard which I spent a lot of time putting together, and this morning I tried to add global date filters for several of the queries displayed in the dashboard. I finally managed to do that in a new dashboard, I’m happy.
However in the meantime I tried stuff on the initial dashboard, including adding graphs with not properly defined Field filters, and possibly adding filters to my dashboard, linking them to a query, and editing the query afterwards… And it seems that I messed up something, because even when reverting the queries to their initial content (with no filters) the dashboard just wouldn’t load, saying only " Cannot read property ‘Date’ of undefined". ‘Date’ was the name of a field I tried to filter on, so I guess that there is an “orphan” filter on this dashboard which doesn’t refer to any query anymore, or something like that.

Can I edit/debug my dashboard in any way now, without having to recreate it all?
(Apologies if this is already answered somewhere else, I’ll search now, but it’s quite urgent :slight_smile: )

Thanks!
/Simon

Diagnostic info from Metabase’s Admin panel:
{
“browser-info”: {
“language”: “en-US”,
“platform”: “Linux x86_64”,
“userAgent”: “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10”,
“os.name”: “Linux”,
“os.version”: “4.15.0-76-generic”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“h2”,
“sqlite”
],
“hosting-env”: “unknown”,
“application-database”: “h2”,
“run-mode”: “prod”,
“version”: {
“date”: “2020-01-13”,
“tag”: “v0.34.1”,
“branch”: “release-0.34.x”,
“hash”: “265695c”
},
“settings”: {
“report-timezone”: null
}
}
}

Well, I kind of resolved it my adding back the ‘Date’ variable in the query, and then the dashboard loads again. I am then able to remove the date filter from the dashboard.
However I get the same error if I remove the date variable from the query afterwards :thinking: So I’m still grateful if someone can help.

Revision History is your friend:
image
Edit the dashboard, then the button appears. Roll it back as far as needed.

Thanks Andrew! Unfortunately not, When I’m having this issue, there is no interface at all for editing the dashboard - only the blue top bar of Metabase, and below the message “Cannot read property ‘Date’ of undefined”, and that’s it.

Hi @simon_solaris
Sounds like you’re seeing this issue:
https://github.com/metabase/metabase/issues/9299 - upvote by clicking :+1: on the first post

Indeed that’s the same, thanks! I upvoted.

Take a look in the Metabase database - you should be able to find the previous revisions in there. Not something I’ve played with yet, but it’s where the dashboard definitions are stored.

Hmm thanks - do you mean looking directly into ~/metabase-data/metabase.db/metabase.db.mv.db and metabase.db.trace.db?
I probably won’t try it out just now (since I worked around my initial issue), but I’ll keep that in mind for the next production-critical issue!

YEs, that’s right. IF you’re still using metabase.db.mv.db then it’s time to switch to postgress or mysql. You’ll avoid the nast corruption that’s coming closer every minute.

Thanks! Can you elaborate on the risk of corruption? In this Metabase instance I’m using and existing SQLite db file so I guess that there is not much to do about it, is there?

If you’re reading the metabase.db.mv.db file, then you’re using the default H2 database. This isn’t meant to be used for deployment, just for testing and development. If this is live with multiple users, you need to migrate.

Just for reference:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
If you want to read more reasons on why to migrate away from H2, then search the forum for topics about corrupted H2 databases.

Thank you very much both, I’ll look into this!