• Community
  • Products
  • Jira Software
  • Questions
  • Bugzilla to JIRA: find cause of: Could not connect to 'jdbc:mysql:///bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull': Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Bugzilla to JIRA: find cause of: Could not connect to 'jdbc:mysql:///bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull': Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Rob Davis July 14, 2011

How would I find the cause of: Could not connect to 'jdbc:mysql://<server-address>/bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull': Could not create connection to database server. Attempted reconnect 3 times. Giving up.

I would like to know if it is a problem with my server and what to do to remedy it. That error message does not give me enough information.

Update:

I'm doing this on a test server with Jira 4.4 and all I see now is:

Error connecting to the database: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

-- This is not enough information. I want to know:

1) If it could find the server (after all FTP, HTTP etc will tell you that a host is unreachable)

2) If it could find the server then if the login details are incorrect (again FTP etc will tell you that your login is incorrect)

Currently I am not getting detail in 1) and 2) I need. Just saying "error connecting to database" is opaque and not helpful.


6 answers

1 accepted

1 vote
Answer accepted
Rob Davis October 9, 2011

The answer is that the database user, bugzilla, that the bugzilla uses to read/write its database only had local access permissions. This meant that external hosts outside of the machine (i.e. the jira bugzilla migration tool) would be refused access as they are not local. A solution therefore would be to change the bugzilla user permissions to any host.

A MySQL query to do this would be like this:

CREATE USER 'bugzilla'@'%' IDENTIFIED BY PASSWORD  '52819c504481470a';

GRANT ALL PRIVILEGES ON * . * TO  'bugzilla'@'%' IDENTIFIED BY PASSWORD  '52819c504481470a' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

Changing the bugzilla database user permissions to any host can also be done in a free MySQL admin tool like phpmyadmin - see this screenshot.

2 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 14, 2011

Can you connect to the database with for example DB Visualizer using the same JDBC connection string? If you can't then likely the JDBC string is incorrect.

1 vote
Wojciech Seliga
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.
August 11, 2011

You could have also specified mismatching JDBC Driver class name (e.g. PostgreSQL instead of MySQL one).

You could try the newly released JIRA Importers Plugin 3.2 which has a more user-friendly DB setup screen where you don't specify the URL JDBC string manually, but JIM builds it for you.

Rob Davis September 27, 2011

I checked and I am using MySQL as the bugzilla that I am inporting is based on MySQL.

1 vote
Colin Goudie
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.
August 7, 2011

Rob, the error message is giving you exactly the information you need. The URL you are specifying is either wrong, or the credentials for that database are wrong.

Rob Davis September 27, 2011

I disagree. It does not provide the specific problem. It should confirm that it could reach the URL and if so should then specify if login details are correct or not. After, all if one tries to connect to a non-existent FTP server for example, the error message would indicate that. And if one tries to connect to an existing FTP server but with incorrect login details, then, again, the error message would indicate that.

Rob Davis October 9, 2011

As from my answer, the credentials were correct and the URL was correct. The problem was that the bugzilla user was only able to accept local logins. The error message given gave no clues about that.

1 vote
mlassau_atlassian
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.
August 7, 2011

Is the error message literally:

Could not connect to 'jdbc:mysql://<server-address>/bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull':

?

Is so, then the "<server-address>" is a placeholder that needs to be replaced by the host-name or IP address of your MySQL server.
Have you properly configured the Bugzilla DB server connection settings?

Or perhaps you manually put this in just for this website to mask the real address for security concerns?

Rob Davis September 27, 2011

Yes I manually put this in for security concerns.

0 votes
Leandro Nunes September 19, 2011

Additionally, there's a known MySQL bug regarding version 5 that also causes this error. Please, take a look at this document:

- http://confluence.atlassian.com/display/JIRAKB/%27NullPointerException+at+com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding%27+Error+When+Using+MySQL+Driver+v5.1.16

If you're hitting this bug so this is the answer you need. I believe it's worth giving a try :)

In hope it helps,

Leandro Nunes

Rob Davis September 27, 2011

Thanks but 1) I don't know how to tell exactly if I'm getting this problem (i.e. I do not see the Java stackdump described and 2) the remedy suggests a) removing some variables from the query - which I don't have anyway and b) suggests downgrading the MySQL - I can't do this on the live bugzilla system I have. I would have to export the SQL to another machine with the MySQL version that doesn't apparently have that - potentially a lot of work to do a downgrade - I've not done this before and expect that would involve persuading the Linux package manager to force install of a downgraded version. All this is potentially a lot of work which I am reluctant to do given that I can't be sure this is the problem as I am not seeing the lengthly stack dump error message described.

Suggest an answer

Log in or Sign up to answer