Cannot enable QMetry Features in a JIRA Project

Symptoms:

  • Getting errors:  Failed to update QMetry Features for Selected Project


  • Logs contain below errors: 

    SEVERE [http-nio-8080-exec-20] com.sun.jersey.spi.container.ContainerResponse.logException Mapped exception to response: 500 (Internal Server Error) 
    com.atlassian.qtm.rest.exception.RESTException 
    at com.atlassian.qtm.rest.ProjectConfigurationRest.setQMetryEnabledFlagForAllProjects(ProjectConfigurationRest.java:133) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498)

Root Cause:

  • Sometimes below error is encountered in the JIRA Server Logs

    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY'

  • ReasonAs per Atlassian documentation, this error is caused if in the MySQL configuration ( my.ini (Windows) / my.cnf (Unix) ), the parameter of sql_mode is set to  "NO_AUTO_VALUE_ON_ZERO".

Solution:

  1. Stop the JIRA application.
  2. Stop MySQL.
  3. Edit the MySQL configuration file.
  4. Remove "NO_AUTO_VALUE_ON_ZERO" from sql_mode parameter.

  5. Start MySQL
  6. Start the JIRA application.

This solution is also available as a part of Official Atlassian Documentation.