Scheduled Jobs triggering on non-existant Database

Hello -

The Issue

Im currently working through an issue that seems to reoccur on some sort of schedule. The result of the issue essentially locks Metabase’s backend and makes running any query excruciatingly slow.

What Ive done

After doing some digging, Ive found a common link of 17 queries that have been running for hours. Killing these queries (by restarting the app server) immediately fixes the problem.

Metabase troubleshooting page

Poking through the troubleshooting page via the Admin page, I noticed some strangeness with some of the Jobs. Specifically, the Triggers for metabase.task.sync-and-analyze.job and metabase.task.update-field-values.job.

In my case, “Database 4” seems culprit.

Non-existing db

To figure out what db “Database 4” mapped to, I checked the application db. I was surprised to find that there was no database where id = 4.

Next steps

Im at a loss of where to go at this point - any help would be greatly appreciated!

Screenshots

Application info

{
  "browser-info": {
    "language": "en-US",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0",
    "vendor": ""
  },
  "system-info": {
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.3+7",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.3",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.3+7",
    "os.name": "Linux",
    "os.version": "4.14.97-74.72.amzn1.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "mysql",
      "redshift",
      "h2"
    ],
    "hosting-env": "elastic-beanstalk",
    "application-database": "postgres",
    "run-mode": "prod",
    "version": {
      "date": "2019-12-19",
      "tag": "v0.34.0",
      "branch": "release-0.34.x",
      "hash": "1335215"
    },
    "settings": {
      "report-timezone": "US/Central"
    }
  }
}