解决:error: Cannot fetch repo (TypeError: expected string or buffer)

同步源码,问题重现:

 Fetching project platform/external/libopus
Fetching project repo
error: Cannot fetch repo (TypeError: expected string or buffer)
Fetching project CyanogenMod/android_external_tinycompress
Exception in thread Thread-:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line , in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line , in run
self.__target(*self.__args, **self.__kwargs)
File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line , in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line , in _FetchHelper
prune=opt.prune)
File "/home/dinphy/sm/.repo/repo/project.py", line , in Sync_NetworkHalf
no_tags=no_tags, prune=prune)):
File "/home/dinphy/sm/.repo/repo/project.py", line , in _RemoteFetch
if remote.PreConnectFetch():
File "/home/dinphy/sm/.repo/repo/git_config.py", line , in PreConnectFetch
return _preconnect(connectionUrl)
File "/home/dinphy/sm/.repo/repo/git_config.py", line , in _preconnect
m = URI_ALL.match(url)
TypeError: expected string or buffer

分析问题,寻找方案:

1、问题所在:主要是repo的问题,只需要重新下载repo即可。

2、下载repo需要IP代理,http://www.cnblogs.com/dinphy/p/5619854.html

3、终端输入命令重新下载repo并初始化:

#新建bin目录
mkdir ~/bin #指定路径
PATH=~/bin:$PATH #下载repo,并移动到bin目录下
curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo #给repo赋予读写权限
chmod a+x ~/bin/repo

4、回到项目的目录,重新初始化源码,然后repo sync

5、OK,完美结束。

上一篇:python+selenium十四:xpath和contains模糊匹配


下一篇:Ansible自动化运维工具-上