Error connecting to database

kapil kinikar August 20, 2018

I have installed Jira instance on server VM machine in Jan 2018.  I am using Jira since January 2018 for project tracking purpose. settings as per follow.

1. Configured in built database.

If I navigate to Jira URL it shows me database connection error message.

Please suggest workaround.

Thanks 

Kapil

1 answer

0 votes
Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2018

HI @kapil kinikar

Could you please share with us error message or screenshot for the same.

kapil kinikar August 20, 2018

Sure, Please see attached screenshot

Start Up Error.PNG

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2018

HI @kapil kinikar

As mentioned in the error screenshot please check whether the Database is running or not and the confirm that have you been provided database details are correct?

kapil kinikar August 21, 2018

Thanks for the reply.

We are using Inbuilt jira Database, so how do I confirm that database is running?

I haven't set any username or password at the time of configuration in the server.xml file.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 21, 2018

The built-in database does not "run", it's a file and memory based system that is read at the time of startup.

The error message suggests that the connection to it is not working, which usually means the database has failed in the case of H2.  You can read the application logs for more, they will usually tell you where there is an error, but if it has failed, it is likely that you have lost a lot of data, and will need to look for a backup (and then moving to a proper database as soon as possible)

kapil kinikar August 21, 2018

Thanks for the reply,

Application log says,

018-08-20 04:18:31,128 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
org.h2.jdbc.JdbcSQLException: IO Exception: "C:/Program Files/Atlassian/Application Data/JIRA/database/h2db.mv.db" [90028-185]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:112)
at org.h2.engine.Database.getPageStore(Database.java:2379)
at org.h2.engine.Database.open(Database.java:666)
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(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatabaseConnection(DefaultAtlassianBootstrapManager.java:347)
at com.atlassian.jira.config.database.JdbcDatasource.getConnection(JdbcDatasource.java:211)
at com.atlassian.jira.config.database.DatabaseConfig.testConnection(DatabaseConfig.java:88)
at com.atlassian.jira.health.checks.DbConfigurationAndConnectionCheck.doPerform(DbConfigurationAndConnectionCheck.java:60)
at com.atlassian.jira.health.HealthCheckTemplate.perform(HealthCheckTemplate.java:23)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.runCheck(DefaultHealthCheckExecutor.java:74)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.lambda$applyAndCollectExceptions$1(DefaultHealthCheckExecutor.java:53)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.applyAndCollectExceptions(DefaultHealthCheckExecutor.java:53)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.performHealthChecks(DefaultHealthCheckExecutor.java:42)
at com.atlassian.jira.health.HealthChecks.executeChecksAndRecordResults(HealthChecks.java:164)
at com.atlassian.jira.health.HealthChecks.runHealthChecks(HealthChecks.java:154)
at com.atlassian.jira.health.HealthChecks.runHealthChecks(HealthChecks.java:66)
at com.atlassian.jira.startup.BootstrapContainerLauncher.start(BootstrapContainerLauncher.java:45)
at com.atlassian.jira.startup.DefaultJiraLauncher.preDbLaunch(DefaultJiraLauncher.java:115)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:101)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:100)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:157)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Could not open file nio:C:/Program Files/Atlassian/Application Data/JIRA/database/h2db.mv.db [1.4.185/1]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
at org.h2.mvstore.FileStore.open(FileStore.java:176)
at org.h2.mvstore.MVStore.<init>(MVStore.java:346)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2769)
at org.h2.mvstore.db.MVTableEngine$Store.<init>(MVTableEngine.java:162)
... 44 more
Caused by: java.nio.channels.ClosedByInterruptException
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:315)
at org.h2.store.fs.FileNio.size(FilePathNio.java:58)
at org.h2.mvstore.cache.FilePathCache$FileCache.size(FilePathCache.java:110)
at org.h2.mvstore.FileStore.open(FileStore.java:174)
2018-08-20 04:18:31,144 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2018-08-20 04:18:31,144 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA failed to establish a connection to your database.
This could be because:
- Your database isn't running
- The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
- There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)

There are several other solutions you can try, review our documentation and see what works for you.

2018-08-20 04:18:31,159 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2018-08-20 04:18:31,159 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2018-08-20 04:18:31,316 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 60 MiB. Committed: 489 MiB. Max: 745 MiB
Non-heap memory : Used: 40 MiB. Committed: 42 MiB. Max: 1264 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 100 MiB. Committed: 530 MiB. Max: 2009 MiB
---------------------------------------------------------------------------------
2018-08-20 04:18:31,316 localhost-startStop-1 INFO [c.a.jira.startup.DefaultJiraLauncher] Stopping launchers
2018-08-20 04:18:31,331 localhost-startStop-1 ERROR [o.a.c.c.C.[Catalina].[localhost].[/]] Exception sending context destroyed event to listener instance of class com.atlassian.jira.startup.LauncherContextListener
java.lang.NullPointerException
at com.atlassian.jira.startup.ClusteringLauncher.stop(ClusteringLauncher.java:46)
at com.atlassian.jira.startup.DefaultJiraLauncher.stop(DefaultJiraLauncher.java:197)
at com.atlassian.jira.startup.LauncherContextListener.contextDestroyed(LauncherContextListener.java:214)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4774)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5411)
... 3 filtered
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Please suggest workaround.

Disha Doshi May 12, 2019

Hi Kapil,

Did you find any solution regarding the issue you mentioned

sumit pandit June 2, 2019

Hi, I am also facing same issue. Our jira server had issue with memory. Drive got full but after expanding drive, we are still getting this issue. I am also using inbuild jira database

Parag Ingale June 3, 2019

I also faced this issues almost each time I installed JIRA SD, and got this error. I spent a lot of time without any luck and ended up re installation. Fortunately, I now take backup of system until I get any solution of this issue. Will look this thread and if I find anything, will post here.

Suggest an answer

Log in or Sign up to answer