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

后端 未结 1 670
半阙折子戏
半阙折子戏 2020-12-18 09:07

I\'ve got a server with Gitolite installed to host my repos I created a new repo yesterday and today when I tried to push more commits to the server I am getting:

         


        
相关标签:
1条回答
  • 2020-12-18 09:29

    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.

    0 讨论(0)
提交回复
热议问题