H2 error: The database has been closed

34 views
Skip to first unread message

Adrien DEFOSSÉ

unread,
Nov 28, 2022, 11:19:12 AM11/28/22
to go-cd
Hi,

Since a few weeks, we have got a recurring problem with our GoCD server. Some times, it restart with the error:

org.h2.jdbc.JdbcSQLNonTransientConnectionException: The database has been closed [90098-200]

In the last two weeks, it already happened three times. We tried to add more memory to our service (a swarm service) but it doesn't seems to resolve anything.

I didn't see anyone with the same problem. Some advice?

Thanks a lot.

Chad Wilson

unread,
Dec 2, 2022, 10:31:32 AM12/2/22
to go...@googlegroups.com
You might want to check the full stack trace for other errors that might be happening before this, which might indicate corruption, and share those too. Sometimes errors about the DB being closed are the end result another failure, but not the root cause.

Other than that
  • What size is your H2 database on disk?
  • Which GoCD version are you running?

If it's very large (multiple GB) and/or there are other errors in the stack traces that indicate something like H2 DB corruption you might want to consider trying exporting the DB and re-importing it to a fresh DB. There's a guideline of how to do this at https://gist.github.com/arvindsv/c7934bee26ce1c47e9d24f0a493d3c87 if you want to give it a go.

-Chad

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/0728fa08-d408-4006-bb5f-787f7c3525b0n%40googlegroups.com.

Adrien DEFOSSÉ

unread,
Dec 5, 2022, 2:27:30 AM12/5/22
to go-cd
Hi,
Actually we've found out two errors that might explain our problem: 

jvm 2    | [332115.956s][warning][gc,alloc] MVStore background writer nio:/godata/db/h2db/cruise.mv.db: Retried waiting for GCLocker too often allocating 256 words
jvm 2    | [332115.976s][warning][gc,alloc] MVStore background writer nio:/godata/db/h2db/cruise.mv.db: Retried waiting for GCLocker too often allocating 4 words
[...]
jvm 2    | Caused by: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Out of memory.; SQL statement:

When examining the configuration, we think we'v found an error in our configuration that makes us use a heap memory of 1Go instead of 10Go. We've change the config and now, well wait and see...

As for your questions:
  • Our cruise.mv.db is 1.6Gb
  • We're on GoD 22.2.0
Thanks a lot

Chad Wilson

unread,
Dec 5, 2022, 3:46:57 AM12/5/22
to go...@googlegroups.com
OK - sounds good. Yeah, more memory will help given the additional errors you mention there.

Reply all
Reply to author
Forward
0 new messages