Database corruption after upgrade to 1.3.176 (from 1.3.169)

130 views
Skip to first unread message

marcolopes

unread,
Jan 11, 2015, 8:01:40 PM1/11/15
to h2-da...@googlegroups.com
Since we upgrade to 1.3.176 (from 1.3.169) in our final product, dozens of users are experiencing problems with damaged databases.

Connection STRING used hasn't changed, and is: jdbc:h2:file:database;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=1

Here are a few logs:

org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: page[35624] data leaf table:206 T206 entries:0 parent:20233 keys:null offsets:null parent 20233 expected 0" [50000-176]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
	at org.h2.message.DbException.get(DbException.java:167)
	at org.h2.message.DbException.convert(DbException.java:294)
	at org.h2.engine.Database.openDatabase(Database.java:291)
	at org.h2.engine.Database.<init>(Database.java:254)
	at org.h2.engine.Engine.openSession(Engine.java:57)
	at org.h2.engine.Engine.openSession(Engine.java:164)
	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
	at org.h2.engine.Engine.createSession(Engine.java:125)
	at org.h2.engine.Engine.createSession(Engine.java:27)
	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:331)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
	at org.h2.Driver.connect(Driver.java:74)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at org.projectocolibri.rcp.colibri.dao.database.connection.ConnectionManager$DRIVERS.checkConnection(ConnectionManager.java:220)
	at org.projectocolibri.rcp.colibri.dao.database.connection.DatabaseParameters.checkConnection(DatabaseParameters.java:76)
	at org.projectocolibri.rcp.colibri.dao.database.ColibriLogin.initialize(ColibriLogin.java:93)
	at org.projectocolibri.rcp.colibri.dao.database.ColibriLogin.process(ColibriLogin.java:60)
	at org.projectocolibri.rcp.colibri.workbench.shells.login.LoginShell$1.widgetSelected(LoginShell.java:178)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.dma.eclipse.swt.custom.CustomShell.openAndSleep(CustomShell.java:47)
	at org.projectocolibri.rcp.colibri.workbench.shells.login.LoginShell.<init>(LoginShell.java:86)
	at org.projectocolibri.rcp.Application.start(Application.java:44)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.RuntimeException: page[35624] data leaf table:206 T206 entries:0 parent:20233 keys:null offsets:null parent 20233 expected 0
	at org.h2.message.DbException.throwInternalError(DbException.java:241)
	at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:247)
	at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:87)
	at org.h2.table.RegularTable.<init>(RegularTable.java:84)
	at org.h2.store.PageStore.addMeta(PageStore.java:1693)
	at org.h2.store.PageStore.redo(PageStore.java:1563)
	at org.h2.store.PageLog.recover(PageLog.java:329)
	at org.h2.store.PageStore.recover(PageStore.java:1407)
	at org.h2.store.PageStore.openExisting(PageStore.java:368)
	at org.h2.store.PageStore.open(PageStore.java:289)
	at org.h2.engine.Database.getPageStore(Database.java:2366)
	at org.h2.engine.Database.open(Database.java:657)
	at org.h2.engine.Database.openDatabase(Database.java:260)
	... 37 more

org.h2.jdbc.JdbcSQLException: File corrupted while reading record: "[10934] stream data key:2262 pos:11 remaining:0". Possible solution: use the recovery tool [90030-176]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    at org.h2.message.DbException.get(DbException.java:178)
    at org.h2.message.DbException.get(DbException.java:154)
    at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:242)
    at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:215)
    at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:88)
    at org.h2.table.RegularTable.<init>(RegularTable.java:84)
    at org.h2.store.PageStore.addMeta(PageStore.java:1693)
    at org.h2.store.PageStore.readMetaData(PageStore.java:1624)
    at org.h2.store.PageStore.recover(PageStore.java:1406)
    at org.h2.store.PageStore.openExisting(PageStore.java:368)
    at org.h2.store.PageStore.open(PageStore.java:289)
    at org.h2.engine.Database.getPageStore(Database.java:2366)
    at org.h2.engine.Database.open(Database.java:657)
    at org.h2.engine.Database.openDatabase(Database.java:260)
    at org.h2.engine.Database.<init>(Database.java:254)
    at org.h2.engine.Engine.openSession(Engine.java:57)
    at org.h2.engine.Engine.openSession(Engine.java:164)
    at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
    at org.h2.engine.Engine.createSession(Engine.java:125)
    at org.h2.engine.Engine.createSession(Engine.java:27)
    at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:331)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
    at org.h2.Driver.connect(Driver.java:74)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:215)

Can you advise to REVERT to 1.3.169 or UPGRADE to 1.4.x (which one?). I would prefer to revert.

marcolopes

unread,
Jan 11, 2015, 8:30:39 PM1/11/15
to h2-da...@googlegroups.com
Correction:

With 1.3.169, connection string was: jdbc:h2:file:database

With 1.3.176, connection string is: Connection STRING used hasn't changed, and is: jdbc:h2:file:database;TRACE_
LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=1

But i believe that avoiding the creation of the TRACE FILE has absolutely nothing to do with this problem...

Thomas Mueller

unread,
Jan 14, 2015, 1:48:32 AM1/14/15
to H2 Google Group
Hi,

I can't say what the problem might be, but reverting to 1.3.169 should be possible. But it might make sense to re-create the database, by first creating a SQL script, then dropping the database, and re-creating it from the SQL script.

avoiding the creation of the TRACE FILE has absolutely nothing to do with this problem

I agree.

Regards,
Thomas



--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Rinse Lemstra

unread,
Jan 15, 2015, 1:03:19 PM1/15/15
to h2-da...@googlegroups.com
Today put a new version of our product live, containing 1.4.184 in a AUTO_SERVER scenario.  Got serveral exceptions not seen before:

Caused by: org.h2.jdbc.JdbcSQLException: Error opening database: \"Concurrent update\" [8000-184]
org.h2.store.FileLock.getExceptionFatal(Unknown Source)
org.h2.store.FileLock.lockFile(Unknown Source)
org.h2.store.FileLock.lock(Unknown Source)
org.h2.engine.Database.open(Unknown Source)
org.h2.engine.Database.openDatabase(Unknown Source)
org.h2.engine.Database.<init>(Unknown Source)
org.h2.engine.Engine.openSession(Unknown Source)
org.h2.engine.Engine.openSession(Unknown Source)
org.h2.engine.Engine.<unknown>(Unknown Source)
org.h2.engine.Engine.createSession(Unknown Source)
org.h2.engine.Engine.<unknown>(Unknown Source)
org.h2.engine.SessionRemote.connectEmbeddedOrServer(Unknown Source)
org.h2.jdbc.JdbcConnection.<init>(Unknown Source)
org.h2.jdbc.JdbcConnection.<unknown>(Unknown Source)
org.h2.Driver.connect(Unknown Source)


Maybe it helps to find the reason for this problems.

We decided to revert to some previous version.

regards,

Rinse


Op maandag 12 januari 2015 02:01:40 UTC+1 schreef marcolopes:

Thomas Mueller

unread,
Mar 10, 2015, 2:46:07 AM3/10/15
to h2-da...@googlegroups.com
Hi,

The "FileLock" is the mechanism to ensure only one process accesses the database file. If there is a "concurrent update" exception, the problem is most likely a file system that is not supported by this mechanism. 

I think operating system file level locking is required, and the FileLock mechanism can't be used for this case.

Regards,
Thomas
--
Reply all
Reply to author
Forward
0 new messages