<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HostingFu &#187; subversion</title>
	<atom:link href="http://hostingfu.com/tag/subversion/feed" rel="self" type="application/rss+xml" />
	<link>http://hostingfu.com</link>
	<description>Web Hosting Blog by a Software Developer</description>
	<lastBuildDate>Mon, 19 Jul 2010 09:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Subversion Error OPTIONS of &#8220;&#8230;&#8221; could not connect to server &#8211; Fixed!</title>
		<link>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes</link>
		<comments>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:31:57 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes</guid>
		<description><![CDATA[Tried to set up a new VPS last night &#8212; a Xen VPS with stock kernel 2.6.18. Picked Debian 5 Lenny as operating system, and then upgrade to Squeeze using apt-get dist-upgrade. Smooth sailing so far. Until I tried to pull some of the toolchains I was trying to build from a remote subversion repository. [...]]]></description>
			<content:encoded><![CDATA[<p>Tried to set up a new VPS last night &#8212; a Xen VPS with stock kernel 2.6.18. Picked <a href="http://wiki.debian.org/DebianLenny">Debian 5 Lenny</a> as operating system, and then upgrade to <a href="http://wiki.debian.org/DebianSqueeze">Squeeze</a> using <code>apt-get dist-upgrade</code>. Smooth sailing so far. Until I tried to pull some of the toolchains I was trying to build from a remote subversion repository.</p>
<p>For example to pull the latest <a href="http://wordpress.org/">WordPress</a>.</p>
<pre class="code">
$ svn co http://core.svn.wordpress.org/trunk/
svn: OPTIONS of 'http://core.svn.wordpress.org/trunk': could not connect to server (http://core.svn.wordpress.org)
</pre>
<p>Definitely not a network issue as <em>every single Subversion repository over HTTP</em> is returning the same problem. A bit of gooling seems to suggest that <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531338">neon is to blame</a> (neon is the HTTP/WebDAV client library used by Subversion). Doing strace shows that:</p>
<pre class="code">
...
close(4)                                = 0
socket(PF_INET, <b>0x80001</b> /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
write(2, "svn: OPTIONS of 'http://core.svn."..., 115svn: OPTIONS of 'http://core.svn.wordpress.org/trunk': could not connect to server (http://core.svn.wordpress.org)
) = 115
exit_group(1)                           = ?
</pre>
<p>Well. According to <code>/usr/include/bits/socket.h</code>, 0&#215;80000 is <code>SOCK_CLOEXEC</code> (<em>Atomically set close-on-exec flag for the new descriptor(s).</em>), which is <a href="http://lists.manyfish.co.uk/pipermail/neon/2009-June/001021.html">not supported on Linux kernel older than 2.6.27</a>. Here comes the problem of para-virtualisation and operating system jails &#8212; you are still running the virtualised kernel supplied by your vendor. Almost all of my VPS &#8212; Xen or OpenVZ &#8212; runs on Linux kernel 2.6.18 as it&#8217;s the kernel of choice for RHEL 5 where many virtualisation vendors want to support.</p>
<p>D&#8217;oh.</p>
<p>Well. Instead of rebuilding subversion with an older neon library, here is a <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531338#20">much simpler work-around</a> posted on Debian&#8217;s mailing list.</p>
<pre class="code">
$ echo 'http-library=self' &gt;&gt; ~/.subversion/servers
</pre>
<p>Done! Subversion should now be working on the older kernels.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
