We have enabled bi-directional sync between SVN and bitbucket for quite some time and it’s working fine.
This morning, one of our staff trying to update the subgit mapping file in order to include a sandbox branch in bitbucket:
This is the original setting:
trunk = trunk:refs/heads/develop
branches = branches/:refs/heads/release/
excludeBranches = branches/_sandboxes
shelves = shelves/:refs/shelves/
excludePath = .gitignore
[translate]
ignores = false
And here is the new change:
trunk = trunk:refs/heads/develop
branches = branches/:refs/heads/release/
branches = branches/_sandboxes/DRS:refs/heads/feature/DRS
excludeBranches = branches/_sandboxes
shelves = shelves/:refs/shelves/
excludePath = .gitignore
[translate]
ignores = false
And click Apply button to update the mapping file.
Initially, it seems working as the feature branch called DRS appear in bitbucket.
However, other staff found that the develop branch history seems to be rollback to early days (as they can see the last commit is 2018 Nov which is abnormal).
Can you advise if this is expected ? And how can we fix this problem ?
Hello Terry,
when you update mappings to add previously excluded mapping the process is the following:
SVN Mirror add-on rolls back the history to the moment when this newly added branch didn’t exist yet.
Then it re-translates the history since that moment.
After finishing (2) you should get your history back with newly added branch but temporarily it could look like the history is rolled back. Is that what you observe?
Could you attach svnmirror.log from GIT_REPO/subgit/logs/ directory?
How long does it takes for step2 ? And what happened when we git clone the develop branch ? It seems that we got the old code when doing git clone/pull from the develop branch.
Also, it’s strange that I can’t find the subgit folder at all !!!
Any suggestion on the location of the logs ? (btw, we are trying to rollback the change for one of the repository, there are 4 changed in total, but it seems it takes very very long time).
May I ask you what SVN Mirror add-on version and Bitbucket Server version are you using?
It’s very strange repository structure, I have these files and dirs for comparison: “app-info config db HEAD hooks logs objects packed-refs refs repository-config subgit svn”.
There’s one more logs directory, it’s for global logs: BITBUCKET_HOME/log/ , there should be svnmirror.log
Are you sure this is the correct repository? Did you uninstall SVN Mirror add-on from this repository or deleted the repository? I have a guess that ‘DELETED’ has something to do with repository deletion.
Bitbucket server version: 5.7.0
SVN Mirror add-on version: 3.4.1
Sorry. I looked in the wrong directory (as that repository already deleted sometime ago).
Attached is the subgit logs for that repository. (subgit.log.gz)
(note that we are trying to rollback the subgit mapping configuration for this repository).
I attached another one where we didn’t rollback yet (svnmirror_vpbb.zip)
You may want to check this file first.
While I’m trying to understand what’s going on, I would suggest a work-around: commit something to SVN directly, to ‘develop’ branch. Then SVN Mirror add-on will update the reference in the Git repository and it will be up to date again.
To the SVN repository corresponding to the repository where the config was rollback. To be more precise: to ‘trunk’ of that repository. If this helps, you can do the same with other branches that are not up to date in Git.
Update: not to branches/develop but to trunk as trunk is configured to be translated to ‘develop’ branch in Git.
I now see why the issue happens. You wanted to add “branches/_sandboxes/DRS” it appeared first at r35928 so SVN Mirror add-on should have started to re-translate everything since r35928. But you also have “minimalRevision = 180000” and SVN Mirror add-on should have taken this into account but it hadn’t.
Because of this confusion, it also refetched revisions [35928, 179999] and updated Git references in the process. Then it skipped everything but “branches/_sandboxes/DRS” changes on [180000, HEAD] (and this is expected). As result you have branches reset to older values.
Fortunately the work-around I proposed should work (leave a comment if it doesn’t): commit something translatable (e.g. change a file) to every branch that is reset to its older version directly to SVN. Then SVN Mirror add-on will translate this change to Git and update reference to the latest revision. You could also update the references manually, but it’s easier to break something this way.
Meanwhile, I’ll try to reproduce and fix the issue. We’re about to release new SVN Mirror add-on version, it shouldn’t contain this bug.
Hi @dmitry.pavlenko . We had same issue yesterday on another repo. Is the last version (v3.4.6) containing a fix for this ?
We are currently in v3.4.1.
Thanks
Yann
sorry for the delay in answer.
3.4.6 does contain some fixes for that matter yet we aren’t completely sure the issue resolved to the very end as we haven’t managed to reproduce it. We are now preparing the next version 3.4.7 (and also 4.0.2 that support Bitbucket 6) and we are hoping to implement the fix in this version. May we have logs from the second affected repository for analysis? This would help us much to find out the cause.