Getting fatal: object is corrupted when pushing to a remote repo

橙三吉。 提交于 2019-11-29 07:57:55
VonC

As seen in the comments, any additional repo has an issue during its creation (ie when pushing back the gitolite-admin repo with the gitolite.conf file declaring a new repo)

I didn't notice this before but when I create a new repo I'm getting the following error:

remote: line 1 too long: command="/home/git/gitolite/src/gitolite... 
remote: FATAL: fingerprinting failed for /tmp/Cdug9Itivq 

But it's creating the repo in /home/git/repositories

This operation takes place in a post-compilation trigger called ssh-authkeys:

sub fp_file {
    return $selinux++ if $selinux; # return a unique "fingerprint" to prevent noise
    my $f = shift;
    my $fp = `ssh-keygen -l -f '$f'`;
    chomp($fp);
    _die "fingerprinting failed for '$f'" unless $fp =~ /([0-9a-f][0-9a-f](:[0-9a-f][0-9a-f])+)/;
    $fp = $1;
    return $fp;
}

That means ssh-keygen -l -f <path_to_public_key.pub> doesn't follow the right pattern, as shown in "self service key management".

Make sure that your key is generated like:

ssh-keygen -t rsa -f "${H}/.ssh/git" -C "Gitolite Admin access (not interactive)" -q -P ""

Update April 2015:

As mentioned by starfry in "Gitolite - remote: FATAL: fingerprinting failed for 'keydir/'":

There was a change to the key fingerprint format in OpenSSH at version 6.8:

Add FingerprintHash option to ssh(1) and sshd(8), and equivalent command-line flags to the other tools to control algorithm used for key fingerprints. The default changes from MD5 to SHA256 and format from hex to base64.

Fingerprints now have the hash algorithm prepended.
An example of the new format:

SHA256:mVPwvezndPv/ARoIadVY98vAC0g+P/5633yTC4d/wXE

Please note that visual host keys will also be different.

The latest git checkout of gitolite is aware, since 18th March '15, of this new format.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!