Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unknown adapter "mongo" #47

Closed
kulakowka opened this issue Dec 10, 2015 · 4 comments
Closed

Error: Unknown adapter "mongo" #47

kulakowka opened this issue Dec 10, 2015 · 4 comments
Labels
issue: bug Issue reporting a bug
Milestone

Comments

@kulakowka
Copy link

I tried to add a new database in the studio. After successfully creating a new database my config file became looks like this:

{
  "orm": {
    "adapters": {
      "disk": "sails-disk",
      "mongo": "sails-mongo"
    },
    "defaultConnection": "default",
    "connections": {
      "default": {
        "adapter": "disk",
        "filePath": ".tmp/",
        "fileName": "default.db",
        "migrate": "alter"
      },
      "permanent": {
        "adapter": "disk",
        "filePath": "./data/",
        "fileName": "permanent.db",
        "migrate": "alter"
      },
      "mymongo": {
        "adapter": "mongo",
        "host": "localhost",
        "port": 27017,
        "user": "",
        "password": "",
        "database": "strapi"
      }
    }
  }
}

However, I found an error in the console. This is full listing:

strapi start
info: Server started in /Users/kulakowka/Documents/node.js/sandbox/appName
info: Your server is running at http://localhost:1337
debug: Time: Thu Dec 10 2015 17:09:44 GMT+0300 (MSK)
debug: Environment: development
debug: Process PID: 42079
debug: Cluster: master
info: To shut down your server, press <CTRL> + C at any time

warn: New worker starting...
debug: Process PID: 42080
debug: Cluster: worker #1

info: Connection with the Studio server found, please wait a few seconds...
info: Connected with the Studio server.
warn: We need to flush server.
warn: Install dependencies if we have to.

info: Application restarted

warn: Installing the `sails-mongo` adapter, please wait...
/usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline/connections/index.js:61
      throw new Error(msg);
      ^

Error: Unknown adapter "mongo" for connection `mymongo`.  You should double-check that the connection's `adapter` property matches the name of one of your adapters.  Or perhaps you forgot to include your "mongo" adapter when you called `waterline.initialize()`...
    at /usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline/connections/index.js:61:13
    at Array.forEach (native)
    at _build (/usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline/connections/index.js:44:24)
    at new module.exports (/usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline/connections/index.js:23:8)
    at Waterline.initialize (/usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline.js:101:22)
    at Hook.hook.initialize (/usr/local/lib/node_modules/strapi/lib/configuration/hooks/waterline/index.js:166:20)
    at Hook.wrapper [as initialize] (/usr/local/lib/node_modules/strapi/node_modules/lodash/index.js:3095:19)
    at /usr/local/lib/node_modules/strapi/lib/configuration/hooks/index.js:54:14
    at /usr/local/lib/node_modules/strapi/node_modules/async/lib/async.js:52:16
    at /usr/local/lib/node_modules/strapi/node_modules/async/lib/async.js:548:17
    at /usr/local/lib/node_modules/strapi/node_modules/async/lib/async.js:542:17
    at _arrayEach (/usr/local/lib/node_modules/strapi/node_modules/async/lib/async.js:85:13)
    at Immediate.taskComplete (/usr/local/lib/node_modules/strapi/node_modules/async/lib/async.js:541:13)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
warn: Installing the `sails-mongo` adapter, please wait...
/usr/local/lib/node_modules/strapi/node_modules/waterline/lib/waterline/connections/index.js:61
      throw new Error(msg);
      ^

Should I install it manually from npm or it's a bug?

I just started to learn your framework and is not yet fully understood. 👍

@loicsaintroch loicsaintroch added issue: bug Issue reporting a bug framework labels Dec 10, 2015
@loicsaintroch loicsaintroch added this to the v1.5.0 milestone Dec 10, 2015
@loicsaintroch loicsaintroch self-assigned this Dec 10, 2015
@loicsaintroch
Copy link

Hey @kulakowka, we improved the installation process of adapters for the v1.5.0. It will be release tomorrow. We'll try your issue using v1.5.0 as soon as possible.

To correctly answer your question, we had a little issue with the callback of this function which was called to soon. We automatically install the MongoDB adapter for you. It should work simply by restarting your application if you are on v1.4.1.

@kulakowka
Copy link
Author

When I tried to run the command npm install jade I got a lot of mistakes. These errors occur when I tried to install any package.

~/Documents/node.js/sandbox/appName » npm install jade
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "jade"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12

npm ERR! Cannot set property 'deep-diff' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "jade"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12

npm ERR! Cannot set property 'prompt' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "jade"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12

npm ERR! Cannot set property 'switchback' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "jade"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12

npm ERR! Cannot set property 'waterline-criteria' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "jade"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12

npm ERR! Cannot set property 'waterline-schema' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kulakowka/Documents/node.js/sandbox/appName/npm-debug.log

But when i copied all the files into a new folder and it worked.
Error with "sails-mongo" also disappeared.

strapi 1.4.1, Mac osx Yosemite 10.10.5.

I tried to run the commands with the sudo, but it has not given nor any effect.
I'll try to repeat it in the new version 1.5.0.
I hope there will not be these bugs.

@kulakowka
Copy link
Author

In version 1.5 there are no errors.

I think it helped me:

$ sudo npm uninstall strapi -g
$ sudo npm cache clean
$ sudo npm install strapi -g

@loicsaintroch
Copy link

Perfect, thank you for your feedback @kulakowka.

@strapi strapi locked and limited conversation to collaborators Dec 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue: bug Issue reporting a bug
Projects
None yet
Development

No branches or pull requests

2 participants