orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.71k stars 870 forks source link

OSecurityAccessException: Invalid authentication info for access to the database #10262

Open smurskiy opened 4 days ago

smurskiy commented 4 days ago

OrientDB Version: 3.2.23

OS: docker image

I use ODatabasePool in Java to connect to OrientDB.

OrientDB orientDB = new OrientDB("remote:localhost:2424", "root", "root", OrientDBConfig.defaultConfig());
OrientDBConfigBuilder poolCfg = OrientDBConfig.builder();
poolCfg.addConfig(OGlobalConfiguration.DB_POOL_MIN, 10);
poolCfg.addConfig(OGlobalConfiguration.DB_POOL_MAX, 50);

ODatabasePool pool = new ODatabasePool(orientDB, "db, "root", "root", poolCfg.build());

Sometimes I get an error while inserting edges and vertices or executing graph operations

com.orientechnologies.orient.core.exception.OSecurityAccessException: Invalid authentication info for access to the database 
com.orientechnologies.orient.core.metadata.security.auth.OTokenAuthInfo@5773aa92 DB name="db" DB name="db"
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleException(OChannelBinaryAsynchClient.java:355)
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient$$Lambda$3836/0x00000000f3085c90.onException(Unknown Source)
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:303)
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:325)
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:209) 
com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:167)
com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2001)
com.orientechnologies.orient.client.remote.OStorageRemote.lambda$networkOperationRetryTimeout$2(OStorageRemote.java:435) 
com.orientechnologies.orient.client.remote.OStorageRemote$$Lambda$3837/0x00000000f3086150.execute(Unknown Source) 
com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:500)
com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetryTimeout(OStorageRemote.java:415)
com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationNoRetry(OStorageRemote.java:450)
com.orientechnologies.orient.client.remote.OStorageRemote.execute(OStorageRemote.java:1284)
com.orientechnologies.orient.client.remote.db.document.ODatabaseDocumentRemote.execute(ODatabaseDocumentRemote.java:451)

This error does not reproduce regularly.

Settings in docker-compose:

orientdb:
  image: orientdb:3.2.23
  restart: always
  mem_limit: 2500m
  mem_reservation: 1000m
  environment:
    ORIENTDB_ROOT_PASSWORD: root
    ORIENTDB_OPTS_MEMORY: -Xmx1024m
    JAVA_OPTS_SCRIPT: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
    TZ: ${TIMEZONE:-UTC}
  ports:
    - ${ORIENTDB_HTTP_OUTER_PORT}:2480
    - ${ORIENTDB_OUTER_PORT}:2424
  volumes:
    - orientdb-data:/var/orientdb/databases
  healthcheck:
    test: >
      bash -c "curl http://localhost:2480/listDatabases"
    interval: 10s
    timeout: 2s
    retries: 20
tglman commented 4 days ago

Hi,

Does this happen if the client is idle for a while ?

smurskiy commented 4 days ago

No, the client regularly sends requests