crawlab-team / crawlab

Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
https://www.crawlab.cn
BSD 3-Clause "New" or "Revised" License
11.38k stars 1.8k forks source link

git 拉取无效 #1224

Closed Ronghefeng closed 1 year ago

Ronghefeng commented 2 years ago

Bug 描述 在爬虫详情配置页,git 模块,点击拉取无反应,日志提示需要认证,但是在配置页已经添加认证账户和密码

版本描述

docker & docker-compose 5876b19387359109b90e01297c4cd46

crawlab e44cfa143f918edf5d43b3333857b7a

复现步骤 image

期望结果 可以拉取远程文件

日志报错信息 f6f7b0697d4d5bf32c0eeac740554bc

日志文件记录 err.log

ysslang commented 1 year ago

Same here. But when I clicked Pull, the error log is

empty git-upload-pack given
/go/pkg/mod/github.com/crawlab-team/go-trace@v0.1.1/trace.go:13 github.com/crawlab-team/go-trace.TraceError()
/go/pkg/mod/github.com/crawlab-team/crawlab-vcs@v0.6.0-beta.20211113.2048.0.20221024150201-467fe22630f8/git.go:172 github.com/crawlab-team/crawlab-vcs.(*GitClient).Pull()
/go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.1/controllers/spider.go:1082 github.com/crawlab-team/crawlab-core/controllers.(*spiderContext)._gitPull()
/go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.1/controllers/spider.go:577 github.com/crawlab-team/crawlab-core/controllers.(*spiderContext).gitPull()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next()
/go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.1/middlewares/auth.go:48 github.com/crawlab-team/crawlab-core/middlewares.AuthorizationMiddleware.func1()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next()
/go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.1/middlewares/cors.go:17 github.com/crawlab-team/crawlab-core/middlewares.CORSMiddleware.func1()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240 github.com/gin-gonic/gin.LoggerWithConfig.func1()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 github.com/gin-gonic/gin.(*Engine).ServeHTTP()
/usr/local/go/src/net/http/server.go:2868 net/http.serverHandler.ServeHTTP()
/usr/local/go/src/net/http/server.go:1933 net/http.(*conn).serve()
/usr/local/go/src/runtime/asm_amd64.s:1371 runtime.goexit()

And I found this was fixed here. Maybe we need to bump up the go-git kit?

Annisun2016 commented 1 year ago

版本: v6.0.1

image

tikazyq commented 1 year ago

版本: v6.0.1

image

是否为最新版本?

Annisun2016 commented 1 year ago

版本: v6.0.1 image

是否为最新版本?

是最新版,v6.0.1

tikazyq commented 1 year ago

现在是否还存在这样的问题?

rengwei777 commented 1 year ago

ssh: no key found 是什么问题

rengwei777 commented 1 year ago

使用git有更详细的教程吗

hy928302776 commented 1 year ago

git拉取无效解决了吗

image

点击拉取根本没用呀,求助

tikazyq commented 1 year ago

自2021年11月13日起,GitHub停止接受使用基本身份验证(Basic Authentication)的密码登录。这意味着你不能直接使用Basic Auth登录GitHub。

GitHub现在要求使用个人访问令牌(Personal Access Token,PAT)或使用SSH密钥进行身份验证。PAT是一个专门用于身份验证的令牌,你可以在GitHub的设置页面上生成和管理它。生成PAT后,你可以将其用作密码来访问GitHub的API、命令行界面或其他需要身份验证的应用程序。

如果你想使用命令行界面与GitHub进行交互,你可以使用PAT来代替密码进行认证。例如,在使用Git命令行进行操作时,你可以使用PAT作为密码。

需要注意的是,如果你已经生成了PAT,要妥善保管它,不要泄露给他人。PAT相当于你的密码,可以访问你有权限的GitHub资源。如果你怀疑PAT已经泄露,你可以在GitHub上撤销它,并生成一个新的。

总结来说,GitHub不再支持直接使用Basic Auth进行登录,而是要求使用个人访问令牌(PAT)或SSH密钥进行身份验证。

tikazyq commented 1 year ago

因此,在Crawlab中,如果你的仓库是GitHub代码仓库,请将你的密码替换成PAT,再进行拉取即可。