Clone from public Codeberg repository fails with authentication required
评估
调研方向
Start with the clone path in pkg/engine/fetchit.go, where git.CloneOptions.Auth is always set to githttp.BasicAuth, then check the same pattern in pkg/engine/mirrors.go. Reproduce by cloning the public Codeberg repo with no credentials configured. Done means an anonymous clone of a public repository succeeds, and clones with credentials still send them.
由索引模型根据 Issue 内容生成。
描述
I'm experiencing an issue when Fetchit tries to clone a public repository hosted on Codeberg.
The repository is: https://codeberg.org/dunossauro/obs-pods
Fetchit returns the following error:
podman run --replace --name fetchit -v fetchit-volume:/opt -v "$HOME/.fetchit:/opt/mount" -v "/run/podman/podman.sock:/run/podman/podman.sock" --security-opt label=disable quay.io/fetchit/fetchit:latest
initializing fetchit
starting fetchit
2026-11-03T22:05:51.087Z INFO engine/fetchit.go:531 git clone https://codeberg.org/dunossauro/obs-pods main --recursive
2026-11-03T22:05:51.831Z INFO engine/fetchit.go:563 git clone failed: authentication required: Credentials are incorrect or have expired. Retry your command or see https://codeberg.org/forgejo/forgejo/issues/2809 for more information
My poor investigation (sorry, I don't know much about Go)
I tried to investigate the clone implementation in pkg/engine/fetchit.go.
The current implementation always initializes git.CloneOptions.Auth with githttp.BasicAuth, even when no username or password is configured.
I also created an isolated Go test using the exact same go-git version used by Fetchit: github.com/go-git/go-git/v5 v5.19.2
The following operation succeeds:
git.PlainClone(
"/tmp/obs-pods-gogit",
false,
&git.CloneOptions{
URL: "https://codeberg.org/dunossauro/obs-pods",
ReferenceName: plumbing.NewBranchReferenceName("main"),
SingleBranch: true,
},
)
Output: CLONE SUCCESS
No authentication is required. I also confirmed that the repository has no .gitmodules file, so submodules are not involved.
Suspected cause
Fetchit unconditionally configures HTTP Basic Authentication, even when credentials are empty.
Could this be causing Codeberg/Forgejo to reject the anonymous clone request?
Would it make sense to configure CloneOptions.Auth only when credentials are actually provided?
The same behavior should also be reviewed in pkg/engine/mirrors.go.
Environment
- Fetchit image: quay.io/fetchit/fetchit:latest
- Go dependency: go-git v5.19.2
- Repository host: Codeberg / Forgejo
- Repository visibility: Public
- Authentication: None intended
Really thanks for this amazing project ❤️
- 主要语言
- Go
- 星标
- 178
- 派生
- 25
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 2
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
containers/fetchit 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
containers/fetchit#429 ·
-
难度 5/5 一周以上 新手友好度 25/100
containers/fetchit#242 ·
-
packaging the fetchit systemd services into RPM?可能重新可做 @cooktheryan 于 1557 天前认领,目前没有进行中的 PR。 未关闭
containers/fetchit#218 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 25/100
containers/fetchit#216 · 2 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
containers/fetchit#210 ·
查看 containers/fetchit 的全部 Issue
相似的 Issue
-
Area/Agent Lifecycle Aspect/Build & Deploy Severity/Major Type/Bug
难度 2/5 1-3 小时 新手友好度 86/100
wso2/agent-manager#2603 ·
维护者通常 1 天内回复
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it out可能已有人在做 @anoop2811 今天认领。 未关闭needs-triage type/enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Area/Policies Aspect/API Severity/Major Type/Bug
难度 2/5 1-3 小时 新手友好度 76/100
wso2/api-platform#4468 ·
维护者通常 1 天内回复
-
review: medium
难度 2/5 1-3 小时 新手友好度 78/100
1lck/Lithe-IDEA#2432 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
dsx-ai-factory/health-validation#368 ·
维护者通常 2 天内回复