Sudden loss of SSH container pass-through access [SOLVED]

I’m using Gitea inside Docker, was version 1.16.6, is now 1.16.9 and until recently the SSH pass-through had been working fine. But suddenly I’m getting the following error when I try to pull from an old repo.

Gitea: Invalid repo name
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

After a bit of digging I finally got a relevant error message by adding ENABLE_SSH_LOG = true to my app.ini though I’m not sure where to go from here.

gitea     | Accepted publickey for git from 172.18.0.1 port 45396 ssh2: RSA SHA256:...................
gitea     | 2022/07/20 02:20:34 ...s/private/ssh_log.go:27:SSHLog() [E] ssh: Invalid repo name: local/bin/gitea: 

The important part is at the end [E] ssh: Invalid repo name: local/bin/gitea:

So the first step in pass-through seems to be working, but then the gitea SSH server seems to be getting part of the authorized_keys command line passed to it? My authorized_keys file has the usual entries in it like…

command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini ......

The only things I can think of that could have changed are on my desktop, neither the host or docker image (prior to debugging) have been updated in weeks.

Wow! After a lot of random hammering on it I figured out a fix, though I don’t quite understand what the issue was, and especially don’t understand why it suddenly stopped working, those parts of the file were unlikely to have changed in almost a year.

Turns out the problem was having two ‘Gitea Host Key’ entries, one as a normal ssh-rsa entry and one in the command='..../gitea .... serv key-42', style. Commenting out the one starting with command= allowed me to pull/push again.