FeeiCN/Cobra

gitlab使用api报错

jiutans opened this issue · 5 comments

System and Python Environment

系统是CentOS7.6
python版本3.5

问题描述如下:
使用api添加扫描gitlab的任务时报错:
[2019-08-02 16:28:19,819] INFO [64] [REPORT] Report URL: ?sid=a4aebaytv1ni
[2019-08-02 16:28:19,825] INFO [399] [PICKUP] [CLONE] clone repository...
[2019-08-02 16:28:19,958] INFO [427] [PICKUP] [CLONE] fatal: could not read Username for 'http://git.yxzy**.com': Input/output error
[2019-08-02 16:28:19,960] INFO [431] [PICKUP] [CLONE] clone done. Switching to branch master
[2019-08-02 16:28:19,961] INFO [480] [PICKUP] No repo directory.
[2019-08-02 16:28:19,962] CRITICAL [109] Repository or branch not exist!
配置文件config相关配置如下:
[git]

拉取gitlab代码时,需要配置username和password

username:jen***
password:*****
private_token: wXn1Zidsic5hcohk9eNR

http://xxx.gitlab.com/api/v3/projects/all

gitlab_url: http://git.yxzy**.com/operate/
#gitlab_url:
cobra_ip: 172.16..

你在CLI模式下可以正常拉取代码吗

https://github.com/WhaleShark-Team/cobra/blob/7835a0cf4c696d61b71552b046374277d05bf144/cobra/pickup.py#L406-L427

可以看看这块的代码,检查一下 self.repo_usernameself.repo_password 是否正常

好的