Jira couldn't connect to your database. How do I fix this after having tried several things?

Gianni S June 16, 2019

So I've been using Jira Software (version 8.0.2) as a server on my laptop (Windows 10 Home) and it worked fine for 2 months. But now I get this screen when I try to go to my external IP:8080 or localhost:8080 or 127.0.0.1:8080.
I can ping my own external ip just fine and this works as well with localhost, 127.0.0.1 and my LAN IP.
My port 8080 is also open (port forwarded through router).
Jira is also running, firewall still has a rule for Jira Server on port 8080 to allow connection.
I do not know where the dbconfig.xml file is and I don't think that's the issue since I never touched it nor do I know where it is.

So I'm completely lost why Jira software suddenly stopped working. My last option would be to uninstall Jira and reinstall it.

Screenshot_1.png

3 answers

0 votes
brbojorque
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 17, 2019

Hi @Gianni S ,

It looks like you can't connect to the database

Try these few steps to attempt to recover your instance.

  • Recover part of it from a snapshot/windows restore points
  • Check if the backup file is enabled and check if the file was created.
    • C:\Program Files\Atlassian\ApplicationData\Jira\export
  • If you are using other database tools, please make sure they are running in the process.
    • Start Postgres if you are using postgres
    • Start Mysql if you are using mysql.

To remediate the issue moving forward.

  • Install PostgresDB or MySQLDB server in your machine
  • Moving forward use that database instead of H2db.

You should be able to find a lot of tutorials on how to set up the DB in your Jira.

Gianni S June 17, 2019

Thank you for your reply. I am not using any other database tools.

And I checked the export directory and it seems the zip files stop at June 13th.  Though I think they are supposed to update every day? 

Then I guess my 2nd last option or last option would then be to make a new DB.

brbojorque
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 17, 2019

@Gianni S

If the backup file exists then you can proceed installing the database and restore that backup in the Backup and Restore section.

Like Gianni S likes this
0 votes
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2019

Hi @Gianni S ,

 

Welcome to the community. 

Where is your database located? Also on your laptop? Are you using the internal H2 database or something else?

Gianni S June 17, 2019

Thank you. I am using the internal H2 Database according to the dbconfig.xml. I think that's automatically generated by Jira Server since I never specified a database and just run Jira Server. And yes Jira Server runs on my laptop.

0 votes
Johan Soetens _Dumblefy_
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.
June 16, 2019

Hello Gianni,

make sure to have a look at the logs, they can be very helpful in determining the cause.

The dbconfig.xml can be found in your Jira Home directory. Verify how it connects to your DB

Network issues are likely but it depends on how you run this (unsupported) Jira server, you might be doing networking using hosts file, ngrok, VMware, VirtualBox, ...

Gianni S June 17, 2019

Which logs do I look at? The logs in the home directory/log show a lot of log files:

Screenshot_1.png


Also my dbconfig looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>h2</database-type>
<schema-name>PUBLIC</schema-name>
<jdbc-datasource>
<url>jdbc:h2:file:C:\Program Files\Atlassian\Application Data\JIRA/database/h2db</url>
<driver-class>org.h2.Driver</driver-class>
<username>sa</username>
<password></password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<min-evictable-idle-time-millis>4000</min-evictable-idle-time-millis>
<time-between-eviction-runs-millis>5000</time-between-eviction-runs-millis>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
</jdbc-datasource>
</jira-database-config>

 

I think I'm using an automatically generated database by Jira?

Oh and all I do for running the server is 
1. Start Jira Server [8080] (basically run the server on my daily usage laptop)
2. Make exceptions in the firewall/antivirus for Jira server on port 8080
3. Port forward my local ip 
And that should work, however it stopped working due to the error I mentioned in the post.

Johan Soetens _Dumblefy_
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.
June 17, 2019

Have a look in the atlassian-jira.log for more details on the actual cause.

Creating a new DB would mean losing all data.

Gianni S June 18, 2019

Yes, thank you. This is the most recent part of the log (I do not know if you there are spoiler tags or something similar to hide all this text so it doesn't fill up all the screen):

 

2019-06-16 23:55:58,406 localhost-startStop-2 INFO [c.a.jira.startup.DefaultJiraLauncher] Stopping launchers
2019-06-16 23:56:02,771 localhost-startStop-2 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:49)
at com.atlassian.jira.startup.DefaultJiraLauncher.stop(DefaultJiraLauncher.java:200)
at com.atlassian.jira.startup.LauncherContextListener.contextDestroyed(LauncherContextListener.java:211)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4839)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
... 3 filtered
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2019-06-16 23:58:19,906 localhost-startStop-1 INFO [c.a.jira.startup.JiraHomeStartupCheck] The jira.home directory 'C:\Program Files\Atlassian\Application Data\JIRA' is validated and locked for exclusive use by this instance.
2019-06-16 23:58:20,039 localhost-startStop-1 WARN [o.a.catalina.util.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [127] milliseconds.
2019-06-16 23:58:20,059 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger]

****************
JIRA starting...
****************

2019-06-16 23:58:20,191 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger]

___ Environment _____________________________

JIRA Build : 8.0.2#800010-sha1:15b32da7769637cbcbd22ae5eaacbed621a94e22
Build Date : Wed Mar 06 00:00:00 CET 2019
JIRA Installation Type : Standalone
Application Server : Apache Tomcat/8.5.35 - Servlet API 3.1
Java Version : 1.8.0_181 - Oracle Corporation
Current Working Directory : D:\Program Files\Atlassian\JIRA Software
Maximum Allowable Memory : 1820MB
Total Memory : 361MB
Free Memory : 314MB
Used Memory : 47MB
Memory Pool: Code Cache : Code Cache: init = 33554432(32768K) used = 10121088(9883K) committed = 33554432(32768K) max = 536870912(524288K)
Memory Pool: Metaspace : Metaspace: init = 0(0K) used = 22541632(22013K) committed = 23117824(22576K) max = -1(-1K)
Memory Pool: Compressed Class Space : Compressed Class Space: init = 0(0K) used = 2610176(2549K) committed = 2883584(2816K) max = 1073741824(1048576K)
Memory Pool: PS Eden Space : PS Eden Space: init = 100663296(98304K) used = 29561320(28868K) committed = 87031808(84992K) max = 668467200(652800K)
Memory Pool: PS Survivor Space : PS Survivor Space: init = 16777216(16384K) used = 0(0K) committed = 23592960(23040K) max = 23592960(23040K)
Memory Pool: PS Old Gen : PS Old Gen: init = 268435456(262144K) used = 20074992(19604K) committed = 268435456(262144K) max = 1431830528(1398272K)
JVM Input Arguments : -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -Xloggc:D:\Program Files\Atlassian\JIRA Software\logs\atlassian-jira-gc-%t.log -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Dcatalina.home=D:\Program Files\Atlassian\JIRA Software -Dcatalina.base=D:\Program Files\Atlassian\JIRA Software -Dignore.endorsed.dirs=D:\Program Files\Atlassian\JIRA Software\endorsed -Djava.io.tmpdir=D:\Program Files\Atlassian\JIRA Software\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=D:\Program Files\Atlassian\JIRA Software\conf\logging.properties exit abort -Xms384m -Xmx2048m
Java Compatibility Information : JIRA version = 8.0.2, Java Version = 1.8.0_181

___ Java System Properties ________________

atlassian.standalone : JIRA
awt.toolkit : sun.awt.windows.WToolkit
catalina.base : D:\Program Files\Atlassian\JIRA Software
catalina.home : D:\Program Files\Atlassian\JIRA Software
catalina.useNaming : true
common.loader : "${catalina.base}/lib",
"${catalina.base}/lib/*.jar",
"${catalina.home}/lib",
"${catalina.home}/lib/*.jar"
file.encoding : Cp1252
file.encoding.pkg : sun.io
ignore.endorsed.dirs : D:\Program Files\Atlassian\JIRA Software\endorsed
java.awt.graphicsenv : sun.awt.Win32GraphicsEnvironment
java.awt.headless : true
java.awt.printerjob : sun.awt.windows.WPrinterJob
java.class.version : 52.0
java.home : D:\Program Files\Atlassian\JIRA Software\jre
java.io.tmpdir : D:\Program Files\Atlassian\JIRA Software\temp
java.naming.factory.initial : org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs : org.apache.naming
java.runtime.name : Java(TM) SE Runtime Environment
java.runtime.version : 1.8.0_181-b13
java.specification.name : Java Platform API Specification
java.specification.vendor : Oracle Corporation
java.specification.version : 1.8
java.util.concurrent.ForkJoinPool.common.threadFactory : org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory
java.util.logging.config.file : D:\Program Files\Atlassian\JIRA Software\conf\logging.properties
java.util.logging.manager : org.apache.juli.ClassLoaderLogManager
java.vendor : Oracle Corporation
java.vendor.url : http://java.oracle.com/
java.vendor.url.bug : http://bugreport.sun.com/bugreport/
java.version : 1.8.0_181
java.vm.info : mixed mode
java.vm.name : Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name : Java Virtual Machine Specification
java.vm.specification.vendor : Oracle Corporation
java.vm.specification.version : 1.8
java.vm.vendor : Oracle Corporation
java.vm.version : 25.181-b13
mail.mime.decodeparameters : true
org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER : true
org.dom4j.factory : com.atlassian.core.xml.InterningDocumentFactory
os.arch : amd64
os.name : Windows 10
os.version : 10.0
package.access : sun.,
org.apache.catalina.,
org.apache.coyote.,
org.apache.jasper.,
org.apache.tomcat.
package.definition : sun.,
java.,
org.apache.catalina.,
org.apache.coyote.,
org.apache.jasper.,
org.apache.naming.,
org.apache.tomcat.
server.loader :
shared.loader :
sun.arch.data.model : 64
sun.boot.library.path : D:\Program Files\Atlassian\JIRA Software\jre\bin
sun.cpu.endian : little
sun.cpu.isalist : amd64
sun.desktop : windows
sun.io.unicode.encoding : UnicodeLittle
sun.jnu.encoding : Cp1252
sun.management.compiler : HotSpot 64-Bit Tiered Compilers
sun.os.patch.level :
tomcat.util.buf.StringCache.byte.enabled : true
tomcat.util.scan.StandardJarScanFilter.jarsToScan : log4j-taglib*.jar,
log4j-web*.jar,
log4javascript*.jar,
slf4j-taglib*.jar
tomcat.util.scan.StandardJarScanFilter.jarsToSkip : annotations-api.jar,
ant-junit*.jar,
ant-launcher.jar,
ant.jar,
asm-*.jar,
aspectj*.jar,
bootstrap.jar,
catalina-ant.jar,
catalina-ha.jar,
catalina-jmx-remote.jar,
catalina-storeconfig.jar,
catalina-tribes.jar,
catalina-ws.jar,
catalina.jar,
cglib-*.jar,
cobertura-*.jar,
commons-beanutils*.jar,
commons-codec*.jar,
commons-collections*.jar,
commons-daemon.jar,
commons-dbcp*.jar,
commons-digester*.jar,
commons-fileupload*.jar,
commons-httpclient*.jar,
commons-io*.jar,
commons-lang*.jar,
commons-logging*.jar,
commons-math*.jar,
commons-pool*.jar,
dom4j-*.jar,
easymock-*.jar,
ecj-*.jar,
el-api.jar,
geronimo-spec-jaxrpc*.jar,
h2*.jar,
hamcrest-*.jar,
hibernate*.jar,
httpclient*.jar,
icu4j-*.jar,
jasper-el.jar,
jasper.jar,
jaspic-api.jar,
jaxb-*.jar,
jaxen-*.jar,
jdom-*.jar,
jetty-*.jar,
jmx-tools.jar,
jmx.jar,
jsp-api.jar,
jstl.jar,
jta*.jar,
junit-*.jar,
junit.jar,
log4j*.jar,
mail*.jar,
objenesis-*.jar,
oraclepki.jar,
oro-*.jar,
servlet-api-*.jar,
servlet-api.jar,
slf4j*.jar,
taglibs-standard-spec-*.jar,
tagsoup-*.jar,
tomcat-api.jar,
tomcat-coyote.jar,
tomcat-dbcp.jar,
tomcat-i18n-en.jar,
tomcat-i18n-es.jar,
tomcat-i18n-fr.jar,
tomcat-i18n-ja.jar,
tomcat-i18n-ru.jar,
tomcat-jdbc.jar,
tomcat-jni.jar,
tomcat-juli-adapters.jar,
tomcat-juli.jar,
tomcat-util-scan.jar,
tomcat-util.jar,
tomcat-websocket.jar,
tools.jar,
websocket-api.jar,
wsdl4j*.jar,
xercesImpl.jar,
xml-apis.jar,
xmlParserAPIs-*.jar,
xmlParserAPIs.jar,
xom-*.jar
user.country : NL
user.dir : D:\Program Files\Atlassian\JIRA Software
user.home : C:\windows\system32\config\systemprofile
user.language : nl
user.name : LAPTOP-4K0CF9P6$
user.script :
user.timezone : Europe/Berlin
user.variant :

2019-06-16 23:58:20,528 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from C:\Program Files\Atlassian\Application Data\JIRA\dbconfig.xml
2019-06-16 23:58:21,182 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: File corrupted in chunk 240036, expected page length =< 768, got 845361200 [1.4.185/6]" [50000-185]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.engine.Database.openDatabase(Database.java:297)
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: File corrupted in chunk 240036, expected page length =< 768, got 845361200 [1.4.185/6]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
at org.h2.mvstore.Page.read(Page.java:640)
at org.h2.mvstore.Page.read(Page.java:194)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1830)
at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:468)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469)
at org.h2.mvstore.MVMap.get(MVMap.java:450)
at org.h2.mvstore.MVStore.getRootPos(MVStore.java:2227)
at org.h2.mvstore.MVStore.openMap(MVStore.java:461)
at org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:373)
at org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:726)
at org.h2.mvstore.db.MVPrimaryIndex.<init>(MVPrimaryIndex.java:74)
at org.h2.mvstore.db.MVTable.init(MVTable.java:90)
at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:130)
at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:41)
at org.h2.schema.Schema.createTable(Schema.java:582)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:137)
at org.h2.engine.MetaRecord.execute(MetaRecord.java:58)
at org.h2.engine.Database.open(Database.java:732)
at org.h2.engine.Database.openDatabase(Database.java:266)
... 41 more
2019-06-16 23:58:21,212 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2019-06-16 23:58:21,212 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-06-16 23:58:21,215 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2019-06-16 23:58:21,215 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2019-06-16 23:58:21,389 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 75 MiB. Committed: 362 MiB. Max: 2027 MiB
Non-heap memory : Used: 43 MiB. Committed: 66 MiB. Max: 1536 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 118 MiB. Committed: 428 MiB. Max: 3563 MiB
---------------------------------------------------------------------------------

Suggest an answer

Log in or Sign up to answer