Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Contact Support
GitKraken Status  

Duplicate entry 0 for key PRIMARY exceptions in log

Problem

After Jira installation or configuration changes – the following errors appear. Errors/failures in the Git Integration for Jira application are seen sporadically.

 

Diagnosis

Jira admins will see a message similar to the one below in the Jira log: /application-logs/atlassian-jira.log:

2014-06-23 10:14:00,319 http-bio-8080-exec-25 ERROR xxx 614x203x2 p1s16e xxx.xxx.xxx.xxx /rest/activityplugin/1.0/usersettings [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
    - name:MySQL
    - version:5.1.54-rel12.5-log
    - minor version:1
    - major version:5
Driver:
    - name:MySQL-AB JDBC Driver
    - version:mysql-connector-java-5.1.10 ( Revision: ${svn.Revision} )
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY'
    at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:107)
    at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.create(DelegatingActiveObjects.java:63)  <+3>
    at java.lang.reflect.Method.invoke(Unknown Source)
    (...)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    (...)
    at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:103)
    ... 194 more

 

Cause

In MySQL configuration (my.ini (Windows) or my.cnf (Unix)), parameter of sql_mode is set to NO_AUTO_VALUE_ON_ZERO.

 

Solution

  1. Uninstall the Git Integration for Jira app.
  2. Remove all Git Integration for Jira app tables.
  3. Stop Jira.
  4. Stop MySQL.
  5. Edit the my.cnf file (often named my.ini on Windows operating systems or my.cnf on UNIX operating systems) in your MySQL server.
  6. Remove NO_AUTO_VALUE_ON_ZERO from sql_mode.
  7. Start MySQL.
  8. Start Jira.
  9. Install the Git Integration for Jira app.

For more information – see Atlassian help article about Duplicate entry 0 for key PRIMARY exceptions in log.

Contact Us
If you still have a question – reach out to our Support Desk or email us at [email protected].

 

More articles about troubleshooting, workarounds and solutions

Why I am getting the error, “git-upload-pack not permitted”?

Avoid OutOfMemory exceptions by configuring or memory allocation with Jira to accommodate large repositories

Cannot auto-deploy some tracked repositories: Specified origin is incorrect or not supported

Connection Reset when Accessing the Database

“Dangerous use of multiple connections” error on local database

Duplicate entry 0 for key PRIMARY exceptions in log (this page)

Error while reindexing – Java heap space / Object too large, rejecting the pack

Error creating git branches and also using NFS

Fix performance issues for nested cloned repositories with enabled Git Service Permissions mode

Fixing reindex issues using Indexing Queue Viewer

Gitolite integration: Why the Git integration app not see the master branch?

Health Check: Database Collation

Indexing error – Too many open files

Installation fails when installing manually

Jira index error: IndexNotFoundException: no segments* file found

Malformed input or input contains unmappable characters

Personal access token failing Azure DevOps integration with Not Authorized error

Problems with shared home on Azure Storage

Pull request index error: org.json.JSONException

Repositories missing from Azure DevOps integration

“Service proxy has been destroyed” exceptions in log

SQLException ‘Incorrect string value’ in merge requests

SSH key file format is invalid

TFS – Not authorized exception when Jira works thru proxy

Unexpected exception parsing XML document from URL error in log

Why don’t I see the Create Branch or Pull Request features?

Your token has not been granted the required scopes

When a GIJ license expires, it shows up as a session error to the user

edDSA provider not supported WARN in logs

Have feedback about this article? Did we miss something? Let us know!
On this page