codeswarm / sails-couchdb-orm

CouchDB Adapter for the Sails.js ORM Framework, Waterline
36 stars 20 forks source link

Connecting to Cloudant - Facing Issues #12

Open vasumahesh1 opened 9 years ago

vasumahesh1 commented 9 years ago

Tried to Connect to CLOUDANT for remote DB Access.

using this:

remoteCouch: {                                                                       
    adapter: 'sails-couchdb-orm',
    host: 'test.cloudant.com',
    port: 5984,
    username: '***',
    password: '***',
    database: 'project_hub'                                
  }

I have given Reader & Writer Access to this Username, Password Combination.

Yet the error is : _reader access is required for this request

info: Starting app...

info:
info:                .-..-.
info:
info:    Sails              <|    .-..-.
info:    v0.11.0             |\
info:                       /|.\
info:                      / || \
info:                    ,'  |'  \
info:                 .-'.-==|/_--'
info:                 `--'-------'
info:    __---___--___---___--___---___--___
info:  ____---___--___---___--___---___--___-__
info:
info: Server lifted in `P:\4.Web-Based\profile_heroku`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

debug: --------------------------------------------------------
debug: :: Fri Apr 17 2015 18:07:27 GMT+0530 (India Standard Time)

debug: Environment : development
debug: Port        : 1337
debug: --------------------------------------------------------
Error (E_UNKNOWN) :: Encountered an unexpected error
: _reader access is required for this request
    at Request._callback (P:\4.Web-Based\profile_heroku\node_modules\sails-couchdb-orm\node_modules\nano\nano.js:319:39)

    at Request.self.callback (P:\4.Web-Based\profile_heroku\node_modules\sails-couchdb-orm\node_modules\nano\node_module
s\request\request.js:122:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (P:\4.Web-Based\profile_heroku\node_modules\sails-couchdb-orm\node_modules\nano\node_modules\
request\request.js:888:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (P:\4.Web-Based\profile_heroku\node_modules\sails-couchdb-orm\node_modules\nano\node_
modules\request\request.js:839:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickDomainCallback (node.js:381:11)

Details:  Error: _reader access is required for this request

Thanks in advance.

danscan commented 9 years ago

+1. Also having issues.

danscan commented 9 years ago

Connecting to Cloudant fails– in my case because the version of nano doesn't properly encode URI components. Can fix via npm update --save nano in this repo. There doesn't seem to be much test coverage, but it's working well for me. Can create a PR.

danielduan commented 9 years ago

@danscan, do you have a fork with the nano fix in there? I'm trying to get this working on Cloudant as well but running 'npm update' in the node_module/sails-couchdb-orm/ doesn't fix it for me.

danielduan commented 9 years ago

Actually nevermind, I figured it out. You have to add the 'https: true' parameter inside the connection settings as well for it to work with Cloudant.