java.sql.BatchUpdateException: Page Page(41494,Container(0, 2128)) could not be read from disk.

Apache's JIRA Issue Tracker | Varma R | 6 years ago
  1. 0

    One of the derby database table "gets corrupted"/"indicates connection not available" during processing inserts from java client application as shown in the trace and the only way to recover from this error is to rebuild the DB - by deleting the data and creating the tables again. This happens once in a while (thrice in a span of two months) and the java application (run in multiple servers), which updates the database, processes around 100 million transactions per hour (in total and each transation results in 4-5 updates to the DB) There are eight tables in the derby database. TABLE NAME ROWS COUNT (at time of corruption) --------------------------------------------------------------------------------- KPI.KPI_MERGEIN; 362917 KPI.KPI_IN; 422508 KPI.KPI_DROPPED; 53667 KPI.KPI_ERROR1; 0 KPI.KPI_ERROR2; 2686 KPI.KPI_ERRORMERGE; 0 KPI.KPI_MERGEOUT; 362669 KPI.KPI_OUT; 125873 The derby database has been started with the following parameters CMD="java -Dderby.system.home=$DERBY_OPTS -Dderby.locks.monitor=true -Dderby.locks.deadlockTrace=true -Dderby.locks.escalationThreshold=50000 -Dderby.locks.waitTimeout= -1 -Dderby.storage.pageCacheSize=100000 -Xms512M -Xmx3072M -XX:NewSize=256M -classpath $DERBY_CLASSPATH org.apache.derby.drda.NetworkServerControl start -h $KPIDERBYHOST -p $DERBY_KPI_PORT" The corrupted database tar (filesystem) in live environment was moved to a test system (Solaris system) and few checks were run on the corrupted DB as part of analysis (DB does start fine) While trying to insert a row in any table expect KPI.KPI_MERGEIN, it is successful. But when a new row is inserted into KPI.KPI_MERGEIN table using command line tool it's throwing below error message (the same message that appeared in live ij> INSERT INTO KPI.KPI_MERGEIN (A0_TXN_ID, A1_NE_ID, A2_CHU_IP_ADDR, A3_BATCH_DATE,A5_CODE) VALUES (-1, 'BMTDE', '192.2.1.3', 231456879, 'KSD'); ERROR 08006: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message and in derby.log file it shows below error stacktrace. ERROR XSDG0: Page Page(51919,Container(0, 1104)) could not be read from disk. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source) at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.initPage(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.newPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainer.addPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.addPage(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) Caused by: java.io.EOFException: Reached end of file while attempting to read a whole page. at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source) ... 20 more ============= begin nested exception, level (1) =========== java.io.EOFException: Reached end of file while attempting to read a whole page. at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source) at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.initPage(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.newPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainer.addPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.addPage(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) ============= end nested exception, level (1) =========== 2011-05-16 10:37:21.392 GMT: Shutting down instance a816c00e-012f-f85f-7892-ffff874c3ff6 ---------------------------------------------------------------- Cleanup action completed The problem is only with INSERT statement. When i try SELECT statement on KPI.KPI_MERGEIN table it is working well.The database file system size (in seg0) is 1.3 GB Can anyone help me out in identifying the problem that why for one table alone its throwing the above error message ? Would upgrade to a new version help ?

    Apache's JIRA Issue Tracker | 6 years ago | Varma R
    java.sql.BatchUpdateException: Page Page(41494,Container(0, 2128)) could not be read from disk.
  2. 0

    HiveTap is not concurrency safe.

    GitHub | 2 years ago | stephanh
    java.sql.BatchUpdateException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'UNIQUE_DATABASE' defined on 'DBS'.
  3. 0

    Derby foreign key constraint

    Stack Overflow | 3 years ago | puk
    java.sql.BatchUpdateException: Syntax error: Encountered "fk_cat_id" at line 2, column 119.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    WAS crashes when running large number of publishers and subscribers

    Google Groups | 8 years ago | Shashikanth Rao T
    java.sql.BatchUpdateException: Java exception: ': java.lang.OutOfMemoryError'.
  6. 0

    One of the derby database table "gets corrupted"/"indicates connection not available" during processing inserts from java client application as shown in the trace and the only way to recover from this error is to rebuild the DB - by deleting the data and creating the tables again. This happens once in a while (thrice in a span of two months) and the java application (run in multiple servers), which updates the database, processes around 100 million transactions per hour (in total and each transation results in 4-5 updates to the DB) There are eight tables in the derby database. TABLE NAME ROWS COUNT (at time of corruption) --------------------------------------------------------------------------------- KPI.KPI_MERGEIN; 362917 KPI.KPI_IN; 422508 KPI.KPI_DROPPED; 53667 KPI.KPI_ERROR1; 0 KPI.KPI_ERROR2; 2686 KPI.KPI_ERRORMERGE; 0 KPI.KPI_MERGEOUT; 362669 KPI.KPI_OUT; 125873 The derby database has been started with the following parameters CMD="java -Dderby.system.home=$DERBY_OPTS -Dderby.locks.monitor=true -Dderby.locks.deadlockTrace=true -Dderby.locks.escalationThreshold=50000 -Dderby.locks.waitTimeout= -1 -Dderby.storage.pageCacheSize=100000 -Xms512M -Xmx3072M -XX:NewSize=256M -classpath $DERBY_CLASSPATH org.apache.derby.drda.NetworkServerControl start -h $KPIDERBYHOST -p $DERBY_KPI_PORT" The corrupted database tar (filesystem) in live environment was moved to a test system (Solaris system) and few checks were run on the corrupted DB as part of analysis (DB does start fine) While trying to insert a row in any table expect KPI.KPI_MERGEIN, it is successful. But when a new row is inserted into KPI.KPI_MERGEIN table using command line tool it's throwing below error message (the same message that appeared in live ij> INSERT INTO KPI.KPI_MERGEIN (A0_TXN_ID, A1_NE_ID, A2_CHU_IP_ADDR, A3_BATCH_DATE,A5_CODE) VALUES (-1, 'BMTDE', '192.2.1.3', 231456879, 'KSD'); ERROR 08006: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message and in derby.log file it shows below error stacktrace. ERROR XSDG0: Page Page(51919,Container(0, 1104)) could not be read from disk. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source) at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.initPage(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.newPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainer.addPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.addPage(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) Caused by: java.io.EOFException: Reached end of file while attempting to read a whole page. at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source) ... 20 more ============= begin nested exception, level (1) =========== java.io.EOFException: Reached end of file while attempting to read a whole page. at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source) at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source) at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source) at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.initPage(Unknown Source) at org.apache.derby.impl.store.raw.data.FileContainer.newPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainer.addPage(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.addPage(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(Unknown Source) at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) ============= end nested exception, level (1) =========== 2011-05-16 10:37:21.392 GMT: Shutting down instance a816c00e-012f-f85f-7892-ffff874c3ff6 ---------------------------------------------------------------- Cleanup action completed The problem is only with INSERT statement. When i try SELECT statement on KPI.KPI_MERGEIN table it is working well.The database file system size (in seg0) is 1.3 GB Can anyone help me out in identifying the problem that why for one table alone its throwing the above error message ? Would upgrade to a new version help ?

    Apache's JIRA Issue Tracker | 6 years ago | Varma R
    java.sql.SQLException: Page Page(10219,Container(0, 1168)) could not be read from disk.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.EOFException

      Reached end of file while attempting to read a whole page.

      at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull()
    2. Derby
      EmbedStatement.executeBatch
      1. org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(RAFContainer4.java:1165)
      2. org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(RAFContainer4.java:429)
      3. org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(RAFContainer4.java:369)
      4. org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(RAFContainer4.java:263)
      5. org.apache.derby.impl.store.raw.data.CachedPage.readPage(CachedPage.java:673)
      6. org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(CachedPage.java:193)
      7. org.apache.derby.impl.services.cache.ConcurrentCache.find(ConcurrentCache.java:295)
      8. org.apache.derby.impl.store.raw.data.FileContainer.initPage(FileContainer.java:2431)
      9. org.apache.derby.impl.store.raw.data.FileContainer.newPage(FileContainer.java:1879)
      10. org.apache.derby.impl.store.raw.data.BaseContainer.addPage(BaseContainer.java:314)
      11. org.apache.derby.impl.store.raw.data.BaseContainerHandle.addPage(BaseContainerHandle.java:183)
      12. org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:302)
      13. org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(HeapController.java:599)
      14. org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:452)
      15. org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028)
      16. org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505)
      17. org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:438)
      18. org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:319)
      19. org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
      20. org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeBatchElement(EmbedPreparedStatement.java:1040)
      21. org.apache.derby.impl.jdbc.EmbedStatement.executeBatch(EmbedStatement.java:984)
      21 frames
    3. com.idelji.operations
      CPUProcessCommunicator.run
      1. com.idelji.operations.iasset.plugin.imon.dao.ProcessDAO.insertData(ProcessDAO.java:142)
      2. com.idelji.operations.iasset.plugin.imon.comm.CPUProcessDataStoreWriter.onData(CPUProcessDataStoreWriter.java:56)
      3. com.idelji.operations.iasset.plugin.imon.handler.CPUProcessDataHandler.gotData(CPUProcessDataHandler.java:205)
      4. com.idelji.operations.ibase.core.comm.Connector.makeRequest(Connector.java:83)
      5. com.idelji.operations.ibase.core.comm.EntityConnector.makeRequest(EntityConnector.java:36)
      6. com.idelji.operations.iasset.plugin.imon.comm.CPUProcessCommunicator.run(CPUProcessCommunicator.java:98)
      6 frames