tomasruizr / sails-cb

Waterline Adapter for Couchbase.
Other
0 stars 1 forks source link

There was an error attempting to load `sails-cb` #1

Open jhopper28 opened 8 years ago

jhopper28 commented 8 years ago

Any idea what would cause this error upon sails lift?

error: A hook (`orm`) failed to load!
error: Error: There was an error attempting to load `sails-cb`.
(Sails attempted to load this adapter because it is referenced by a datastore (`couchbase`) in this app's configuration)
Please ensure that `sails-cb` is a valid Sails/Waterline adapter, and that it is installed in this app.

Error details:

    at constructError (./node_modules/sails/node_modules/sails-hook-orm/lib/construct-error.js:57:13)
    at loadAdapterFromAppDependencies (./node_modules/sails/node_modules/sails-hook-orm/lib/load-adapter-from-app-dependencies.js:67:13)
    at _eachRelevantDatastoreIdentity (./node_modules/sails/node_modules/sails-hook-orm/lib/initialize.js:141:56)
    at arrayEach (./node_modules/sails/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (./node_modules/sails/node_modules/lodash/index.js:3345:13)
    at Array.async.auto._attemptToLoadUnrecognizedAdapters (./node_modules/sails/node_modules/sails-hook-orm/lib/initialize.js:130:11)
    at listener (./node_modules/sails/node_modules/sails-hook-orm/node_modules/async/lib/async.js:605:42)
    at ./node_modules/sails/node_modules/sails-hook-orm/node_modules/async/lib/async.js:544:17
    at _arrayEach (./node_modules/sails/node_modules/sails-hook-orm/node_modules/async/lib/async.js:85:13)
    at Immediate.taskComplete (./node_modules/sails/node_modules/sails-hook-orm/node_modules/async/lib/async.js:543:13)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

models.js:

module.exports.models = {
  connection: 'couchbase'
};

connections.js:

module.exports.connections = {
  couchbase: {
    adapter: 'sails-cb',
    host: 'localhost',
    port: '8091',
    username: 'user',
    password: '**********',
    bucket: 'bucket-name'
  }
};

I've verified that the server is available at the host:port. I'm able to use a different adapter (sails-cbes) to lift the app, but I get a failure when trying to connect to the bucket there, so I thought I'd try sails-cb, hoping for better results since it seems to be under more recent development. Also, I'm able to successfully run the app and connect to a MongoDB instance with that sails adapter, so it seems to be an issue specific to this adapter. Thanks!

tomasruizr commented 8 years ago

@jhopper28 thanks for your interest in this project. I'm sorry for my delay in the response, I've been busy. Just to check the obvious,

what version of couchbase are you working with? Did you try running npm test? Throws the same error?

Let me know, Am testing and checking on my end as well.

Cheers.

jhopper28 commented 8 years ago

Couchbase 4.1.1 npm test is currently hitting unrelated issues, so not seeing that error there.

tomasruizr commented 8 years ago

@jhopper28 I made tests with a fresh instance of sails and npm install sails-cb connecting couchbase and everything went well. Having a second look to your original message, two things comes to my mind. The password is the one you use to connect to couchbase administrator page. If you have Bucket Level security also, put it in bucketPassword. And second, What is the error that throws when trying to connect to sails-cbes? "I'm able to use a different adapter (sails-cbes) to lift the app, but I get a failure when trying to connect to the bucket there" Is possible that there is some issue with your couchbase instance. Have you try a fresh install? ... remember backup first.

aronsuarez commented 8 years ago

The solution is easy.

The node version is the problem, i get the same issue when i trying with node 4, but when i use node 6 it works.

tomasruizr commented 8 years ago

Thanks @nor-bu, nice to hear that!

@jhopper28 I hope that updating the node version works for you too. If is so, let me know in order to update the readme file to include the node version dependency.

Thanks both,

T