Wrong user/password to [connect] to the remote OrientDB Server instance

633 views
Skip to first unread message

Christopher Armstrong

unread,
Jul 12, 2015, 4:39:55 PM7/12/15
to orient-...@googlegroups.com

Hi there,


I've just started off with OrientDb. I've added a new user called "testdb" with password "testdb" and assigned the "admin" role to the user over the web interface. I can connect with this user over the OrientDB web interface but I can't connect with my Javascript code.


It works when I try logging in with the root user that is defined in the orientdb-server-config.xml. How can I grant access to my "testdb" user so that I can connect to OrientDb remotely without having to add the users to orientdb-server-config.xml? It's totally unpractical if I need to add all the database users to this file manually.


Thanks for your assistance.


Here the error:

error: A hook (`orm`) failed to load!

error: OrientDB.RequestError: Wrong user/password to [connect] to the remote OrientDB Server instance. Get the user/password from the config/orientdb-server-config.xml file

    at Operation.parseError (/Users/charms/Documents/Temp/testbackend/node_modules/sails-orientdb/node_modules/oriento/lib/transport/binary/protocol28/operation.js:832:13)

    at Operation.consume (/Users/charms/Documents/Temp/testbackend/node_modules/sails-orientdb/node_modules/oriento/lib/transport/binary/protocol28/operation.js:422:35)

    at Connection.process (/Users/charms/Documents/Temp/testbackend/node_modules/sails-orientdb/node_modules/oriento/lib/transport/binary/connection.js:360:17)

    at Connection.handleSocketData (/Users/charms/Documents/Temp/testbackend/node_modules/sails-orientdb/node_modules/oriento/lib/transport/binary/connection.js:279:17)

    at Socket.emit (events.js:95:17)

    at Socket.<anonymous> (_stream_readable.js:764:14)

    at Socket.emit (events.js:92:17)

    at emitReadable_ (_stream_readable.js:426:10)

    at emitReadable (_stream_readable.js:422:5)

    at readableAddChunk (_stream_readable.js:165:9)

    at Socket.Readable.push (_stream_readable.js:127:10)

    at TCP.onread (net.js:528:21)

Luca Garulli

unread,
Jul 12, 2015, 6:10:45 PM7/12/15
to orient-...@googlegroups.com
I guess you/the-sails-module are trying connecting to the server, not the database. In this case you'd need "root" as user and the password stored in config/orientdb-server-config.xml file (auto generated).

How did you connect to OrientDB?

Best Regards,

Founder & CEO


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Armstrong

unread,
Jul 13, 2015, 12:22:14 PM7/13/15
to orient-...@googlegroups.com
Hi,

I'm using the sails-orientdb plugin. I got actually a little confused because I read that the best plugin is the waterline-orientdb plugin, but it seems that it was renamed to sales-orientdb.

The sails configuration looks the following:
   someOrientDbServer: {
      adapter: 'sails-orientdb',
      host: 'localhost',
      port: 2424, 
      username: 'testdb',
      password: 'testdb',
      database: 'testdb',
schema: false,
options: {
databaseType: 'graph'
}
},

I've been adding it according to following manual:

Kind regards,
Chris

Dário Marcelino

unread,
Jul 13, 2015, 4:04:54 PM7/13/15
to orient-...@googlegroups.com
Hi Christopher,

Since v0.10.53 (PR #86) sails-orientdb allows to authenticate against OrientDB using DB credentials only. This requires the DB to already be created, though.

Cheers,
Dário

Christopher Armstrong

unread,
Jul 13, 2015, 4:06:27 PM7/13/15
to orient-...@googlegroups.com
I was just talking to the developer of the plugin and he told me that it is necessary that the user is added to the user section of 

orientdb-server-config.xml. Is this true? It would mean that despite users can be added over the web interface manual configuration is required, which doesn't seem right. With MySQL I can create normal users without the need of touching a configuration file.

Christopher Armstrong

unread,
Jul 13, 2015, 4:49:07 PM7/13/15
to orient-...@googlegroups.com
Hi Dário,

Thanks for your feedback. I have  0.10.55. Doesn't work. I tested on two Macs. I've opened an issue with the sails-orientdb guys. 
Do I need to configure something else in orientdb-server-config.xml so that DB credentials only work?


Kind regards,
Chris

Dário Marcelino

unread,
Jul 13, 2015, 5:30:37 PM7/13/15
to orient-...@googlegroups.com

For reference, the way to connect to a DB without server credentials is by using options.databaseUser and options.databasePassword, for example:

myLocalOrient: {
  adapter: 'sails-orientdb',
  host: 'localhost',
  port: 2424,
  database: 'testdb',
  options: {
    databaseUser: 'testdb',
    databasePassword: 'testdb'
  }
}

By not including user and password, sails-orientdb will skip server authentication meaning it won't be able to perform server operations such as creating a DB, for example.


Regards,

Dário

Christopher Armstrong

unread,
Jul 13, 2015, 6:03:42 PM7/13/15
to orient-...@googlegroups.com
Hi all,

That's the piece I was missing. Somehow I didn't find the right information. But I guess I'll have to do a deep dive in to the Waterline paradigm.

Thanks a lot for helping me with this. It's working now.

Kind regards,
Chris
Reply all
Reply to author
Forward
0 new messages