orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

NPE in OAtomicOperationsManager prevents creation of database on AIX

Open zerovian opened this issue 11 years ago • 8 comments

OrientDB 2.0.8 AIX

Received the following NPE on when trying to create a database. Works fine on other platforms (windows, linux, solaris, hpux). The stack includes some of our code as well, but the issue is here down in OAtomicOperationsManager class.

com.progress.isq.ipqos.ProbeException: Error loading configuration database: Error creating OpenEdge Management configuration database: plocal:/largedisk/oemsmokes/116/aix64/build/oemgmt/config/configdb at com.progress.isq.ipqos.Probe.loadProject(Probe.java:2366) at com.progress.isq.ipqos.Probe.createResources(Probe.java:1241) at com.progress.isq.ipqos.Probe.start(Probe.java:565) at com.progress.isq.ipqos.plugin.Fathom.start(Fathom.java:329) at com.progress.isq.ipqos.plugin.FathomPlugIn.run(FathomPlugIn.java:275) at java.lang.Thread.run(Thread.java:804) Caused by: com.progress.isq.ipqos.DatabaseException: Error creating OpenEdge Management configuration database: plocal:/largedisk/oemsmokes/116/aix64/build/oemgmt/config/configdb at com.progress.isq.ipqos.AbstractDatabase.create(AbstractDatabase.java:336) at com.progress.isq.ipqos.Probe.loadProject(Probe.java:2319) ... 5 more Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'configdb' at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.create(ODatabaseDocumentTx.java:440) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperAbstract.java:72) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperAbstract.java:68) at com.progress.isq.ipqos.AbstractDatabase.create(AbstractDatabase.java:317) ... 6 more Caused by: java.lang.NullPointerException at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.endAtomicOperation(OAtomicOperationsManager.java:99) at com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent.endAtomicOperation(ODurableComponent.java:95) at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.endAtomicOperation(OPaginatedCluster.java:1139) at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.create(OPaginatedCluster.java:170) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.addClusterInternal(OAbstractPaginatedStorage.java:1921) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doAddCluster(OAbstractPaginatedStorage.java:1894) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.create(OAbstractPaginatedStorage.java:251) at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.create(OLocalPaginatedStorage.java:112) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.create(ODatabaseDocumentTx.java:375)

zerovian avatar May 14 '15 13:05 zerovian

Underlying exception which is being trapped, but not handled correctly is this:

[2015/05/14@09:18:22.361-0400] [3] [STDERR] java.lang.NoClassDefFoundError: com.sun.jna.Function (initialization failure) [2015/05/14@09:18:22.362-0400] [3] [STDERR] at java.lang.J9VMInternals.initialize(J9VMInternals.java:177) [2015/05/14@09:18:22.362-0400] [3] [STDERR] at com.orientechnologies.nio.AIXCLibrary.(AIXCLibrary.java:47) [2015/05/14@09:18:22.363-0400] [3] [STDERR] at java.lang.J9VMInternals.initializeImpl(Native Method) [2015/05/14@09:18:22.363-0400] [3] [STDERR] at java.lang.J9VMInternals.initialize(J9VMInternals.java:237) [2015/05/14@09:18:22.363-0400] [3] [STDERR] at com.orientechnologies.nio.OCLibraryFactory.(OCLibraryFactory.java:36) [2015/05/14@09:18:22.364-0400] [3] [STDERR] at java.lang.J9VMInternals.initializeImpl(Native Method) [2015/05/14@09:18:22.364-0400] [3] [STDERR] at java.lang.J9VMInternals.initialize(J9VMInternals.java:237) [2015/05/14@09:18:22.364-0400] [3] [STDERR] at com.orientechnologies.nio.OJNADirectMemory.(OJNADirectMemory.java:35) [2015/05/14@09:18:22.364-0400] [3] [STDERR] at java.lang.J9VMInternals.initializeImpl(Native Method) [2015/05/14@09:18:22.365-0400] [3] [STDERR] at java.lang.J9VMInternals.initialize(J9VMInternals.java:237) [2015/05/14@09:18:22.365-0400] [3] [STDERR] at com.orientechnologies.common.directmemory.ODirectMemoryFactory.(ODirectMemoryF actory.java:47) [2015/05/14@09:18:22.365-0400] [3] [STDERR] at java.lang.J9VMInternals.initializeImpl(Native Method) [2015/05/14@09:18:22.368-0400] [3] [STDERR] at java.lang.J9VMInternals.initialize(J9VMInternals.java:237) [2015/05/14@09:18:22.369-0400] [3] [STDERR] at com.orientechnologies.common.directmemory.ODirectMemoryPointer.(ODirectMemoryPoi nter.java:52) [2015/05/14@09:18:22.369-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$ LogSegment.logRecord(ODiskWriteAheadLog.java:343) [2015/05/14@09:18:22.369-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog. log(ODiskWriteAheadLog.java:877) [2015/05/14@09:18:22.370-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog. logAtomicOperationStartRecord(ODiskWriteAheadLog.java:831) [2015/05/14@09:18:22.370-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomi cOperationsManager.startAtomicOperation(OAtomicOperationsManager.java:76) [2015/05/14@09:18:22.370-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent. startAtomicOperation(ODurableComponent.java:99) [2015/05/14@09:18:22.371-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.start AtomicOperation(OPaginatedCluster.java:1147) [2015/05/14@09:18:22.371-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.creat e(OPaginatedCluster.java:157) [2015/05/14@09:18:22.371-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.addClus terInternal(OAbstractPaginatedStorage.java:1921) [2015/05/14@09:18:22.372-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doAddCl uster(OAbstractPaginatedStorage.java:1894) [2015/05/14@09:18:22.372-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.create( OAbstractPaginatedStorage.java:251) [2015/05/14@09:18:22.372-0400] [3] [STDERR] at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage. create(OLocalPaginatedStorage.java:112) [2015/05/14@09:18:22.373-0400] [3] [STDERR] at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.create(ODatabaseDocu mentTx.java:375) [2015/05/14@09:18:22.460-0400] [3] [STDERR] at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperA bstract.java:72) [2015/05/14@09:18:22.461-0400] [3] [STDERR] at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperA bstract.java:68) [2015/05/14@09:18:22.461-0400] [3] [STDERR] at com.progress.isq.ipqos.AbstractDatabase.create(AbstractDatabase.java:317)

zerovian avatar May 14 '15 13:05 zerovian

a bit more:

I'm using -Dmemory.useUnsafe=false. This was working fine with orientdb 1.7.8. I tried switching to jna 4.1 but that failed as well. I had originally turned off use of unsafe because it crashed on some platforms like AIX and HPUX. I'll try turning it back on to see if current version is stable with unsafe.

zerovian avatar May 14 '15 13:05 zerovian

Full JRE version: JRE 1.7.0 IBM J9 2.6 AIX ppc64-64

zerovian avatar May 14 '15 13:05 zerovian

That is because you need to build your own version of JNA for AIX.

On Thu, May 14, 2015 at 4:59 PM, zerovian [email protected] wrote:

Full JRE version: JRE 1.7.0 IBM J9 2.6 AIX ppc64-64

— Reply to this email directly or view it on GitHub https://github.com/orientechnologies/orientdb/issues/4153#issuecomment-102045317 .

Best regards, Andrey Lomakin.

andrii0lomakin avatar May 14 '15 14:05 andrii0lomakin

It is not provided out of the box.

On Thu, May 14, 2015 at 5:17 PM, Andrey Lomakin [email protected] wrote:

That is because you need to build your own version of JNA for AIX.

On Thu, May 14, 2015 at 4:59 PM, zerovian [email protected] wrote:

Full JRE version: JRE 1.7.0 IBM J9 2.6 AIX ppc64-64

— Reply to this email directly or view it on GitHub https://github.com/orientechnologies/orientdb/issues/4153#issuecomment-102045317 .

Best regards, Andrey Lomakin.

Best regards, Andrey Lomakin.

andrii0lomakin avatar May 14 '15 14:05 andrii0lomakin

Works fine when use unsafe memory is turned back on for AIX and HP-UX. So I suppose this can be closed.

zerovian avatar May 15 '15 12:05 zerovian

Actually the NPE shouldn't occur and the internal error needs to be handled better when JNA memory access fails. But either way i'm all set.

zerovian avatar May 15 '15 12:05 zerovian

Ok. We will switch this mode automatically for AIX. I think it will solve all problems.

andrii0lomakin avatar May 15 '15 13:05 andrii0lomakin