title: Sails 1 - Consistency violation: Attempting to tear down a datastore (`default`) which is not currently registered with this adapter
body: <p>I'm getting the following error when lifting a sails 1 app:</p>
  
  <blockquote>
    <p>Consistency violation: Attempting to tear down a datastore (<code>default</code>)
    which is not currently registered with this adapter.  This is usually
    due to a race condition in userland code (e.g. attempting to tear down
    the same ORM instance more than once), or it could be due to a bug in
    this adapter.</p>
  </blockquote>
  
  <p>I have absolutely no clue what this error means. This is how my config files look like:</p>
  
  <p><strong>Category.js (Model)</strong></p>
  
  <pre><code>module.exports = {
      schema: true,
      attributes: {
          name: {
              type: 'string',
              required: true,
              unique: true
          },
          products: {
              collection: 'product',
              via: 'category'
          },
          parentCategory: {
              model: 'category',
              defaultsTo: null
          },
          ancestors: {
              type: 'json',
              columnType: 'array',
              defaultsTo: []
          }
      }
  };
  </code></pre>
  
  <p><strong>datastores.js</strong></p>
  
  <pre><code>module.exports.datastores = {
  default: {
  
      adapter: require('sails-mongo'),
      host: 'localhost',
      port: 27017,
      // user: 'username',
      // password: 'password',
      database: 'your_mongo_db_name_here'
  
  }
  
  
  };
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
      "name": "mag",
      "private": true,
      "version": "2.0.0",
      "description": "site admin with modules",
      "keywords": [],
      "dependencies": {
          "@uirouter/angularjs": "^1.0.5",
          "angular": "^1.6.5",
          "angular-cookies": "^1.6.5",
          "angular-sanitize": "^1.6.5",
          "angular-ui-bootstrap": "^2.5.0",
          "async": "2.0.1",
          "babel-cli": "^6.24.1",
          "babel-core": "^6.25.0",
          "babel-loader": "^7.1.1",
          "babel-preset-es2015": "^6.24.1",
          "bcrypt": "^0.8.7",
          "bootstrap": "^3.3.7",
          "bootstrap-loader": "^2.1.0",
          "fs-extra": "^0.30.0",
          "imports-loader": "^0.7.1",
          "jquery": "1.11.0",
          "jsonwebtoken": "^5.5.4",
          "lodash": "3.10.1",
          "ng-lodash": "^0.2.3",
          "ng-toast": "^2.0.0",
          "resolve-url-loader": "^2.1.0",
          "sails": "^1.0.0-36",
          "sails-disk": "^0.10.10",
          "sails-hook-babel": "^6.0.3",
          "sails-hook-orm": "^2.0.0-0",
          "sails-hook-sockets": "^1.0.1",
          "sails-mongo": "^1.0.0-9",
          "style-loader": "^0.18.2",
          "url-loader": "^0.5.9",
          "webpack": "2.2.1"
      },
      "devDependencies": {
          "babel-preset-env": "^1.6.0",
          "clean-webpack-plugin": "0.1.16",
          "copy-webpack-plugin": "4.0.1",
          "css-loader": "^0.27.3",
          "ejs-loader": "0.3.0",
          "extract-text-webpack-plugin": "2.1.0",
          "less": "2.7.2",
          "less-loader": "4.0.1",
          "sails.io.js": "1.1.9",
          "socket.io-client": "1.7.3"
      },
      "scripts": {
          "start": "NODE_ENV=production node app.js"
      },
      "main": "app.js",
      "author": "",
      "license": ""
  }
  </code></pre>
  
  <p>any hint??</p>