User repository disappeared when reordering
Problem
When reordering user repositories one of the repositories disappear.
Diagnosis
Environment
- Bamboo version above 6.6 (versions with Crowd embedded)
Diagnostic Steps
Check if you have a duplicated value on LIST_INDEX column for the CWD_APP_DIR_MAPPING table. This column should not have duplicated values.
SELECT * FROM CWD_APP_DIR_MAPPING ORDER BY LIST_INDEX;
The column should have distinct values from 0 to the number of user repositories -1 (e.g 0,1,2 if you have 3 user repositories)
Cause
The root cause is still unclear, but the problem can be triggered when changing user repository order. The LIST_INDEX should be updated for two repositories each time (they are changing their position one to another) but just one of the indexes is updated creating duplicates.
Resolution
Remove the duplicates by updating the LIST_INDEX column. It should have values starting from 0 to the max number or user repositories -1 with not intervals (0,1,2,3, ...).