Inconsistencies after database crash
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
There are many inconsistencies in the database and some pull requests are missing. Users may not be able to create pull requests which will yield the following error:
1
2
3
2016-07-29 14:22:20,994 ERROR [threadpool:thread-1] rob @A027H2x862x18467x0 10.202.46.100 "POST /scm/jreg/jreg.git/git-receive-pack HTTP/1.1" c.a.s.i.hook.PushPostReceiveHook JREG/jreg[1]: A RepositoryPushActivity could not be created for the following ref changes
- refs/heads/feature/JRE-12411: 0275b552f5f5fa0734c7ea11e0b3123928708456 -> 59503827a770ed170a315c7563ed52888efd937f (UPDATE)
org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into sta_activity (created_timestamp, activity_type, user_id, id) values (?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch
Cause
The database was shut down or crashed while Bitbucket was still running.
Resolution
There have been many improvements in recent version of Bitbucket that handle this situation. All you have to do is restart Bitbucket and these inconsistencies will be resolved.
Was this helpful?