jimcoly / 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