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.72k stars 870 forks source link

Getting cipher not initialized error while getting graph instance #8239

Closed shubhambondarde closed 2 years ago

shubhambondarde commented 6 years ago

OrientDB Version: <2.2.29>

Java Version: <7>

OS:

Getting exception while getting the instance of graph. Please find the stack trace below:

Exception in thread "Thread-16" com.orientechnologies.orient.core.exception.OInvalidStorageEncryptionKeyException: Cannot decrypt content DB name="cachedb3" at com.orientechnologies.orient.core.encryption.impl.OAbstractEncryption.decrypt(OAbstractEncryption.java:53) at com.orientechnologies.orient.core.encryption.impl.OAbstractEncryption.decrypt(OAbstractEncryption.java:36) at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readRecordBuffer(OPaginatedCluster.java:739) at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readRecord(OPaginatedCluster.java:689) at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readRecord(OPaginatedCluster.java:668) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doReadRecord(OAbstractPaginatedStorage.java:4136) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:3738) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:1368) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$SimpleRecordReader.readRecord(ODatabaseDocumentTx.java:3404) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:2022) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:660) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:103) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearchRecord(OCommandExecutorSQLSelect.java:585) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.serialIterator(OCommandExecutorSQLSelect.java:1642) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchFromTarget(OCommandExecutorSQLSelect.java:1589) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchValuesFromIndexCursor(OCommandExecutorSQLSelect.java:2469) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes(OCommandExecutorSQLSelect.java:2283) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(OCommandExecutorSQLSelect.java:1024) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:211) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:527) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:509) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:485) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:70) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:3340) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:3278) at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:78) at com.orientechnologies.orient.core.sql.query.OSQLAsynchQuery.run(OSQLAsynchQuery.java:74) at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:85) at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33) at com.orientechnologies.orient.core.metadata.security.OSecurityShared.getUser(OSecurityShared.java:607) at com.orientechnologies.orient.core.metadata.security.OSecurityShared.authenticate(OSecurityShared.java:235) at com.orientechnologies.orient.core.metadata.security.OSecurityProxy.authenticate(OSecurityProxy.java:107) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:276) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool$DatabaseDocumentTxPooled.internalOpen(OPartitionedDatabasePool.java:450) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.openDatabase(OPartitionedDatabasePool.java:311) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.acquire(OPartitionedDatabasePool.java:269) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.(OrientBaseGraph.java:144) at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.(OrientTransactionalGraph.java:77) at com.tinkerpop.blueprints.impls.orient.OrientGraph.(OrientGraph.java:135) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory$1.getGraph(OrientGraphFactory.java:85) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:222)

Caused by: java.lang.IllegalStateException: Cipher not initialized**** at javax.crypto.Cipher.checkCipherState(Cipher.java:1750) at javax.crypto.Cipher.doFinal(Cipher.java:2157) at com.orientechnologies.orient.core.encryption.impl.OAESEncryption.encryptOrDecrypt(OAESEncryption.java:80) at com.orientechnologies.orient.core.encryption.impl.OAbstractEncryption.decrypt(OAbstractEncryption.java:51)

luigidellaquila commented 6 years ago

Hi @shubhambondarde

Any suggestion on how to reproduce it?

Thanks

Luigi

tglman commented 6 years ago

Hi @shubhambondarde,

This bug as been already resolved in 2.2.34.

Regards

shubhambondarde commented 6 years ago

hi @luigidellaquila and @tglman, We are currently using java 7 in our product. Thus can't update the orientdb version. Can you please suggest any alternative to avoid this exception

tglman commented 6 years ago

Hi @shubhambondarde,

2.2.34 work out of box with java 7, you can update without problem.

Regards

shubhambondarde commented 6 years ago

Hi @luigidellaquila

Can you please suggest any workaround for this for orientdb jar 2.2.29?

tglman commented 6 years ago

Hi @shubhambondarde,

for this case we had an issue with concurrency that needed to be fixed, we do not have a way to work around this problem on older releases.

Regards