2

We have the following scenario:

  1. Call server.exists()
  2. Select user vertices
  3. Call server.exists()

The result is a failure on the 3rd step.

More details and a reduced use-case:

const OrientDB = require('orientjs')
const server = OrientDB({
    "host": "localhost",
    "port": 2424,
    "username": "root",
    "password": "password",
    "pool": {
        "max": 10
    }
})
const db = server.use('myDatabase')

server.exists(db.name, db.type).then(exists => {

    console.log("Database exists first time: " + exists)

    db.select().from('user').column('id', 'name').all().then(() => {

        server.exists(db.name, db.type).then(exists => {
            console.log("Database exists second time: " + exists)
        }).catch(err => {
            console.log("Error on second exists:", err)
        })

    })

})

I get the following error on the second server.exists() call:

{
    [OrientDB.RequestError: Server user not authenticated.]
    name: 'OrientDB.RequestError',
    message: 'Server user not authenticated.',
    data: {},
    previous: [],
    id: 1,
    type: 'com.orientechnologies.orient.core.exception.OSecurityAccessException',
    hasMore: 0
}

This isn't the actual code, it's reduced but highlights the error. The real code is spread over three files in an API.

I have tested this on OrientDB 2.1.3 and 2.1.5, both on Mac and Ubuntu.

Any thoughts on why this happens are welcome.

Thanks.

Adrian Lynch
  • 8,237
  • 2
  • 32
  • 40

0 Answers0