theotherp / nzbhydra2

Usenet meta search
Other
1.23k stars 75 forks source link

every time there is an update, NZBHydra2 fails to start #429

Open therealmrzippy opened 5 years ago

therealmrzippy commented 5 years ago

Everytime there is an update, I have to delete NZBHydra2 and "reinstall" it and restore a backup. The restore works, and I'm ok.. but this repeats over and over every time. My DB isn't that big.. (132 MB) so I am confused as to what is constantly causing this issue. It's a relatively new install (moved it to a new machine awhile back) on windows.

This has been going for some time.. since.. 2.5.5

SBBH commented 5 years ago

The same thing has happened to me as well the last 4 times it's updated. Seems to be an issue with the database file (nzbhydra.mv.db). Seems like the database is getting optimized during the update which corrupts it or something. A simple restore of nzbhydra.mv.db from the backup allows the service to restart.

theotherp commented 5 years ago

Can you successfully restart Hydra? What do the log files say after the backup? What exactly is happening (or not happening)? Does it not shut down? Does it not get back up?

SBBH commented 5 years ago

I don't have the log files anymore so can't give you those and I just tried a manual update from 2.6.14 to 2.6.16 and it went fine. But, next time it happens I will post the logs.

What was happening though was that the service wouldn't come back up after an update and the db file would also be around 50 to 60 times the size it was before the update. A simple restore of nzbhydra.mv.db from the backup allowed the service to start and all would be fine after.

I remember these two errors as I still have them in my search history ... in case it helps:

Reading from nio:C:/ProgramData/nzbhydra2/data/database/nzbhydra.mv.db failed; file length 198406144 read length 4096 at 206077382 [1.4.199/1]

Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection

SBBH commented 4 years ago

Just happened again. If I try to access the site it shows the following error:

An error occurred: 500: Internal Server Error

Path: /internalapi/history/searches/forsearching

Message: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection

And this is from the log:

2019-09-25 19:43:33.486 WARN --- [0.0-5076-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper : [Search: 644294, Host: 0:0:0:0:0:0:0:1] SQL Error: 0, SQLState: 90028 2019-09-25 19:43:33.486 ERROR --- [0.0-5076-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper : [Search: 644294, Host: 0:0:0:0:0:0:0:1] HikariPool-1 - Connection is not available, request timed out after 30000ms. 2019-09-25 19:43:33.486 WARN --- [0.0-5076-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper : [Search: 644294, Host: 0:0:0:0:0:0:0:1] SQL Error: 90028, SQLState: 90028 2019-09-25 19:43:33.486 ERROR --- [0.0-5076-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper : [Search: 644294, Host: 0:0:0:0:0:0:0:1] IO Exception: null [90028-199] 2019-09-25 19:43:33.487 ERROR --- [0.0-5076-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : [Search: 644294, Host: 0:0:0:0:0:0:0:1] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection] with root cause

java.io.EOFException: null at org.h2.mvstore.DataUtils.readFully(DataUtils.java:408) at org.h2.mvstore.FileStore.readFully(FileStore.java:98) at org.h2.mvstore.MVStore.readBufferForPage(MVStore.java:1048) at org.h2.mvstore.MVStore.readPage(MVStore.java:2186) at org.h2.mvstore.MVMap.readPage(MVMap.java:554) at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1086) at org.h2.mvstore.Cursor.hasNext(Cursor.java:53) at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:793) at org.h2.mvstore.MVStore.(MVStore.java:401) at org.h2.mvstore.MVStore$Builder.open(MVStore.java:3343) at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:162) at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:95) at org.h2.engine.Database.getPageStore(Database.java:2739) at org.h2.engine.Database.open(Database.java:769) at org.h2.engine.Database.openDatabase(Database.java:319) at org.h2.engine.Database.(Database.java:313) at org.h2.engine.Engine.openSession(Engine.java:69) at org.h2.engine.Engine.openSession(Engine.java:201) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) at org.h2.engine.Engine.createSession(Engine.java:161) at org.h2.engine.Engine.createSession(Engine.java:31) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:169) at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:148) at org.h2.Driver.connect(Driver.java:69) at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136) at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369) at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198) at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467) at com.zaxxer.hikari.pool.HikariPool.access$100(HikariPool.java:71) at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:706) at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:692) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Alamei commented 4 years ago

I'm running into the same error with Hydra failing to start after updating. It completes the update properly and shuts down, but it fails to migrate the database when it starts back up and throws that SQL Error 90028. I found that I don't need to reinstall Hydra to fix anything; I just stop the Hydra service, manually restore the database backup that was taken right before the update (dragging the files over), and start it back up, so it's not much trouble, but I wanted to corroborate SBBH's reports.

CollinChaffin commented 4 years ago

Same here latest windows version (10-06). EVERY restart results in the above posted JDBC error. Only option to even restart it is to first open taskmgr, kill the lingering nzbhydra 2 tasks (since the DB fails to mount), restore last successful db backup (not yml) (which now results in losing weeks of data) and then nzbhydra starts fine. But again, since that last couple versions of the db updates (the rollback) something now causes every single shutdown to corrupt the db.

theotherp commented 4 years ago

@CollinChaffin The automatic update should be executed every sunday.

Please upload your debug infos ZIP.

CollinChaffin commented 4 years ago

I'm already updated to the latest build. I'll work on collecting debug zips but it's the exact same issue as the multiple folks above have also experienced. Thanks!