Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Mercurial.UnrelatedRepositoryErrorException automatically by discarding LF repo and re-cloning #183

Open
megahirt opened this issue Jan 21, 2022 · 3 comments
Assignees
Labels
S/R Exception S/R Exceptions under investigation

Comments

@megahirt
Copy link
Contributor

megahirt commented Jan 21, 2022

An unrelated repository exception can occur when the corresponding Language Depot repo is replaced with a new one by a Flex support person. This is usually done to reduce the size of a repo (drop old revisions) or to restore the project to a previously known good state.

When LFMerge encounters a UnrelatedRepositoryErrorException in the process of syncing it should:

  1. delete the local copy of the repo /var/lib/languageforge/lexicon/sendreceive/webwork/projectid
  2. re-clone the project
  3. carry on syncing

Some unknowns that we need to test:

  • can our current code recover from a missing repo or deleted repo on the LF side? If so, then implementing this card is probably mostly done.
  • does the data continue to sync as expected after the re-clone operation? Or does it take an extra sync to get the data synced?
  • are the symlinks recreated between the sendreceive/webwork folder and the project folder in src/assets/lexicon?

Original stacktrace:

Chorus.VcsDrivers.Mercurial.UnrelatedRepositoryErrorException: The repository(a.k.a 'project' or 'collection') that you tried to synchronize with has the same name as yours, but it does not have the same heritage, so it cannot be synchronized. In order to Send/Receive projects, you have to start with a single project/collection, then copy that around. Don't feel bad if this is confusing, just ask for some technical help.
  at Chorus.VcsDrivers.Mercurial.HgRepository.PullFromTarget (System.String targetLabel, System.String targetUri) [0x00106] in <d98940b1597342908bfb88b257fca6f5>:0
  at Chorus.VcsDrivers.Mercurial.HgNormalTransport.Pull () [0x00000] in <d98940b1597342908bfb88b257fca6f5>:0
  at Chorus.VcsDrivers.Mercurial.HgRepository.Pull (Chorus.VcsDrivers.RepositoryAddress source, System.String targetUri) [0x00050] in <d98940b1597342908bfb88b257fca6f5>:0
  at LfMergeBridge.LanguageForgeSendReceiveActionHandler.LibTriboroughBridgeChorusPlugin.Infrastructure.IBridgeActionTypeHandler.StartWorking (SIL.Progress.IProgress progress, System.Collections.Generic.Dictionary`2[TKey,TValue] options, System.String& somethingForClient) [0x001cd] in <dbee31384bce49b1bd2ffaab93484008>:0
  at LfMergeBridge.LfMergeBridge.Execute (System.String actionType, SIL.Progress.IProgress progress, System.Collections.Generic.Dictionary`2[TKey,TValue] options, System.String& somethingForClient) [0x000df] in <dbee31384bce49b1bd2ffaab93484008>:0
  at LfMerge.Core.Actions.SynchronizeAction.DoRun (LfMerge.Core.ILfProject project) [0x0013c] in /build/lfmerge-7000072-9dfRZq/lfmerge-7000072-2.0.90.52/src/LfMerge.Core/Actions/SynchronizeAction.cs:98
  at LfMerge.Core.Actions.Action.Run (LfMerge.Core.ILfProject project) [0x0010d] in /build/lfmerge-7000072-9dfRZq/lfmerge-7000072-2.0.90.52/src/LfMerge.Core/Actions/Action.cs:142
  at LfMerge.Program.RunAction (System.String projectCode, LfMerge.Core.Actions.ActionNames currentAction) [0x000ed] in /build/lfmerge-7000072-9dfRZq/lfmerge-7000072-2.0.90.52/src/LfMerge/Program.cs:128 

I am trying to think how this Exception could occur. More investigation is needed to understand how this error can occur in LF.

@megahirt megahirt added the S/R Exception S/R Exceptions under investigation label Jan 21, 2022
@josephmyers
Copy link
Collaborator

josephmyers commented Jan 25, 2022

Stacktrace is busted, but it was easy to find the line in Bridge that caused the error (line 94 in LanguageForgeSendReceiveActionHandler on develop). As for the actual error, it seems somewhat self-explanatory and comes from here, starting around line 321 in master.

@josephmyers
Copy link
Collaborator

So Chris explained this for me. The LF cache has become invalidated (likely due to operations on the Language Depot side), and we need to clear the cache and pull things fresh.

@megahirt
Copy link
Contributor Author

megahirt commented Jan 26, 2022 via email

@megahirt megahirt changed the title Chorus.VcsDrivers.Mercurial.UnrelatedRepositoryErrorException Handle Mercurial.UnrelatedRepositoryErrorException automatically by discarding LF repo and re-cloning Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S/R Exception S/R Exceptions under investigation
Projects
Development

No branches or pull requests

2 participants