Skip to content

fix(aur): make host-key setup deterministic and diagnosable#45

Merged
vietanhdev merged 1 commit into
mainfrom
fix/aur-host-keys
Jul 20, 2026
Merged

fix(aur): make host-key setup deterministic and diagnosable#45
vietanhdev merged 1 commit into
mainfrom
fix/aur-host-keys

Conversation

@vietanhdev

Copy link
Copy Markdown
Owner

The AUR publish for v0.2.0 failed:

Cloning into '/tmp/aur-repo'...
Host key verification failed.
fatal: Could not read from remote repository.

Publishing to the AUR is a git push over SSH, so aur.archlinux.org's host key must be in known_hosts before git will connect.

Why it failed silently

The step already ran ssh-keyscan — but with 2>/dev/null. ssh-keyscan can return nothing while still exiting 0, so an empty result passed the set -e check and surfaced three lines later as an error about the host key, rather than about the scan that produced no keys.

That's the same shape as several bugs found this session: a step that can succeed while accomplishing nothing, where the eventual error names the wrong cause.

Changes

  • Assert the scan produced something, and print the count. An empty result now fails at the point it happens, naming the actual cause.
  • Absolute paths + explicit GIT_SSH_COMMAND, replacing ~/.ssh and a config file. The shell and the ssh that git spawns each resolve ~ from HOME independently, and in a container that's one more thing that can quietly differ — another route to exactly this error while the host key was never the problem.
  • IdentitiesOnly=yes so ssh doesn't offer some other key and get rejected before reaching ours.
  • StrictHostKeyChecking=yes retained — the point is to verify the host, not to skip verifying it.

Context

The key itself is known-good: I verified it authenticates as vietanhdev against aur.archlinux.org before setting the secret, and the dry run passed every step (Push to AUR is the one step a dry run skips).

Three of four channels are already live for v0.2.0 — GitHub release, the signed APT repo, and COPR (both arches). AUR is the last one.

The AUR push failed with

  Cloning into '/tmp/aur-repo'...
  Host key verification failed.

Publishing to the AUR is a git push over SSH, so aur.archlinux.org's host
key must be in known_hosts before git will connect. The step already ran
ssh-keyscan, but with 2>/dev/null -- and ssh-keyscan can return NOTHING
while still exiting 0, so an empty result passed silently and surfaced
three lines later as an error about the host key rather than about the
scan.

Now asserts the scan produced something and prints the count, so an empty
result fails at the point it happens with a message naming the cause.

Also drops ~/.ssh and the ssh config file in favour of absolute paths and
an explicit GIT_SSH_COMMAND. The shell and the ssh that git spawns each
resolve ~ from HOME independently, and in a container that is one more
thing that can quietly differ -- another way to arrive at exactly this
error while the host key was never the problem. IdentitiesOnly stops ssh
offering some other key and being rejected before it reaches ours.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
thinkutils e0a8990 Jul 20 2026, 07:17 AM

@vietanhdev
vietanhdev merged commit f029214 into main Jul 20, 2026
11 of 12 checks passed
@vietanhdev
vietanhdev deleted the fix/aur-host-keys branch July 20, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant