efmarshall / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

General error: java.lang.IllegalStateException #587

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Server blue screened in the middle of an h2 bulk csvread, after booting back up 
the database is unable to be opened. Full message is this:

General error: "java.lang.IllegalStateException: Illegal page length -1582525 
reading at 8928978365; file size 8927395840  [1.4.181/6]" [50000-181] 
HY000/50000 (Help)

This is the beta version of 1.4. Anything I can do to get this data back?

Original issue reported on code.google.com by localde...@gmail.com on 4 Oct 2014 at 1:03

GoogleCodeExporter commented 9 years ago
You could use the Recover tool.

However, in theory the database should not get into this state. Could you send 
it to me (via email)?

Original comment by thomas.t...@gmail.com on 4 Oct 2014 at 8:54

GoogleCodeExporter commented 9 years ago
This database is currently 8 gigs, I'm not sure I have permission to hand it 
out though. I've made a copy of the file so that I can do further testing if 
required, but this copy of the database is no longer needed (reinserted the 
data with a new / empty database). I would like to help fix this bug though so 
that it doesn't continue to show up in the future. 

Is there any code or diagnositc utilities I can run on the file and then send 
that data to you? 

Original comment by localde...@gmail.com on 7 Oct 2014 at 3:16

GoogleCodeExporter commented 9 years ago
You could check if there is a <databaseName>.lock.db file (it's a text file), 
and verify if there are any exceptions or messages. Also, you could run the 
Recover tool and send me the <databaseName>.mv.txt (compressed)

Original comment by thomas.t...@gmail.com on 22 Oct 2014 at 6:48

GoogleCodeExporter commented 9 years ago
I attempted to run the recovery tool on the corrupted database, it threw the 
following stacktrace:

Exception in thread "main" java.lang.IllegalArgumentException
        at java.nio.Buffer.position(Unknown Source)
        at org.h2.mvstore.MVStoreTool.dump(MVStoreTool.java:136)
        at org.h2.tools.Recover.process(Recover.java:327)
        at org.h2.tools.Recover.runTool(Recover.java:192)
        at org.h2.tools.Recover.main(Recover.java:155)

This is using h2-1.4.181 (same version of h2 that was used initially to create 
/ serve the database that became corrupted).

It did manage to fill a 848 meg txt file with data in it before it threw the 
exception, but I'm not able to send the whole file. I can send the last portion 
(possibly) if that helps.

Original comment by localde...@gmail.com on 11 Nov 2014 at 8:11

GoogleCodeExporter commented 9 years ago
The IllegalArgumentException is now fixed in the trunk. But I'm afraid I can't 
help in another way currently. Could you download the H2 trunk yourself, 
compile it, and then run MVStoreTool.dump again?

Original comment by thomas.t...@gmail.com on 14 Nov 2014 at 8:51

GoogleCodeExporter commented 9 years ago
Should be fixed in todays release. Could you try again with todays release?

Original comment by thomas.t...@gmail.com on 13 Dec 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Hi, I have an corrupted database that shows the same error. What can I do to 
recoer it?

Original comment by danielba...@gmail.com on 13 Jan 2015 at 7:39

GoogleCodeExporter commented 9 years ago
You could use the Recover tool to retrieve the data.

Original comment by thomas.t...@gmail.com on 14 Jan 2015 at 6:49

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 14 Jan 2015 at 6:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes thomas, that was what I thought.. but this exception is shown when I run 
the Recover tool.

daniel.bathke@desktop:~/Downloads/database$ java -cp ../h2*.jar 
org.h2.tools.Recover -trace -transactionLog -db "xxxxxx"
Created file: .......mv.txt
Created file: .......h2.sql
Error: java.lang.IllegalStateException: Reading from cache:nio:........mv.db 
failed; file length 14348288 read length 192 at 14355028 [1.4.184/1]
java.lang.IllegalStateException: Reading from cache:nio:.........mv.db failed; 
file length 14348288 read length 192 at 14355028 [1.4.184/1]
    at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:774)
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:443)
    at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
    at org.h2.mvstore.Page.read(Page.java:189)
    at org.h2.mvstore.MVStore.readPage(MVStore.java:1830)
    at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
    at org.h2.mvstore.MVMap.setRootPos(MVMap.java:746)
    at org.h2.mvstore.MVStore.openMap(MVStore.java:475)
    at org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:373)
    at org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:726)
    at org.h2.tools.Recover.dumpMVStoreFile(Recover.java:609)
    at org.h2.tools.Recover.process(Recover.java:331)
    at org.h2.tools.Recover.runTool(Recover.java:192)
    at org.h2.tools.Recover.main(Recover.java:155)
Caused by: java.io.EOFException
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:431)
    ... 12 more

Original comment by danielba...@gmail.com on 14 Jan 2015 at 10:21

GoogleCodeExporter commented 9 years ago
I see. I'm afraid that it is not possible to retrieve the data with a 
reasonable amount of work then.

Original comment by thomas.t...@gmail.com on 15 Jan 2015 at 7:06

GoogleCodeExporter commented 9 years ago
Should be fixed with version 1.4.185

Original comment by thomas.t...@gmail.com on 16 Jan 2015 at 5:16

GoogleCodeExporter commented 9 years ago
Can I get the trunk code and test it?

Original comment by danielba...@gmail.com on 16 Jan 2015 at 5:21

GoogleCodeExporter commented 9 years ago
You can do that (see the "source" tab), but you can also test with the latest 
official download.

Original comment by thomas.t...@gmail.com on 17 Jan 2015 at 1:55

GoogleCodeExporter commented 9 years ago
Ok. Will do that now.

Original comment by danielba...@gmail.com on 19 Jan 2015 at 11:43

GoogleCodeExporter commented 9 years ago
Same error dude. :/

Error: java.lang.IllegalStateException: Reading from 
cache:nio:xxxxxxxxxxxxxx.mv.db failed; file length 14348288 read length 192 at 
14355028 [1.4.185/1]
java.lang.IllegalStateException: Reading from cache:nio:xxxxxxxxxxxxx.mv.db 
failed; file length 14348288 read length 192 at 14355028 [1.4.185/1]
    at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:443)
    at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
    at org.h2.mvstore.Page.read(Page.java:189)
    at org.h2.mvstore.MVStore.readPage(MVStore.java:1830)
    at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
    at org.h2.mvstore.MVMap.setRootPos(MVMap.java:746)
    at org.h2.mvstore.MVStore.openMap(MVStore.java:475)
    at org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:373)
    at org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:726)
    at org.h2.tools.Recover.dumpMVStoreFile(Recover.java:609)
    at org.h2.tools.Recover.process(Recover.java:331)
    at org.h2.tools.Recover.runTool(Recover.java:192)
    at org.h2.tools.Recover.main(Recover.java:155)
Caused by: java.io.EOFException
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:431)
    ... 12 more

Original comment by danielba...@gmail.com on 19 Jan 2015 at 12:16

GoogleCodeExporter commented 9 years ago
This is an old file that is already corrupt, right? The new version can not fix 
that, it can only prevent that you get new corruptions (with a new database).

Original comment by thomas.t...@gmail.com on 19 Jan 2015 at 12:29

GoogleCodeExporter commented 9 years ago
This happend with newest H2 version i got and updated programs. h2-1.4.187.jar

In 3 Days i renewed ~200 client programs, same happend to at least 5

04-28 16:53:35 database: flush
org.h2.message.DbException: General error: "java.lang.IllegalStateException: 
Reading from cache:nio:/home/gmps/mobile/database/localDb_v3.66.mv.db failed; 
file length 589824 read length 384 at 639611 [1.4.187/1]" [50000-187]
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.message.DbException.convert(DbException.java:295)
        at org.h2.mvstore.db.MVTableEngine$1.uncaughtException(MVTableEngine.java:93)
        at org.h2.mvstore.MVStore.panic(MVStore.java:368)
        at org.h2.mvstore.MVStore.<init>(MVStore.java:351)
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2782)
        at org.h2.mvstore.db.MVTableEngine$Store.<init>(MVTableEngine.java:162)
        at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:98)
        at org.h2.engine.Database.getPageStore(Database.java:2389)
        at org.h2.engine.Database.open(Database.java:669)
        at org.h2.engine.Database.openDatabase(Database.java:266)
        at org.h2.engine.Database.<init>(Database.java:260)
        at org.h2.engine.Engine.openSession(Engine.java:60)
        at org.h2.engine.Engine.openSession(Engine.java:167)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:145)
        at org.h2.engine.Engine.createSession(Engine.java:128)
        at org.h2.engine.Engine.createSession(Engine.java:26)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:347)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:108)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:92)
        at org.h2.Driver.connect(Driver.java:72)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at lt.dekbera.mobileClient.model.dBservice.H2localDb.connectToDB(H2localDb.java:981)
        at lt.dekbera.mobileClient.model.dBservice.H2localDb.connectToDB(H2localDb.java:987)
        at lt.dekbera.mobileClient.model.dBservice.H2localDb.<init>(H2localDb.java:40)
        at lt.dekbera.mobileClient.DataManager.<init>(DataManager.java:103)
        at lt.dekbera.mobileClient.MobileClientUIService.initNewModules(MobileClientUIService.java:525)
        at lt.dekbera.mobileClient.MobileClientUIService.<init>(MobileClientUIService.java:72)
        at lt.dekbera.mobileClient.MobileClient.initService(MobileClient.java:64)
        at lt.dekbera.mobileClient.MobileClient.start(MobileClient.java:44)
        at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication$3$1.run(Unknown Source)

Original comment by Osvaldas...@gmail.com on 29 Apr 2015 at 9:31

GoogleCodeExporter commented 9 years ago
Hi,

Could you please use the Google Group? This issue is set to fixed, and Google 
Code is no longer used.

Original comment by thomas.t...@gmail.com on 29 Apr 2015 at 9:53