Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using repo sync for syncing Lineage OS 15.1 with

repo init -u https://github.com/LineageOS/android.git -b lineage-15.1

and I am getting a lot of the below errors repeatedly for different repositories

curl: (22) The requested URL returned error: 404 Not Found
Server does not provide clone.bundle; ignoring.
Cannot fetch LineageOS/android_external_lineage-sdk-api-coverage
warn: --force-broken, continuing to sync
fatal: unable to access 'https://github.com/LineageOS/android_external_lineage-sdk-api-coverage/': Could not resolve host: github.com
fatal: unable to access 'https://android.googlesource.com/platform/system/tpm/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
fatal: unable to access 'https://github.com/LineageOS/android_external_lineage-sdk-api-coverage/': gnutls_handshake() failed: Error in the pull function.
fatal: unable to access 'https://android.googlesource.com/platform/external/libcap/': gnutls_handshake() failed: Error in the pull function.
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: unable to access 'https://github.com/LineageOS/android_hardware_broadcom_libbt/': Empty reply from server
fatal: unable to access 'https://gerrit.googlesource.com/git-repo/': Failed to connect to gerrit.googlesource.com port 443: Connection timed out

and because of these errors repo sync stops with error: Exited sync due to fetch errors and because of that I used repo sync -f (--force broken flag) which is supposed to fix network errors (Not sure). My repo is still syncing (along with the errors) and I don't know whether I'll get proper synced files at the end or not. Can someone tell me what are these errors? why do they occur and how to fix them ? I can see some of them are network related but I not sure how many. Please help me fix these.

I have searched a few questions on SE but those errors had different backgrounds and were not related to repo (although obviously related to git).

My network speed : MAX 1MBps (which why it's confusing me more about those network issues that shouldn't happen generally)

I have come to a realization that a high speed connection is not enough, it has to be highly stable and consistent with its speed.

This change of network fixed most of the issues except the GnuTLS ones. Looked like gnutls demanded a corporate grade internet connection from me (which I couldn't afford) as it's highly sensitive to network fluctuations.

The git config --global http.postBuffer 1048576000 method didn't work.

I rebuilt git with openssl (guide) which reduced the fluctuation sensitivity to a great deal (when compared to gnutls).

After that the remaining errors where fixed by running repo sync -f again and again. It's not much of a solution but the lesson is that openssl works better with unstable and low bandwidth (that's if you call 1-2MBps a low bandwidth connection) connections.

I ran the following commands to tweak the TCP settings and use non-parallel commands. After that, I downloaded all the source code successfully:

sudo sysctl -w net.ipv4.tcp_window_scaling=0
repo sync -j1

Source: https://source.android.com/setup/build/downloading#troubleshooting-network-issues

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.