Error: Could not resolve host

I have been using SourceTree for a while now and it used to work perfectly.

Today I started to receive the below error message when I try to pull form origin:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

error: Could not resolve host: (nil); nodename nor servname provided, or not known while accessing https://myUser@bitbucket.org/myUser/myProject.git/info/refs

fatal: HTTP request failed

Completed with errors, see above

As far as I am aware nothing has changed. Does anybody know how to solve this?

Kinds regareds

5 answers

1 accepted

This widget could not be displayed.

That looks like your machine's DNS configuration is wrong, you should check your network settings.

Hi Steve, thanks for trying to help.

I have asked our network administrator to take a look, all network settings seem to be fine. We have even removed the computer from te network and reconnected it outside the firewall etc, still the same issue.

SourceTree is able to connect to Bitbucket; it uses my accont settings to display all available 'Repositories on all of your hosted accounts'.

All other internet related things work.

Hmm, in that case the only thing I can think of is that something in your local repository's .git/config file is somehow incorrect, since it only seems to affect pulling in Git. Can you post the contents of this file in this thread?

Steve... you are a hero!

Within the config file i saw a section called [http] in which a 'proxy' is specified.

The value behind 'proxy' was incorrect. I changed it and now all is fine!

A lot of things have changed on our network (new server etc.) including the proxy address. I was not aware of SourceTree having a reference to the proxy address stored locally. I did not know i needed to change it here manually.

Tanks for your help!

(Should I mark your initial comment as 'the answere'?)

Glad you resolved it! This proxy configuration is for git rather than SourceTree but it would explain the problems you had. I'm surprised it was in the local configuration file for this repository, it's more typical to configure proxy settings globally in the '.gitconfig' file in your home directory - so if you've corrected the setting, it might be a good idea to move it to your global configuration and remove it from this local repo so if settings change again it won't confuse you!

You are right again:

I found it in the global '.gitconfig' located in my home directory.

Just double checked and the local configuration file, .git/config, does not contain this setting.

I now also understand it was a 'git-thing' and not a 'SourceTree-thing'.

Thanks again!

I too am having similar problem. There is no mention of [HTTP] in local repository config or gitconfig file located in home. I tried to add with proxy/port and even user info but I receive same error. Can anyone help to resolve?

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin

error: The requested URL returned error: 407 while accessinghttps://mysite.git.beanstalkapp.com/xxx.git/info/refs

fatal: HTTP request failed

This widget could not be displayed.

It is a problem with the embedded GIT on Mac version of source tree. When I used system git (

/usr/bin/git) it worked flawlessly. just need to change the Source Tree setting to change the GIT from embedded one to this system one.


This widget could not be displayed.

Hello,

have you tried to connect to this url directly? Seems like there's something wrong with the url, or the user on bitbucket or something similar. If you can't access the url manually, you know the problem.

Hi Nica, thanks for your reply.

The url is what SourceTree calls 'source path'. It is automatically generated and works on another computer.

I do have the same issue when adding a new repository:

- After opening SourceTree i click on the 'Add Repository' icon

- I make sure the 'Clone Repository' tab is selected

- Behind the 'source path' item i click on the 'remote repositories...' button (little globe)

- This displays the repositories found in my account

- I select the related repository and click the OK button

- SourceTree now tells me "This is not a valid source path / URL"

When i click the little 'Details' button, it gives me the same error message as in the original post.

If i try the above on another computer, at the end SourceTree tells me "This is a Git repository"

Sorry, I've reached my limit with this one... :-(

If it works on one Computer and doesn't on another I would try to check those nasty settings like DNS and such... but I don't believe this will solve your problem.

All the Best,

Nica

This widget could not be displayed.

I too am having similar problem. There is no mention of [HTTP] in local repository config or gitconfig file located in home. I tried to add with proxy/port and even user info but I receive same error. Can anyone help to resolve?

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin

error: The requested URL returned error: 407 while accessing https://mysite.git.beanstalkapp.com/xxx.git/info/refs

fatal: HTTP request failed

This widget could not be displayed.

I was faced similar situation.

With command line, git clone and push is success.

スクリーンショット 2015-04-20 0.36.10.png

I open 'penlight' directory with SourceTree and push master branch to remote. It was failed.

スクリーンショット 2015-04-20 0.35.59.png

 

 

Environment:

SourceTree v2.0.3

OSX Yosemite v10.10.3

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

721 views 1 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you