Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Error: Could not resolve host

Deleted user May 21, 2013

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

1 vote
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2013

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

Deleted user May 22, 2013

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.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2013

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
Deleted user May 22, 2013

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'?)

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2013

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!

Deleted user May 22, 2013

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!

Jesse Gunzel December 3, 2013

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

Like pavankumarAN likes this
2 votes
Harinath Mallepally August 19, 2015

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.


ehrpaulhardt June 28, 2017

Thank you!

0 votes
sahilr2050 April 25, 2019

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. 

0 votes
mendozaa January 24, 2019

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

0 votes
Kentaro Matsumae April 19, 2015

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

0 votes
Jesse Gunzel December 3, 2013

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

0 votes
Nica Huestegge May 21, 2013

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.

Deleted user May 21, 2013

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"

Nica Huestegge May 21, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events