Not able to connect the DB with JIRA

Ranjeeth Kumar C M January 9, 2018

HI Team,

I could like to know the solution for the below problem, Thanks In Advance :). What should I have to do for this problem , is it was the problem with "mysql-connector-java-5.1.17.jar" version or some other problem with MYSQL version installed.

I am migrating the JIRA 7.0 from one lunix Server to another lunix server with JIRA 7.3 version.

In Jira 7.0 :
I am using the inbuild DB (H2 Db)

But in the new lunix server : I have installed the JIRA 7.3 versio.

Problem : When I am migrating the data from the backup (backup taken as per the atlassian instruction) to the new JIRA 7.3 version , The heath check for the DB fails.
reason was its supports only MYSQL or some other DB only.

So I have installed the MYSQL in my lunix server and connected the mysql from my workbench. Created the DB as mentioned in the migrating the DB instruction in atlassian.

Instruction flowed : https://confluence.atlassian.com/adminjiraserver073/connecting-jira-applications-to-mysql-861253043.html

Note : I have added the details in the my.cnf file and also moved the "mysql-connector-java-5.1.17.jar" file to "/atlassian/jira/lib".

I have deleted the DB config file from atlassian as said in the instruction.

After doing all this and when try to connect the DB to JIRA In the configuration page ,I am getting flowing error.

Error in UI:
Error connecting to database

Unexpected exception encountered during query.

null

Error of catalina.out:

2018-01-09 17:54:46,544 http-nio-8080-exec-14 ERROR anonymous 1074x6x1 56ier5 <IP Address> /secure/SetupDatabase!connectionCheck.jspa [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
java.sql.SQLException: Unexpected exception encountered during query.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2665)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1709)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1628)
at com.mysql.jdbc.ConnectionImpl.setSessionVariables(ConnectionImpl.java:5210)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3375)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2385)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
... 3 filtered
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
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:87)
at com.atlassian.jira.web.action.setup.SetupDatabase.testConnection(SetupDatabase.java:225)
at com.atlassian.jira.web.action.setup.SetupDatabase.doValidation(SetupDatabase.java:189)
at com.atlassian.jira.web.action.setup.SetupDatabase.doConnectionCheck(SetupDatabase.java:121)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
... 2 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
... 7 filtered
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
... 49 filtered
at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:80)
... 1 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:78)
... 28 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
... 27 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
... 28 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3100)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2096)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
... 181 more

 

This the Mysql Version I am Using :

+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| innodb_version | 5.6.38 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.6.38 |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+------------------------------+

 

This is my my.cnf deatils :

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
bind-address = 127.0.0.1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
innodb_data_file_path = ibdata1:10M:autoextend
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=256M

 

 

2 answers

1 accepted

0 votes
Answer accepted
Ranjeeth Kumar C M January 10, 2018

Hi All, 

 

I have resolved the above mentioned issue.

The root cause of this issue is the "Connector Jar"  "mysql-connector-java-5.1.17.jar" which I have placed in the "Atlassian/jira/lib" path. 

 

Solution : 

I have resolved the issue by placing the "mysql-connector-java-5.1.35-bin.jar" in the "Atlassian/jira/lib" path. 

 

After placing the correct Jar and I have restarted the Atlassian. 

After restarting I can able to connect to my Database (Empty Database) and rest of the configuration as mentioned in the Atlassian instruction.

One cool thing is that after you successfully configured , you can see the empty DB with the newly created tables which is  been created by the Atlassian.

 

Regards,

Ranjeeth

miikhy
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.
January 11, 2018

Glad you've found a solution. Could you accept your above answer to mark this topic as answered for other users to benefit from your resolution?

Thanks for sharing :)

Ranjeeth Kumar C M January 11, 2018

ya Sure Caritte. You can mark this question has answered. 

Thanks for your Help :)

0 votes
miikhy
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.
January 9, 2018

Hi,

As described here: https://confluence.atlassian.com/adminjiraserver071/switching-databases-802592192.html

The usual procedure is to take an XML backup of you H2 instance with your JIRA_HOMe and attachment directories, then install a fresh new Jira (if you're upgrading) connected to a blank MySQL database (should work pretty straight forward if you're using the right JAR and config as you seem to do. Then you should get a new but working Jira, ready to welcome you backup in system import.

Hope the above documentation will help, instead of just removing dbconfig file you might want to reinstall entirely Jira as you're not keeping the same product version.

Cheers

Ranjeeth Kumar C M January 9, 2018

HI Micky Caritte,

 

Thanks for your help :). 

As you have mentioned in your link , I have flowed all the steps. While I am trying to connect the empty DB to the Jira while select "I'll set it myself" option. That is the place were I am getting the Problem. The error log which I have got from the catalina.out file of Atlassian and UI error Pop up message also I have included in the previous post.

Can you able to find out any details from the log what could be the problem. 

 

Advance thanks for your help :) .

 

Regards,

Ranjeeth

Suggest an answer

Log in or Sign up to answer