Failing to upgrade controller: model is under "importing" mode, upgrade blocked

I am trying to upgrade a juju cluster from 3.6.4 → 3.6.8

juju upgrade-controller 
ERROR cannot upgrade to "3.6.8" due to issues with these models:
"jandersson/ws-monitoring":
- model is under "importing" mode, upgrade blocked
$ juju switch jandersson/ws-monitoring
ERROR "jandersson/ws-monitoring" is not the name of a model or controller

I suspect this model needs to be removed surgically since it doesn’t exist (E.g. isn’t shown by juju models --all)

What do we do to remove it?

@manadart would you know how we could perform some surgery on our controller to get out of this? We’re stuck on this version since long - unable to perform any upgrade.

juju upgrade-controller 
ERROR cannot upgrade to "3.6.12" due to issues with these models:
"jandersson/ws-monitoring":
- model is under "importing" mode, upgrade blocked

Thanx to @hpidcock that provided the solution, we have managed to get through this issue.

Steps taken:

  1. Connect to the mongodb

juju-db.mongo 127.0.0.1:37017/juju --authenticationDatabase admin --ssl --sslAllowInvalidCertificates --username machine-0 --password

2. Update datbase as follows:

// update status to available for model 153383c1-7bd8-4f6e-8ec7-be680156f497

db.statuses.updateOne({“_id”:“153383c1-7bd8-4f6e-8ec7-be680156f497”+“:e”},{“$set”: {“status”: “available”}})
// update migration-mode to “” for model 153383c1-7bd8-4f6e-8ec7-be680156f497

db.models.updateOne({“_id”:“153383c1-7bd8-4f6e-8ec7-be680156f497”},{“$set”: {“migration-mode”: “”}})
  1. Upgrade controller juju upgrade-controller

After months being stuck - we are finally on the right side of things again.