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 fails with HTTP errors, typically 403 or 500.

Cause: There are a few possible causes, most often related to HTTP proxies, which have a hard time 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 can sometimes help.

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 provides one numerical IP address for each hostname (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, in this form:

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

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, so 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.