Clone from public Codeberg repository fails with authentication required

Đang mở
#425 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

@cooktheryan đang làm issue này rồi.

Từ ngày 9/11/2026.

  • #426 của @cooktheryan — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, go
Lĩnh vực
devops

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 ❤️

Ngôn ngữ chính
Go
Star
178
Fork
25
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của containers/fetchit

Tất cả issue của containers/fetchit

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.