Clone from public Codeberg repository fails with authentication required

オープン
#425 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

@cooktheryan がすでに取り組んでいます。

2026年11月9日 から。

  • #426 @cooktheryan による — オープン

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
git, go
領域
devops

調査の方向性

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時間
マージ済み PR(30日)
2

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

containers/fetchit のほかの issue

containers/fetchit の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。