Clone from public Codeberg repository fails with authentication required

Abierto
#425 3 comentarios 1 reacción 0 asignados Ver en GitHub

@cooktheryan ya está trabajando en esto.

Desde el 9/11/2026.

  • #426 de @cooktheryan — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, go
Área
devops

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
178
Forks
25
Merge medio
1 d 2 h
PR fusionados (30 d)
2

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de containers/fetchit

Todos los issues de containers/fetchit

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.