# git clone over HTTP returns 500 on invalid host name

3 messages from 2012-06-13 to 2012-06-13. Participants: Shawn Pearce, Junio C Hamano.
Thread: https://gitlist.dev/t/30800

## Shawn Pearce, 2012-06-13 23:36

Subject: git clone over HTTP returns 500 on invalid host name
Message-ID: <CAJo=hJuax3-x53HJT-s32euyf2=d57MsRCQWo6NZO3OL35+o7g@mail.gmail.com>
URL: https://gitlist.dev/e/CAJo%3DhJuax3-x53HJT-s32euyf2%3Dd57MsRCQWo6NZO3OL35%2Bo7g%40mail.gmail.com

```
$ git clone https://this.host.does.not.exist/foo
Cloning into 'foo'...
error: The requested URL returned error: 500 while accessing
http://this.host.does.not.exist/foo/info/refs
fatal: HTTP request failed


Hmm. Telling me the host doesn't exist is more useful than 500:

$ git clone git://this.host.does.not.exist/foo
Cloning into 'foo'...
fatal: Unable to look up this.host.does.not.exist (port 9418) (Name or
service not known)


Does anyone care about this other than me?  :-)

```

## Junio C Hamano, 2012-06-13 23:40

Subject: Re: git clone over HTTP returns 500 on invalid host name
Message-ID: <7vbokmg4qf.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbokmg4qf.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAJo=hJuax3-x53HJT-s32euyf2=d57MsRCQWo6NZO3OL35+o7g@mail.gmail.com>

```
Shawn Pearce <spearce@spearce.org> writes:

> $ git clone https://this.host.does.not.exist/foo
> Cloning into 'foo'...
> error: The requested URL returned error: 500 while accessing
> http://this.host.does.not.exist/foo/info/refs
> fatal: HTTP request failed
>
>
> Hmm. Telling me the host doesn't exist is more useful than 500:
>
> $ git clone git://this.host.does.not.exist/foo
> Cloning into 'foo'...
> fatal: Unable to look up this.host.does.not.exist (port 9418) (Name or
> service not known)
>
>
> Does anyone care about this other than me?  :-)


$ git clone https://this.host.does.not.exist/foo
Cloning into 'foo'...
error: Couldn't resolve host 'this.host.does.not.exist' while accessing https://this.host.does.not.exist/foo/info/refs
fatal: HTTP request failed

What are we doing differently?  Perhaps you have a custom proxy that
throws 500 back at you or something?

```

## Shawn Pearce, 2012-06-13 23:43

Subject: Re: git clone over HTTP returns 500 on invalid host name
Message-ID: <CAJo=hJv-gbpOzTmP+uTHXvuQHaDiH0PTVXqURUhLrLcfO4YEiQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJo%3DhJv-gbpOzTmP%2BuTHXvuQHaDiH0PTVXqURUhLrLcfO4YEiQ%40mail.gmail.com
In-Reply-To: <7vbokmg4qf.fsf@alter.siamese.dyndns.org>

```
On Wed, Jun 13, 2012 at 4:40 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
>> $ git clone https://this.host.does.not.exist/foo
>> Cloning into 'foo'...
>> error: The requested URL returned error: 500 while accessing
>> http://this.host.does.not.exist/foo/info/refs
>> fatal: HTTP request failed
>>
>>
>> Hmm. Telling me the host doesn't exist is more useful than 500:
>>
>> $ git clone git://this.host.does.not.exist/foo
>> Cloning into 'foo'...
>> fatal: Unable to look up this.host.does.not.exist (port 9418) (Name or
>> service not known)
>>
>>
>> Does anyone care about this other than me?  :-)
>
>
> $ git clone https://this.host.does.not.exist/foo
> Cloning into 'foo'...
> error: Couldn't resolve host 'this.host.does.not.exist' while accessing https://this.host.does.not.exist/foo/info/refs
> fatal: HTTP request failed
>
> What are we doing differently?  Perhaps you have a custom proxy that
> throws 500 back at you or something?

Grrr. Yes. Its the contrib/persistent-https proxy that is causing
this, and a url.insteadof in ~/.gitconfig that always uses it for
https:

  [url "persistent-https://"]
    insteadof = https://

```
