Gitlab/Gitolite issue while cloning repo

前端 未结 2 2038
自闭症患者
自闭症患者 2021-01-01 05:19

I have setup a Gitlab strictly according to manual from the gitlab wiki. It works. I have a web access, I can create a project too (and git repo has been created after it).

相关标签:
2条回答
  • 2021-01-01 06:15

    Okay, I think I've got it.

    When I add key for the user from web interface, it hasn't been added to authorized_keys file. What I do is make full delete of the gitolite installation and then reinstall it according to native manual from the gitolite wiki. Now when i've add a key to user, this key is added to authorized_keys and all works fine now.

    0 讨论(0)
  • 2021-01-01 06:22

    That means that:

    • ether your public/private ssh keys aren't found locally (in your ~/.ssh directory)
    • or the public key hasn't been registered in the server ~/.ssh/authorized_keys by gitlab (which seems to be the case here: addig your ssh key should trigger its publication by gitlab).
      This is similar to GitLab issue 900.
      You could have copy-paste your key with linebreaks in it.

    Remove linebreaks from key before persisting.

    You will know more with a:

    ssh -vvv git@git.myserver.com
    

    Note that all operations on the server are done as user 'git', which is why it falls back asking the git password. This is how gitolite works with ssh.


    As the OP mentions, the issue was about gitolite not being properly installed.
    This is the kind of issue which should be detected by the "verification step" of GitLab:

    sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
    

    It should produce, regarding gitolite (I have added the 'vvv' and '^^^' for emphasis):

    # OUTPUT EXAMPLE
    Starting diagnostic
    config/database.yml............exists
    config/gitlab.yml............exists
    /home/git/repositories/............exists
    /home/git/repositories/ is writable?............YES
    
    vvvvvvvvvvvvvvvvvvv
    
    remote: Counting objects: 603, done.
    remote: Compressing objects: 100% (466/466), done.
    remote: Total 603 (delta 174), reused 0 (delta 0)
    Receiving objects: 100% (603/603), 53.29 KiB, done.
    Resolving deltas: 100% (174/174), done.
    Can clone gitolite-admin?............YES
    
    ^^^^^^^^^^^^^^^^^^
    
    UMASK for .gitolite.rc is 0007? ............YES
    

    If it does not, then a re-installation of Gitolite is in order.

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