1 <html devsite> 2 <head> 3 <title>Source Sync Issues</title> 4 <meta name="project_path" value="/_project.yaml" /> 5 <meta name="book_path" value="/_book.yaml" /> 6 </head> 7 <body> 8 <!-- 9 Copyright 2017 The Android Open Source Project 10 11 Licensed under the Apache License, Version 2.0 (the "License"); 12 you may not use this file except in compliance with the License. 13 You may obtain a copy of the License at 14 15 http://www.apache.org/licenses/LICENSE-2.0 16 17 Unless required by applicable law or agreed to in writing, software 18 distributed under the License is distributed on an "AS IS" BASIS, 19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 See the License for the specific language governing permissions and 21 limitations under the License. 22 --> 23 24 <p>Even with our best care, small problems sometimes slip in. This page details 25 some known issues you may encounter while trying to sync the Android source code. 26 27 <h2 id="difficulties-syncing-the-source-code-proxy-issues"> 28 Difficulties syncing the source code (proxy issues)</h2> 29 <p><strong>Symptom</strong>: <code>repo init</code> or <code>repo sync</code> fail with http errors, 30 typically 403 or 500.</p> 31 <p><strong>Cause</strong>: There are quite a few possible causes, most often 32 related to http proxies, which have difficulties handling the 33 large amounts of data getting transferred.</p> 34 <p><strong>Fix</strong>: While there's no general solution, using python 2.7 35 and explicitly using <code>repo sync -j1</code> have been reported to 36 improve the situation for some users.</p> 37 38 <h2 id="difficulties-syncing-the-source-tree-dns-issues"> 39 Difficulties syncing the source tree (DNS issues)</h2> 40 <p><strong>Symptom</strong>: When running <code>repo sync</code>, the process fails with 41 various errors related to not recognizing the hostname. One such 42 error is <code><urlopen error [Errno -2] Name or service not known></code>.</p> 43 <p><strong>Cause</strong>: Some DNS systems have a hard time coping with the 44 high number of queries involved in syncing the source tree 45 (there can be several hundred requests in a worst-case scenario).</p> 46 <p><strong>Fix</strong>: Manually resolve the relevant hostnames, and hard-code 47 those results locally.</p> 48 <p>You can resolve them with the <code>nslookup</code> command, which will give 49 you one numerical IP address for each of those (typically in the 50 "Address" part of the output).</p> 51 <pre class="devsite-click-to-copy"> 52 <code class="devsite-terminal">nslookup googlesource.com</code> 53 <code class="devsite-terminal">nslookup android.googlesource.com</code> 54 </pre> 55 <p>You can then hard-code them locally by editing <code>/etc/hosts</code>, and 56 adding two lines in that file, of the form:</p> 57 <pre class="devsite-click-to-copy"> 58 aaa.bbb.ccc.ddd googlesource.com 59 eee.fff.ggg.hhh android.googlesource.com 60 </pre> 61 <p>Note that this will only work as long as the servers' addresses 62 don't change, and if they do and you can't connect you'll have 63 to resolve those hostnames again and edit <code>etc/hosts</code> accordingly.</p> 64 65 <h2 id="difficulties-syncing-the-source-tree-tcp-issues"> 66 Difficulties syncing the source tree (TCP issues)</h2> 67 <p><strong>Symptom</strong>: <code>repo sync</code> hangs while syncing, often when it's 68 completed 99% of the sync.</p> 69 <p><strong>Cause</strong>: Some settings in the TCP/IP stack cause difficulties 70 in some network environments, such that <code>repo sync</code> neither completes 71 nor fails.</p> 72 <p><strong>Fix</strong>: On Linux, enter the command:</p> 73 <pre class="devsite-terminal devsite-click-to-copy">sysctl -w net.ipv4.tcp_window_scaling=0</pre> 74 <p>On MacOS, disable the rfc1323 extension in the network settings.</p> 75 76 77 </body> 78 </html> 79