{"thread":{"id":"22228","subject":"git clone against firewall","startedAt":"2010-01-14T23:45:53Z","lastAt":"2010-01-18T02:04:11Z","messageCount":8,"participants":["Sebastian Pipping","Junio C Hamano","Andreas Schwab","Andreas Krey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"131693","messageId":"4B4FACB1.2080902@hartwork.org","threadId":"22228","inReplyTo":null,"subject":"git clone against firewall","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2010-01-14T23:45:53Z","receivedAt":"2010-01-14T23:45:53Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"hello!\n\n\nwith a firewall blocking outgoing connections to port 9418 a\n\n  git clone git://...\n\nof git 1.6.6 seems to never return, i.e. loop forever.  in my rather\nautomated environment (gentoo's tool layman calling git) this behavior\nis rather troublesome - i need some kind of abort-and-error instead:\nwhat i'm trying to do is loop over a number of clone URL alternatives of\nthe same repository like ..\n\n  git://git.overlays.gentoo.org/dev/dberkholz.git\n  http://git.overlays.gentoo.org/gitroot/dev/dberkholz.git\n  git+ssh://git@git.overlays.gentoo.org/dev/dberkholz.git\n\n.. and stop at the first clone that returns without error.\n\nare there means to make git fail in such a case or to apply a timout?\nif not please consider adding a related commandline option to git-clone.\n\nthank you.\n\n\n\nsebastian\n"},{"id":"131744","messageId":"7vzl4fz0zb.fsf@alter.siamese.dyndns.org","threadId":"22228","inReplyTo":"4B4FACB1.2080902@hartwork.org","subject":"Re: git clone against firewall","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-15T18:17:44Z","receivedAt":"2010-01-15T18:17:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Pipping <webmaster@hartwork.org> writes:\n\n> with a firewall blocking outgoing connections to port 9418 a\n>\n>   git clone git://...\n>\n> of git 1.6.6 seems to never return, i.e. loop forever.  in my rather\n> automated environment (gentoo's tool layman calling git) this behavior\n> is rather troublesome - i need some kind of abort-and-error instead:\n> what i'm trying to do is loop over a number of clone URL alternatives of\n> the same repository like ..\n>\n>   git://git.overlays.gentoo.org/dev/dberkholz.git\n\nWhat do you exactly mean by \"blocking\"?\n\nIn my environment at work, there is a firewall and I immedately get this:\n\n    $ git clone git://git.overlays.gentoo.org/dev/dberkholz.git/\n    Initialized empty Git repository in /var/tmp/dberkholz/.git/\n    fatal: Unable to look up git.overlays.gentoo.org (port 9418) (Name or service not known)\n\nas my environment is quite isolated (it is not just a \"NAT with selective\nport blocking\").\n\nI am guessing that you can resolve the hostname in your environment\n(i.e. you configured your NAT to let DNS go directly outside).  What\nhappens when you try the following?\n\n    $ telnet git.overlays.gentoo.org 9418\n\nDo you get:\n\n    Trying 66.219.59.40...\n    telnet: Unable to connect to remote host: Connection refused\n\nIf you get something like:\n\n    Trying 66.219.59.40...\n    Connected to pelican.gentoo.org.\n    Escape character is '^]'.\n\nthen I don't think you are blocked, and if that is the case, there is not\nmuch we can do about it.\n\nI think your firewall can help, though, by not pretending to be allowing\nthe connection and then blocking you halfway.\n"},{"id":"131749","messageId":"4B50BE10.5010603@hartwork.org","threadId":"22228","inReplyTo":"7vzl4fz0zb.fsf@alter.siamese.dyndns.org","subject":"Re: git clone against firewall","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2010-01-15T19:12:16Z","receivedAt":"2010-01-15T19:12:16Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"On 01/15/10 19:17, Junio C Hamano wrote:\n> What do you exactly mean by \"blocking\"?\n\nI chose \"BLOCK always\" as action for that port in my home router\n(Netgear ProSafe 802.11g) config.  No idea how it's exactly doing that.\n\n\n> I am guessing that you can resolve the hostname in your environment\n> (i.e. you configured your NAT to let DNS go directly outside).\n\nName resolution works, yes.\n\n\n> What\n> happens when you try the following?\n> \n>     $ telnet git.overlays.gentoo.org 9418\n> \n> Do you get:\n> \n>     Trying 66.219.59.40...\n>     telnet: Unable to connect to remote host: Connection refused\n> \n> If you get something like:\n> \n>     Trying 66.219.59.40...\n>     Connected to pelican.gentoo.org.\n>     Escape character is '^]'.\n> \n> then I don't think you are blocked, and if that is the case, there is not\n> much we can do about it.\n\nI get a loop/freeze on\n\n  Trying 66.219.59.40...\n\nnothing more.  Can you deduce from that, what's happening?\n\n\n> I think your firewall can help, though, by not pretending to be allowing\n> the connection and then blocking you halfway.\n\nI'm afraid I cannot configure that.\n\n\n\nSebastian\n"},{"id":"131752","messageId":"4B50BFD6.2090308@hartwork.org","threadId":"22228","inReplyTo":"4B50BE10.5010603@hartwork.org","subject":"Re: git clone against firewall","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2010-01-15T19:19:50Z","receivedAt":"2010-01-15T19:19:50Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"On 01/15/10 20:12, Sebastian Pipping wrote:\n> I get a loop/freeze on\n> \n>   Trying 66.219.59.40...\n> \n> nothing more.  Can you deduce from that, what's happening?\n\nWait, it actually times out:\n\n  # date ; telnet git.overlays.gentoo.org 9418 ; date\n  Fr 15. Jan 20:14:01 CET 2010\n  Trying 66.219.59.40...\n  telnet: Unable to connect to remote host: Connection timed out\n  Fr 15. Jan 20:17:10 CET 2010\n\n\n\nSebastian\n"},{"id":"131753","messageId":"m2aawf1804.fsf@igel.home","threadId":"22228","inReplyTo":"4B50BE10.5010603@hartwork.org","subject":"Re: git clone against firewall","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-01-15T19:30:02Z","receivedAt":"2010-01-15T19:30:02Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Sebastian Pipping <webmaster@hartwork.org> writes:\n\n> I get a loop/freeze on\n>\n>   Trying 66.219.59.40...\n>\n> nothing more.  Can you deduce from that, what's happening?\n\nSo your firewall is dropping the packets on the floor.  Not much that\ncan be done about that.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"131754","messageId":"4B50C311.2040305@hartwork.org","threadId":"22228","inReplyTo":"m2aawf1804.fsf@igel.home","subject":"Re: git clone against firewall","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2010-01-15T19:33:37Z","receivedAt":"2010-01-15T19:33:37Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"On 01/15/10 20:30, Andreas Schwab wrote:\n> Sebastian Pipping <webmaster@hartwork.org> writes:\n> \n>> I get a loop/freeze on\n>>\n>>   Trying 66.219.59.40...\n>>\n>> nothing more.  Can you deduce from that, what's happening?\n> \n> So your firewall is dropping the packets on the floor.\n\nI see.\n\n\n> Not much that\n> can be done about that.\n\nMy problem actually is not the dropping but that git doesn't stop\ntrying.  I actually want it to fail.\n\n\n\nSebastian\n"},{"id":"131806","messageId":"20100115230357.GA10163@inner.home.ulmdo.de","threadId":"22228","inReplyTo":"4B50C311.2040305@hartwork.org","subject":"Re: git clone against firewall","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2010-01-15T23:03:57Z","receivedAt":"2010-01-15T23:03:57Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Fri, 15 Jan 2010 20:33:37 +0000, Sebastian Pipping wrote:\n...\n> > Not much that\n> > can be done about that.\n> \n> My problem actually is not the dropping but that git doesn't stop\n> trying.  I actually want it to fail.\n\nIt does. After the usual network timeout, which unfortunately is\na few minutes, and thus not really useful for trying several\nmachines:\n\n  74.43.91.xxx[0: 74.43.91.xxx]: errno=Connection timed out\n  fatal: unable to connect a socket (Connection timed out)\n\nAndreas\n"},{"id":"132003","messageId":"4B53C19B.1040809@hartwork.org","threadId":"22228","inReplyTo":"20100115230357.GA10163@inner.home.ulmdo.de","subject":"Re: git clone against firewall","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2010-01-18T02:04:11Z","receivedAt":"2010-01-18T02:04:11Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"On 01/16/10 00:03, Andreas Krey wrote:\n> It does. After the usual network timeout, which unfortunately is\n> a few minutes, and thus not really useful for trying several\n> machines:\n\nI would like to a ask for a timeout-after-n-seconds option then.\n\nThanks in advance!\n\n\n\nSebastian\n"}]}