Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Database: JIRA couldn't connect to your database

Naresh Mishra
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 23, 2019

Screenshot from 2019-09-23 14-54-32.png

2019-09-23 14:18:39,170 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /home/apps/atlassian/application-data/jira/dbconfig.xml
2019-09-23 14:18:39,454 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
org.h2.jdbc.JdbcSQLException: IO Exception: "/home/apps/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:48)
at com.atlassian.jira.startup.DefaultJiraLauncher.preDbLaunch(DefaultJiraLauncher.java:117)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:103)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:102)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Reading from cache:nio:/home/apps/atlassian/application-data/jira/database/h2db.mv.db failed; file length 132698112 read length 1024 at 138630033 [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.Page.getChildPage(Page.java:216)
at org.h2.mvstore.Cursor.fetchNext(Cursor.java:150)
at org.h2.mvstore.Cursor.next(Cursor.java:50)
at org.h2.mvstore.MVStore.readFileHeader(MVStore.java:696)
at org.h2.mvstore.MVStore.<init>(MVStore.java:357)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2769)
at org.h2.mvstore.db.MVTableEngine$Store.<init>(MVTableEngine.java:162)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:98)
... 44 more
Caused by: java.io.EOFException
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:431)
... 56 more
2019-09-23 14:18:39,479 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2019-09-23 14:18:39,479 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.

2019-09-23 14:18:39,482 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2019-09-23 14:18:39,482 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2019-09-23 14:18:39,533 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 306 MiB. Committed: 908 MiB. Max: 2020 MiB
Non-heap memory : Used: 45 MiB. Committed: 64 MiB. Max: 1536 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 351 MiB. Committed: 972 MiB. Max: 3556 MiB
---------------------------------------------------------------------------------

 

2 answers

1 vote
Nic Brough -Adaptavist-
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.
September 23, 2019

This message in the log is the key:

>IO Exception: "/home/apps/atlassian/application-data/jira/database/h2db.mv.db"

This means either that the database file (h2 is a file based database loaded into memory at run time) is

  • locked by another process
  • has the wrong ownership and/or permissions
  • damaged, and too badly damaged to be read

Use "lsof" to check the first, "ls" to check the second (check all the files in that directory, and the directory itself), and check that you have plenty of disk space free (with "df").

  If it is the last option, then there is very little chance that you will be able to fix it.  H2 is not suitable for long term operation of Jira, only for demos and a bit of testing, and only for smaller systems.  When it fails, it often fails really badly, and the only "fix" is "install a new Jira and import an export from a backup (see the "export" directory in the jira home directory)

0 votes
PVS
Banned
September 23, 2019

Hi @Naresh Mishra 

 

First You Will Up the database after  You Will Do this Steps

 

First You Will Shutdown Jira And Go to Application Folder And Clear Cache And Delete Lock File Ann Delete  PLugin .osgi-plugins and .bundled-plugins after That Open Data base  Its Running or Not U can check When Its Running U can Restart The jira U Can do Success Fully Doing This that time jira is not Showing the Error That is the .Error  

 

Thanks ,

PVS

Suggest an answer

Log in or Sign up to answer