blob: ef229a2831b5e6bef6fe3c09b968420abbcbab7b [file] [log] [blame]
<html devsite>
<head>
<title>Source Sync Issues</title>
<meta name="project_path" value="/_project.yaml" />
<meta name="book_path" value="/_book.yaml" />
</head>
<body>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p>Even with our best care, small problems sometimes slip in. This page details
some known issues you may encounter while trying to sync the Android source code
.</p>
<h2 id="difficulties-syncing-the-source-code-proxy-issues">
Difficulties syncing the source code (proxy issues)</h2>
<p><strong>Symptom:</strong> <code>repo init</code> or <code>repo sync</code>
fail with http errors, typically 403 or 500.</p>
<p><strong>Cause:</strong> There are quite a few possible causes, most often
related to http proxies, which have difficulties handling the
large amounts of data getting transferred.</p>
<p><strong>Fix:</strong> While there's no general solution, using python 2.7
and explicitly using <code>repo sync -j1</code> have been reported to
improve the situation for some users.</p>
<h2 id="difficulties-syncing-the-source-tree-dns-issues">
Difficulties syncing the source tree (DNS issues)</h2>
<p><strong>Symptom:</strong> When running <code>repo sync</code>, the process
fails with various errors related to not recognizing the hostname. One such
error is <code>&lt;urlopen error [Errno -2] Name or service not known&gt;</code>
.</p>
<p><strong>Cause:</strong> Some DNS systems have a hard time coping with the
high number of queries involved in syncing the source tree
(there can be several hundred requests in a worst-case scenario).</p>
<p><strong>Fix:</strong> Manually resolve the relevant hostnames, and hard-code
those results locally.</p>
<p>You can resolve them with the <code>nslookup</code> command, which will give
you one numerical IP address for each of those (typically in the
"Address" part of the output).</p>
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">nslookup googlesource.com</code>
<code class="devsite-terminal">nslookup android.googlesource.com</code>
</pre>
<p>You can then hard-code them locally by editing <code>/etc/hosts</code>, and
adding two lines in that file, of the form:</p>
<pre class="devsite-click-to-copy">
aaa.bbb.ccc.ddd googlesource.com
eee.fff.ggg.hhh android.googlesource.com
</pre>
<p>Note that this will only work as long as the servers' addresses
don't change, and if they do and you can't connect you'll have
to resolve those hostnames again and edit <code>etc/hosts</code> accordingly.</p>
<h2 id="difficulties-syncing-the-source-tree-tcp-issues">
Difficulties syncing the source tree (TCP issues)</h2>
<p><strong>Symptom:</strong> <code>repo sync</code> hangs while syncing, often when it's
completed 99% of the sync.</p>
<p><strong>Cause:</strong> Some settings in the TCP/IP stack cause difficulties
in some network environments, such that <code>repo sync</code> neither completes
nor fails.</p>
<p><strong>Fix:</strong> On Linux, enter the command:</p>
<pre class="devsite-terminal devsite-click-to-copy">sysctl -w net.ipv4.tcp_window_scaling=0</pre>
<p>On MacOS, disable the rfc1323 extension in the network settings.</p>
</body>
</html>