Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Database: JIRA couldn't connect to your database

when I try to run JIRA i got the error, 

Database: JIRA couldn't connect to your database

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.)


how could i resolve that issue, it stopped all of sudden :( Database JIRA error.png

1 answer

0 votes
Brant Schroeder Community Leader Dec 13, 2021

@Nouman Aziz  can you provide some additional information?  Is this a new install?  Is the DB on the same server?  Is the DB running?  Is there a firewall that could be preventing connectivity?  Have you made any changes recently?

@Brant Schroeder Thank you for your prompt response. following  are the details,

  1. it's not the new install
  2. DB is embedded H2
  3. how can I check that DB is running or not
  4. there is no issue with the firewall connectivity
  5. no, I didn't make any changes.

JIRA was working perfectly fine till Friday. when I try to access it on Monday, I got the below error :( 

Database: JIRA couldn't connect to your database. I am also attaching the log file.

2021-12-14 10:57:13,074+0500 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2021-12-14 10:57:13,074+0500 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.

2021-12-14 10:57:13,105+0500 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2021-12-14 10:57:13,105+0500 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2021-12-14 10:57:13,413+0500 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 57 MiB. Committed: 367 MiB. Max: 2031 MiB
Non-heap memory : Used: 40 MiB. Committed: 63 MiB. Max: 1536 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 96 MiB. Committed: 429 MiB. Max: 3567 MiB
---------------------------------------------------------------------------------
2021-12-14 10:58:27,843+0500 http-nio-8080-exec-1 WARN anonymous 658x1x1 - 10.28.13.7 /secure/Dashboard.jspa [c.a.j.config.properties.ApplicationPropertiesStore] Exception getting property 'jira.filters.encoding.enforcer.excluded.mimes' from database. Using default
2021-12-14 10:58:27,999+0500 http-nio-8080-exec-1 WARN anonymous 658x1x1 - 10.28.13.7 /secure/Dashboard.jspa [c.a.j.config.properties.ApplicationPropertiesStore] Exception getting property 'jira.filters.encoding.enforcer.excluded.paths' from database. Using default

Brant Schroeder Community Leader Dec 14, 2021

@Nouman Aziz 

The H2 database is for testing only so hopefully this is not a production instance.  If it is a production instance I would suggest migrating to a supported DB.   The H2 database since it is a file system can become corrupt.  Can you make sure you can connect to the H2 database - https://confluence.atlassian.com/jirakb/access-the-h2-embedded-database-in-jira-server-776818136.html

If you can connect you might just need to make sure the connection string is correct and restart Jira.  If you cannot connect, hopefully you have a backup you can restore from.

@Brant Schroeder 

I followed the steps and got the attached responses.

  1. on the first attempt when trying to connect the h2 database I got Java.lang error. see attached
  2. when I try to connect on the second attempt then got the error: Database may be already in use. see attached

please guide and suggestJIRA-Java error.pngDAtabase already in use.png

These errors generally mean that your database is corrupt.  I would be looking for the backups, rather than trying to repair it.

@Nic Brough _Adaptavist_ 

I have following question if you please address

  1. if the database is corrupt then on the second attempt connection, a message appeared database may be already in use. which in my opinion means the database might not be corrupt.
  2. if in case database is corrupt then what is the solution, and what steps should i follow.

Nope, the "in use" message means you've still got something connected to it, possibly a process that's hanging over because it's got messed up by the corruption.

Again, the "fix" is to go back to a backup.  You could try to rescue it, but h2 databases tend to fail catastrphically, and it's rare that you'll be able to rescue it (and when you can, you'll have lost data)

got it @Nic Brough _Adaptavist_

please guide and share your expert's opinion;

  1. if I reinstall my JIRA, then, in that case, all my data will be lost?
  2. while using JIRA I was taking backup by using the export feature. my recent backup was jirabackup 10Dec2021.  will it work for me? if i reinstall JIRA
  3. i have attached the database folder image as well. after reinstalling JIRA can I place that file in same folder by retrieving ma data.

please any other step  will be a great help for me to follow will be much appreciatedBackup.pngDb folder.png

Yes, a clean re-install will not have any of your old data in it.

If you re-install the same version of Jira, then yes, you should be able to import the entire thing from the backup, assuming you are talking about the xml export (that runs regularly by default).  If you're talking about some other backup you've taken, then, no, I don't know because you haven't told us what the backup is

You might be able to restore just those files to recover your old data, assuming your backup is an identical copy of the files from a time when it was working

Like Brant Schroeder likes this

thanks, @Nic Brough _Adaptavist_ 

here is the backup format which was taken by default.

JIRA backup file.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

811 views 24 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you