Skip to content

Mirror to Git Forges: 3 of 7 forges broken — Gitea's host variable expands to EMPTY, Disroot/Bitbucket keys rejected #845

Open

Description

@hyperpolymath

Summary

Mirror to Git Forges has failed on every recent run of main, and 3 of
its 7 forge jobs are broken for three different reasons. One of them is a
silent empty-variable expansion, not an auth problem — which matters, because
the three look identical from the workflow list.

This is pre-existing and unrelated to #842: red at 450734e, 4fa2e39,
c18608e, 1b2e66e5 and 0aa89724.

Measured — run 35772116797 @ 450734ea021167b2d9c2a85e9976bc6708deb379

Job Result
mirror-gitlab ✅ success
mirror-codeberg ✅ success
mirror-radicle ✅ success
mirror-sourcehut ✅ success
mirror-gitea ❌ empty host variable
mirror-disroot ❌ Permission denied (publickey)
mirror-bitbucket ❌ Could not read from remote repository

Fault 1 — mirror-gitea: the host expands to the empty string

Step 4 Mirror to Gitea runs:

ssh-keyscan -t ed25519  >> ~/.ssh/known_hosts
                       ^^ two spaces -- the host argument is MISSING

ssh-keyscan then prints its usage line ([-t type] [host | addrlist namelist]) and exits non-zero. Compare the sibling jobs, where the host is
present and correct:

ssh-keyscan -t ed25519 git.disroot.org >> ~/.ssh/known_hosts
ssh-keyscan -t ed25519 bitbucket.org   >> ~/.ssh/known_hosts

So the secret or variable supplying the Gitea host does not exist, and
GitHub expanded it to empty rather than failing. This is not an authentication
fault and will not be fixed by rotating a key — the job never learned which
host to contact.

⚠ A nonexistent secret resolves EMPTY and silently. The job name says
"Gitea", the log says ssh-keyscan failed, and neither says "your variable is
undefined". Any ${{ secrets.X }} / ${{ vars.X }} used as a command
argument
needs an explicit non-empty assertion before use.

Faults 2 and 3 — mirror-disroot and mirror-bitbucket: the key is not authorized

disroot:   [email protected]: Permission denied (publickey).
bitbucket: fatal: Could not read from remote repository.

Host resolution is fine (both keyscans carry a real hostname). The deploy key
presented is not accepted by the remote. Either the public key is not
registered on that forge, the wrong private key is in the secret, or the remote
repository does not exist under the configured path.

These two need an owner action (registering a public key on those forges);
fault 1 does not — it is a workflow/config fix.

Acceptance criteria

  1. Every host-valued secret/var is asserted non-empty before use. Add a
    guard step per forge that fails with a named message
    (GITEA_HOST is unset or empty) rather than passing an empty argument to
    ssh-keyscan. Applies to all 7 jobs, not just Gitea.
  2. Mutant: blank one forge's host variable deliberately; the job must fail
    at the assertion naming that variable, not at ssh-keyscan usage.
    Restore it; green returns.
  3. The workflow reports a denominator: mirrored N of 7 forges. A run where
    some forges are deliberately unconfigured must state which were skipped and
    why — a skip must never read as a mirror.
  4. Decide per forge: configure or remove. A permanently-failing mirror job
    trains everyone to ignore a red workflow. If Disroot/Bitbucket/Gitea are not
    wanted, delete those jobs; if they are, register the keys and prove a push
    lands by checking the mirrored ref's SHA equals main.
  5. Verify by state, not exit code: after a green run, fetch each mirror's
    default-branch SHA and assert it equals hypatia main. A mirror job that
    pushes nothing can still exit 0.

Context

Found while accounting for every red on main after #842 (450734e). The
other three reds are tracked: #843 (E2E), #844 (Security), #520 (Governance
baseline). This was the only untracked one.

Activity

  1. added
    bug
    on Sep 22, 2026
  2. added
    priority:p2
    scope:repo
    status:ready
    on Sep 30, 2026
  3. hyperpolymath commented on Nov 1, 2026

    @hyperpolymath
    OwnerAuthor

    Fresh diagnosis — 2026-11-01

    Current main push run 41249464519 still fails four mirror jobs. The reusable's host-key guard is behaving correctly: it refuses missing host/fingerprint configuration rather than silently trusting ssh-keyscan. This is not a reason to relax host checking.

    Forge Confirmed failure Needed action
    SourceHut MIRROR_HOST=git.sr.ht, but APPROVED_FINGERPRINT empty (job 124679746104) Independently verify the current ED25519 SSH host fingerprint and configure SOURCEHUT_SSH_FINGERPRINT
    Disroot MIRROR_HOST=git.disroot.org, but APPROVED_FINGERPRINT empty (job 124679746002) Independently verify and configure DISROOT_SSH_FINGERPRINT; only then inspect authentication if the push fails
    Gitea Both MIRROR_HOST and APPROVED_FINGERPRINT empty (job 124679745962) Configure GITEA_HOST and its independently verified GITEA_SSH_FINGERPRINT
    Bitbucket ED25519 host fingerprint passed; push to [email protected]:hyperpolymath-dev/hypatia.git fails with 'repository missing or inaccessible' (job 124679746076) Check target repo existence, write permissions and that the uploaded public key corresponds to the configured BITBUCKET_SSH_KEY

    A private key was loaded for each of these four jobs. This does not establish that the corresponding forge accepted that identity. Avoid rotating keys without first distinguishing missing target repository, wrong account, and missing write permission.

    If any forge is intentionally not configured, set the corresponding <FORGE>_MIRROR_ENABLED variable to false so the existing reusable records an explicit skip. Do not automatically disable an intended mirror to obtain a green result. Once configured, acceptance requires checking the destination branch SHA matches the source main SHA (issue AC5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:p2scope:repostatus:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions