{"id":318,"date":"2011-10-30T14:07:03","date_gmt":"2011-10-30T19:07:03","guid":{"rendered":"http:\/\/www.rajatswarup.com\/blog\/?p=318"},"modified":"2011-10-30T14:08:18","modified_gmt":"2011-10-30T19:08:18","slug":"android-source-downloading-errors","status":"publish","type":"post","link":"https:\/\/www.rajatswarup.com\/blog\/2011\/10\/30\/android-source-downloading-errors\/","title":{"rendered":"Android Source Downloading Errors"},"content":{"rendered":"<p>Over this weekend I decided to download the Android source tree on my computer (Backtrack 4 R2). The BT4R2 is no longer supported by the Offsec\/Backtrack guys (mutt, purehate, etc.).<br \/>\nTo start off with I tried to follow the instructions listed <a href=\"http:\/\/source.android.com\/source\/downloading.html\">here<\/a>.<br \/>\nThe first error I got was with Git, I was using a version earlier than 1.5.4.  So I downloaded git version 1.7.4, compiled it and installed it. Then I got the error:<br \/>\n<code>fatal: unable to find remote handler for 'https'<\/code><br \/>\nToo bad, I tried recompiling and what not, and I did have openssl&#8230;so what was the problem?<br \/>\nThe problem was not having libcurl-devel library.  So I downloaded the library and launched configure, make clean, make and make install to reinstall git.  Now the error was gone.<\/p>\n<p>On the step where I am supposed to execute the following:<br \/>\n<code>$ repo init -u https:\/\/android.googlesource.com\/platform\/manifest<\/code><br \/>\nI got the following error:<br \/>\n<code><br \/>\nException in thread Thread-1:<br \/>\nTraceback (most recent call last):<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 486, in __bootstrap_inner<br \/>\nself.run()<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 446, in run<br \/>\nself.__target(*self.__args, **self.__kwargs)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/subcmds\/sync.py\", line 182, in _FetchHelper<br \/>\nsuccess = project.Sync_NetworkHalf(quiet=opt.quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 926, in Sync_NetworkHalf<br \/>\nif alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1444, in _ApplyCloneBundle<br \/>\nexist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1514, in _FetchBundle<br \/>\nsize = r.headers['content-length']<br \/>\nFile \"\/usr\/lib\/python2.5\/rfc822.py\", line 384, in __getitem__<br \/>\nreturn self.dict[name.lower()]<br \/>\nKeyError: 'content-length'<br \/>\nException in thread Thread-3:<br \/>\nTraceback (most recent call last):<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 486, in __bootstrap_inner<br \/>\nself.run()<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 446, in run<br \/>\nself.__target(*self.__args, **self.__kwargs)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/subcmds\/sync.py\", line 182, in _FetchHelper<br \/>\nsuccess = project.Sync_NetworkHalf(quiet=opt.quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 926, in Sync_NetworkHalf<br \/>\nif alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1444, in _ApplyCloneBundle<br \/>\nexist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1514, in _FetchBundle<br \/>\nsize = r.headers['content-length']<br \/>\nFile \"\/usr\/lib\/python2.5\/rfc822.py\", line 384, in __getitem__<br \/>\nreturn self.dict[name.lower()]<br \/>\nKeyError: 'content-length'<br \/>\nException in thread Thread-4:<br \/>\nTraceback (most recent call last):<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 486, in __bootstrap_inner<br \/>\nself.run()<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 446, in run<br \/>\nself.__target(*self.__args, **self.__kwargs)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/subcmds\/sync.py\", line 182, in _FetchHelper<br \/>\nsuccess = project.Sync_NetworkHalf(quiet=opt.quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 926, in Sync_NetworkHalf<br \/>\nif alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1444, in _ApplyCloneBundle<br \/>\nexist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1514, in _FetchBundle<br \/>\nsize = r.headers['content-length']<br \/>\nFile \"\/usr\/lib\/python2.5\/rfc822.py\", line 384, in __getitem__<br \/>\nreturn self.dict[name.lower()]<br \/>\nKeyError: 'content-length'<br \/>\nException in thread Thread-2:<br \/>\nTraceback (most recent call last):<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 486, in __bootstrap_inner<br \/>\nself.run()<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 446, in run<br \/>\nself.__target(*self.__args, **self.__kwargs)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/subcmds\/sync.py\", line 182, in _FetchHelper<br \/>\nsuccess = project.Sync_NetworkHalf(quiet=opt.quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 926, in Sync_NetworkHalf<br \/>\nif alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1444, in _ApplyCloneBundle<br \/>\nexist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1514, in _FetchBundle<br \/>\nsize = r.headers['content-length']<br \/>\nFile \"\/usr\/lib\/python2.5\/rfc822.py\", line 384, in __getitem__<br \/>\nreturn self.dict[name.lower()]<br \/>\nKeyError: 'content-length'<br \/>\nException in thread Thread-5:<br \/>\nTraceback (most recent call last):<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 486, in __bootstrap_inner<br \/>\nself.run()<br \/>\nFile \"\/usr\/lib\/python2.5\/threading.py\", line 446, in run<br \/>\nself.__target(*self.__args, **self.__kwargs)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/subcmds\/sync.py\", line 182, in _FetchHelper<br \/>\nsuccess = project.Sync_NetworkHalf(quiet=opt.quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 926, in Sync_NetworkHalf<br \/>\nif alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1444, in _ApplyCloneBundle<br \/>\nexist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br \/>\nFile \"\/home\/user\/bin\/.repo\/repo\/project.py\", line 1514, in _FetchBundle<br \/>\nsize = r.headers['content-length']<br \/>\nFile \"\/usr\/lib\/python2.5\/rfc822.py\", line 384, in __getitem__<br \/>\nreturn self.dict[name.lower()]<br \/>\nKeyError: 'content-length'<br \/>\nerror: Exited sync due to fetch errors<br \/>\n<\/code><\/p>\n<p>Seems like this error is caused because the content-length http header is not sent by the repository.  If you upgrade to Python 2.7.x you can resolve this error.<br \/>\nNow if you are compiling Python from source, it doesn&#8217;t come by default with SSL support.  So to add SSL support you should edit the Python-2.7\/Modules\/Setup file and uncomment four lines:<br \/>\n<code>_socket socketmodule.c<br \/>\n# Socket module helper for SSL support; you must comment out the other<br \/>\n# socket line above, and possibly edit the SSL variable:<br \/>\nSSL=\/usr<br \/>\n_ssl _ssl.c \\<br \/>\n        -DUSE_SSL -I$(SSL)\/include -I$(SSL)\/include\/openssl \\<br \/>\n        -L$(SSL)\/lib -lssl -lcrypto<\/code><br \/>\nOf course, then you can do the standard steps to compile and install python:<br \/>\n<code>$ .\/configure<br \/>\n$ make<br \/>\n$ sudo make install<\/code><\/p>\n<p>repo sync would work very well thereafter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over this weekend I decided to download the Android source tree on my computer (Backtrack 4 R2). The BT4R2 is no longer supported by the Offsec\/Backtrack guys (mutt, purehate, etc.). To start off with I tried to follow the instructions listed here. The first error I got was with Git, I was using a version [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[445,229,443,444,236],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-howto","tag-android","tag-error","tag-git","tag-repo","tag-ssl"],"_links":{"self":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":4,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions\/325"}],"wp:attachment":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}