Forums

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

Run Jira on https > no database connection

Netinium February 19, 2019

Hello, We will like to run Jira on https. This is almost working but when I start jira

then on the display is a error "JIRA HAD PROBLEMS STARTING UP"

"Database: JIRA couldn't connect to your database"

on http is works fine???

on commandline "mysql -u user -p pass" than I can login.

whats wrong about this.

1 answer

1 accepted

0 votes
Answer accepted
Moses Thomas
Community Champion
February 19, 2019

@Netinium  You  need to  make sure that you are starting  JIRA,  in the same network with  database.

Netinium February 19, 2019

I am. the database is on the same server

Moses Thomas
Community Champion
February 19, 2019

@Netinium  please show more  detail logs  <JIRA_HOME> /log/atlassian-jira.log

Netinium February 19, 2019

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2214)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:781)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
... 3 filtered
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
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: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:154)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2137)
... 40 more
Caused by: java.net.UnknownHostException: address=(protocol=tcp)(host=localhost)(port=3306): Temporary failure in name resolution
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:243)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
... 41 more
2019-02-19 16:05:45,540 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2019-02-19 16:05:45,541 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-02-19 16:05:45,544 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2019-02-19 16:05:45,544 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2019-02-19 16:05:45,604 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 274 MiB. Committed: 959 MiB. Max: 972 MiB
Non-heap memory : Used: 42 MiB. Committed: 66 MiB. Max: 1536 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 315 MiB. Committed: 1024 MiB. Max: 2508 MiB
---------------------------------------------------------------------------------

Moses Thomas
Community Champion
February 19, 2019

@Netinium 

The reason has to  be one of the following  you must  verify  these

  •  Verify that database is  running
  • Verify the configuration of your dbconfig.xml file  by checking that(user, password, or database URL etc.)  are correct.
  • Verify that there is no network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)

Good luck.

Netinium February 19, 2019

on commandline I can connect to the database withe Mysql -u username -p pass

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.5.62 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q

 

my dbconfig.xml is the same one not chanced

Netinium February 19, 2019

When I use the config.sh and Test to connection it's failed:

 

Database Selection [M]> m
MySQL Database Configuration.
Hostname (localhost)>
Port (3306)>
Database (jiradb)>
Username (jira)>
Password (*******)>
Test Connection ([Y]/N)? > y
Attempting to connect to localhost:3306/jiradb
*** Connection failed: Could not connect to the DB: Communications link failure

but way can I connect with the command line to the database?

Moses Thomas
Community Champion
February 19, 2019

@Netinium  On ther command line  verify  that server is running.

 type  the below command  to  check

systemctl status mysql.service  

  if you don't see  Active(running)  ....   then type below command to  restart it.

sudo systemctl start mysql   OR    sudo service mysql restart 

Also check  whether you have the Mysql  Java  connector  downloaded.

this connector which  is a .jar file  should be in the 

<Confluence_home>/confluence/WEB-INF/lib/

 see more info  here:  https://confluence.atlassian.com/doc/database-jdbc-drivers-171742.html

Netinium February 19, 2019

[root@jira-7 ~]# service mysqld status
mysqld (pid 1617) is running...
[root@jira-7 ~]#

Netinium February 19, 2019

Jira has run for a long time on http. But now we will of security reason "ISO 27001" to run Jira on https.

I have a copy of our jira to test this and it will not work.

I follow this:

https://confluence.atlassian.com/adminjiraserver/running-jira-applications-over-ssl-or-https-938847764.html

Netinium February 21, 2019

I have installed the database-jdbc-driver for Mysql that dit the trick.

Like Moses Thomas likes this

Suggest an answer

Log in or Sign up to answer