Failure to Connect when pushing to or pulling from Bitbucket

Hi there,

I’m trying to connect a project to Bitbucket, and I have followed the instructions in How to Connect Studio to Bitbucket, however I am getting the following error:

22.10.3+

failed to connect to bitbucket.org:
 
Error: LibGit2Sharp.LibGit2SharpException: failed to connect to bitbucket.org: 
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteHandle remote, IEnumerable`1 refSpecs, GitFetchOptions fetchOptions, String logMessage)
   at LibGit2Sharp.Commands.Fetch(Repository repository, String remote, IEnumerable`1 refspecs, FetchOptions options, String logMessage)
   at LibGit2Sharp.Commands.Pull(Repository repository, Signature merger, PullOptions options)
   at UiPath.Studio.Plugin.Git.Wrappers.CommandsWrapper.Pull(IRepository repository, Signature merger, PullOptions options)
   at UiPath.Studio.Plugin.Git.Services.PullService.TryFastForwardMerge(IRepository repository, Signature signature, IAuthenticationSession authenticationSession)
   at UiPath.Studio.Plugin.Git.Services.PullService.<>c__DisplayClass5_0.<Pull>b__0()
   at UiPath.Studio.Plugin.Git.Desktop.Services.UiAuthenticationSession.Execute[T](ExecuteArgs`1 args)
   at UiPath.Studio.Plugin.Git.Services.PullService.Pull(IRepository repository)
   at UiPath.Studio.Plugin.Git.Desktop.Services.PullUiService.<>c__DisplayClass22_0.<<PullAsync>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.Studio.Plugin.Git.Services.GitSession.ExecuteAsyncInternal[TResult](Func`2 action, Func`1 repoFactory)
   at UiPath.Studio.Plugin.Git.Services.GitSession.<>c__DisplayClass18_0`1.<<ExecuteAsync>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.Studio.Plugin.Git.Services.GitSession.SafeExecuteAsync[TResult](Func`1 action)
   at UiPath.Studio.Plugin.Git.Services.GitSession.ExecuteAsync[TResult](Func`2 action)
   at UiPath.Studio.Plugin.Git.Desktop.Services.PullUiService.PullAsync(IGitSession session)
   at UiPath.Studio.Plugin.Git.Desktop.Services.PullUiService.PullCommandExecute()
   at UiPath.Studio.App.Desktop.MVVM.Commands.TaskCommand`3.Execute(TExecuteParameter parameter, Boolean ignoreCanExecuteCheck)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146233088

Is anyone able to provide insight into this?

I’m connected using the “ssh://git@bitbucket.org/<repo_owner>/.git” format, and this is happening with different projects.

If you’re connecting to Bitbucket using the SSH protocol (ssh://git@bitbucket.org/<repo_owner>/.git), and you’re experiencing issues with different projects, there are a few additional steps you can take to troubleshoot the problem:

  1. Verify SSH Key Setup: Ensure that you have set up SSH keys correctly for your Bitbucket account. Check that the public key is properly added to your Bitbucket account settings. You can refer to the Bitbucket documentation for instructions on how to generate and add SSH keys.

  2. Test SSH Connection: Open a terminal or command prompt and try to manually establish an SSH connection to Bitbucket using the following command:

    ssh -T git@bitbucket.org
    

    This command should attempt to establish an SSH connection and display a success message. If you encounter any errors or prompts during this process, it may indicate a configuration issue with your SSH keys or SSH client.

  3. SSH Config File: Check if you have any custom SSH configuration files (~/.ssh/config or /etc/ssh/ssh_config) that could be affecting the SSH connection. Ensure that the Bitbucket host (bitbucket.org) is not being overridden or modified in these configuration files.

  4. Update SSH Client: Make sure you’re using an up-to-date version of the SSH client. If you’re on a Unix-like system (e.g., Linux or macOS), you can update the SSH client by updating the OpenSSH package. On Windows, consider updating Git for Windows, which includes an SSH client.

  5. Check Firewall and Network Restrictions: Confirm that there are no firewall rules or network restrictions that prevent outbound SSH connections to Bitbucket. If you’re connecting from a corporate network, reach out to your network administrator to ensure that SSH connections to external services are allowed.

  6. Debug SSH Connection: If the issue persists, you can enable verbose SSH logging to get more detailed information about the connection process. Run the SSH command with the -v option:

    ssh -v -T git@bitbucket.org
    

    This will display verbose output that can help identify any specific issues or errors encountered during the SSH connection.

1 Like

Apologies for the delay in my response. Turns out that we don’t have Git, not SSH installed on our machines. However, using the integration that comes installed with UiPath Studio, and the creation of an App Password in BitBucket, I was able to connect the local repositories to the remotes on BitBucket using HTTPS instead of SSH.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.