title: Unhandled rejection OrientDB.RequestError: User or password not valid for username: admin, database: 'demodb'
body: <p>Hy guys,
  I'm facing some trouble in connecting to an orientdb database.</p>
  <p>Here is my app.js code</p>
  <pre><code>const express = require('express');
  const app = express();
  const path = require('path');
  const router = express.Router();
  const OrientJs = require('orientjs');
  
  
  var server = OrientJs({
      host: &quot;localhost&quot;,
      password: &quot;root&quot;,
      username: &quot;root&quot;,
      useToken: true
  });
  
  var db = server.use({
      name: 'demodb',
      username: 'admin',
      password: 'root',
      useToken: true
  });
  
  server.list()
      .then(function (dbs) {
          console.log( dbs.length + ': database/s on the server.');
      });
  
  
  db.select().from('ArchaeologicalSites').all()
      .then(function (result) {
          console.log(result);
      });
  
  app.set('view engine', 'pug')
  
  router.get('/', function (req, res) {
      res.sendFile(path.join(__dirname + '/views/index.html'));
  });
  </code></pre>
  <p>The debugger shows this message even if I try to change the password or the username in the server.use() function.</p>
  <p>the message from the debugger:</p>
  <pre><code>Debugger listening on ws://127.0.0.1:5858/
  For help, see: https://nodejs.org/en/docs/inspector
  Debugger attached.
  Running at Port 3000
  Unhandled rejection OrientDB.RequestError: User or password not valid for username: admin, database: 'demodb'
          DB name=&quot;demodb&quot;
      at child.Operation.parseError (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:905:13)
      at child.Operation.consume (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:496:35)
      at Connection.process (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\connection.js:459:17)
      at Connection.handleSocketData (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\connection.js:331:20)
      at Socket.emit (events.js:376:20)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at Socket.Readable.push (internal/streams/readable.js:223:10)
      at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
      at TCP.callbackTrampoline (internal/async_hooks.js:134:14)
  
  1: database/s on the server.
  </code></pre>
  <p>So...it correctly connects with server.use(), in fact server.list() works fine.
  But when itcomes to the query it shows that maybe the var &quot;db&quot; has something wrong...</p>
  <p>When i change the app.js to this:</p>
  <pre><code>var db = server.use({
      name: 'demodb',
      username: 'root',
      password: 'root',
      useToken: true
  });
  </code></pre>
  <p>the error shown is this:</p>
  <pre><code>Debugger listening on ws://127.0.0.1:5858/
  For help, see: https://nodejs.org/en/docs/inspector
  Debugger attached.
  Running at Port 3000
  1: database/s on the server.
  Unhandled rejection OrientDB.RequestError: Invalid authentication info for access to the database com.orientechnologies.orient.core.metadata.security.auth.OTokenAuthInfo@1798dbcf
          DB name=&quot;demodb&quot;
      at child.Operation.parseError (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:905:13)
      at child.Operation.consume (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:496:35)
      at Connection.process (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\connection.js:459:17)
      at Connection.handleSocketData (C:\Users\\source\repos\ExpressApp3\ExpressApp3\node_modules\orientjs\lib\transport\binary\connection.js:331:20)
      at Socket.emit (events.js:376:20)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at Socket.Readable.push (internal/streams/readable.js:223:10)
      at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
      at TCP.callbackTrampoline (internal/async_hooks.js:134:14)
  
  </code></pre>
  <p>Ceers</p>