Skip to content

Random exception - this remote has never connected #1202

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

Closed
jsnmc opened this issue Apr 7, 2017 · 2 comments
Closed

Random exception - this remote has never connected #1202

jsnmc opened this issue Apr 7, 2017 · 2 comments

Comments

@jsnmc
Copy link

jsnmc commented Apr 7, 2017

I am seeing this about 1 out 5 builds - pulled code about 3 days ago.

09:55:04 INFO [04/07/17 13:55:04:00] No local branch pointing at the commit '2b1dc29648bd4225b34a281cd0626df2f70ff596'. Fake branch needs to be created.
09:55:04 INFO [04/07/17 13:55:04:00] Fetching remote refs to see if there is a pull request ref
09:55:04 INFO [04/07/17 13:55:04:13] End: Normalizing git directory for branch '' (Took: 2,791.89ms)
09:55:04 ERROR [04/07/17 13:55:04:17] An unexpected error occurred:
09:55:04 LibGit2Sharp.LibGit2SharpException: this remote has never connected
09:55:04 at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
09:55:04 at LibGit2Sharp.Core.Proxy.git_remote_ls(Repository repository, RemoteHandle remote)
09:55:04 at LibGit2Sharp.Network.ListReferencesInternal(String url, CredentialsHandler credentialsProvider)
09:55:04 at GitTools.Git.GitRepositoryHelper.GetRemoteTipsForAnonymousUser(Repository repo, Remote remote)
09:55:04 at GitTools.Git.GitRepositoryHelper.CreateFakeBranchPointingAtThePullRequestTip(Repository repo, AuthenticationInfo authentication)
09:55:04 at GitTools.Git.GitRepositoryHelper.NormalizeGitDirectory(String gitDirectory, AuthenticationInfo authentication, Boolean noFetch, String currentBranch)
09:55:04 at GitVersion.GitPreparer.Initialise(Boolean normaliseGitDirectory, String currentBranch)
09:55:04 at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
09:55:04 at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
09:55:04 at GitVersion.Program.VerifyArgumentsAndRun()

@jsnmc
Copy link
Author

jsnmc commented Jun 8, 2017

I tracked down the cause to a detached head. This case was random for some reason - In Jenkins, the Bitbucket plugin would sometimes in into this state. I now added code to check for detached head and force a full clone.

@jsnmc jsnmc closed this as completed Jun 8, 2017
@asbjornu
Copy link
Member

asbjornu commented Jun 9, 2017

Hm. If this is something we can detect in GitVersion, it would be good to give a better error message than what LibGit2Sharp is giving here. I'm glad you figured it out, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants