It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

7 answers

1 accepted

0 votes
Answer accepted

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?

Like # people like this

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

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.


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

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

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

Tengo este mismo problema que plantean el resto del grupo, pero no encuentro el archivo .gitconfig, donde lo ubico este me pueden dar una idea.

fatal: unable to access 'https://mendozaa@bitbucket.org/mendozaa/sifw.git/': Could not resolve host: bitbucket.org

 

Saludos

I follow all of the given solution above, but still I am facing same issue. 

I don't have any proxy as I checked config global and .git/config. It was working before without proxy.

I check `git config -l` there is nothing abnormal. All good as given below.

user.email=xxxxxxxxxx@yahoo.in
user.name=xxxxx_server
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https:\/\/xxxxx@bitbucket.org/xxxx/xxxx.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

 I tried some of the other google solution. 

I tried that as well. but not working. But the strange thing for me is.

When I restart SSH as I am pulling data in remote server 

First time command run successfully but second time it show me below error

fatal: unable to access 'https:\/\/xxxxx@bitbucket.org/xxxx/xxxx.git/': 
Couldn't resolve host 'bitbucket.org'

 

Can you please help me to resolve this. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

1,670 views 0 10
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you