ESIPFed / Geoweaver

boost data pipeline's tangibility, enhance research productivity, reduce work anxiety
https://geoweaver.dev
MIT License
80 stars 42 forks source link

Hopper and multiple login node issue #564

Closed JYOSHREDDY closed 1 month ago

JYOSHREDDY commented 1 month ago
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "org.h2.mvstore.MVStoreException: Reading from file sun.nio.ch.FileChannelImpl@4446cae0 failed at 63592321 (length -1), read 0, remaining 384 [2.2.224/1]"; SQL statement:
select gwprocess0_.id as id1_1_, gwprocess0_.code as code2_1_, gwprocess0_.confidential as confiden3_1_, gwprocess0_.description as descript4_1_, gwprocess0_.lang as lang5_1_, gwprocess0_.name as name6_1_, gwprocess0_.owner as owner7_1_ from gwprocess gwprocess0_ [50000-224]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:566)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
    at org.h2.message.DbException.get(DbException.java:212)
    at org.h2.message.DbException.convert(DbException.java:407)
    at org.h2.command.Command.executeQuery(Command.java:213)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:355)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:191)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.h2.mvstore.MVStoreException: Reading from file sun.nio.ch.FileChannelImpl@4446cae0 failed at 63592321 (length -1), read 0, remaining 384 [2.2.224/1]
    at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996)
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:455)
    at org.h2.mvstore.FileStore.readFully(FileStore.java:719)
    at org.h2.mvstore.SingleFileStore.readFully(SingleFileStore.java:60)
    at org.h2.mvstore.SingleFileStore.readFully(SingleFileStore.java:28)
    at org.h2.mvstore.SFChunk.readFully(SFChunk.java:35)
    at org.h2.mvstore.Chunk.readBufferForPage(Chunk.java:465)
    at org.h2.mvstore.FileStore.readPage(FileStore.java:1960)
    at org.h2.mvstore.MVStore.readPage(MVStore.java:1021)
    at org.h2.mvstore.MVMap.readPage(MVMap.java:632)
    at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1117)
    at org.h2.mvstore.CursorPos.traverseDown(CursorPos.java:61)
    at org.h2.mvstore.Cursor.traverseDown(Cursor.java:169)
    at org.h2.mvstore.Cursor.<init>(Cursor.java:40)
    at org.h2.mvstore.MVMap.cursor(MVMap.java:730)
    at org.h2.mvstore.tx.TransactionMap$TMIterator.<init>(TransactionMap.java:1108)
    at org.h2.mvstore.tx.TransactionMap$CommittedIterator.<init>(TransactionMap.java:955)
    at org.h2.mvstore.tx.TransactionMap.chooseIterator(TransactionMap.java:872)
    at org.h2.mvstore.tx.TransactionMap.entryIterator(TransactionMap.java:856)
    at org.h2.mvstore.db.MVPrimaryIndex.find(MVPrimaryIndex.java:373)
    at org.h2.mvstore.db.MVPrimaryIndex.find(MVPrimaryIndex.java:235)
    at org.h2.index.IndexCursor.find(IndexCursor.java:166)
    at org.h2.table.TableFilter.next(TableFilter.java:394)
    at org.h2.command.query.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1843)
    at org.h2.result.LazyResult.hasNext(LazyResult.java:78)
    at org.h2.result.FetchedResult.next(FetchedResult.java:34)
    at org.h2.command.query.Select.queryFlat(Select.java:728)
    at org.h2.command.query.Select.queryWithoutCache(Select.java:833)
    at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197)
    at org.h2.command.query.Query.query(Query.java:520)
    at org.h2.command.query.Query.query(Query.java:483)
    at org.h2.command.CommandContainer.query(CommandContainer.java:252)
    at org.h2.command.Command.executeQuery(Command.java:192)
    ... 3 more
Caused by: java.io.IOException: Stale file handle
    at java.base/sun.nio.ch.FileDispatcherImpl.pread0(Native Method)
    at java.base/sun.nio.ch.FileDispatcherImpl.pread(FileDispatcherImpl.java:54)
    at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:274)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:245)
    at java.base/sun.nio.ch.FileChannelImpl.readInternal(FileChannelImpl.java:811)
    at java.base/sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:796)
    at org.h2.mvstore.DataUtils.readFully(DataUtils.java:441)
    ... 34 more

    at org.h2.message.DbException.getJdbcSQLException(DbException.java:566)
    at org.h2.engine.SessionRemote.readException(SessionRemote.java:650)
    at org.h2.engine.SessionRemote.done(SessionRemote.java:619)
    at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:177)
    at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:131)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
    ... 57 more
JYOSHREDDY commented 1 month ago

The temporary solution is to change the H2 database by adding $HOME/geoweaver/application.properties and overwrite the H2 database file to another folder, and reimport all the data using SQL file exportation and importation.

(base) joe@jS-M1 ~ % cat geoweaver/application.properties
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.event.merge.entity_copy_observer=allow
spring.datasource.url=jdbc:h2:file:~/h2_hopper/gw;AUTO_SERVER=true;INIT=create domain if not
exists
jsonb as text
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=geoweaver
spring.datasource.password=DFKHH9V6ME
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.h2.console.path=/h2_console
ZihengSun commented 1 month ago

In this case, should either use more production ready database like PostgreSQL, or need to fix the login node IP by always using the same node to login via IP address. Don't trust your hopper domain login URL.