Source Sync Issues

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.

Difficulties syncing the source code (proxy issues)

Symptom: repo init or repo sync fail with http errors, typically 403 or 500.

Cause: There are quite a few possible causes, most often related to http proxies, which have difficulties handling the large amounts of data getting transferred.

Fix: While there's no general solution, using python 2.7 and explicitly using repo sync -j1 have been reported to improve the situation for some users.

Difficulties syncing the source tree (DNS issues)

Symptom: When running repo sync, the process fails with various errors related to not recognizing the hostname. One such error is <urlopen error [Errno -2] Name or service not known>.

Cause: 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).

Fix: Manually resolve the relevant hostnames, and hard-code those results locally.

You can resolve them with the nslookup command, which will give you one numerical IP address for each of those (typically in the "Address" part of the output).

nslookup googlesource.com
nslookup android.googlesource.com

You can then hard-code them locally by editing /etc/hosts, and adding two lines in that file, of the form:

aaa.bbb.ccc.ddd googlesource.com
eee.fff.ggg.hhh android.googlesource.com

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 etc/hosts accordingly.

Difficulties syncing the source tree (TCP issues)

Symptom: repo sync hangs while syncing, often when it's completed 99% of the sync.

Cause: Some settings in the TCP/IP stack cause difficulties in some network environments, such that repo sync neither completes nor fails.

Fix: On Linux, enter the command:

sysctl -w net.ipv4.tcp_window_scaling=0

On MacOS, disable the rfc1323 extension in the network settings.