【原创】gitlab私服:No user&…

来源:互联网 发布:linux ftp连接数 编辑:程序博客网 时间:2024/05/16 09:08
今天搭了一个GitLab私服,然后再服务器上模拟操作pull push都可以,用我自己的电脑clone的时候就出问题了,一直报错:
$ git clone git@zhangzhipeng2023.cn:yzs/xxx.git
Cloning into 'xxx'...
GitLab: No user or key wasprovided.
fatal: Could not read from remote repository.

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

首先,我配置的gitlab端口是3344,我在nginx的配置中是没有配3344的,只是gitlab的配置中配置了external_url=www.zhangzhipeng2023.cn:3344。

[zhipeng@zhangzhipeng2023.cn nginx]$sudo netstat-aponl|grep nginx
[sudo] password for zhipeng:
tcp       0     0 0.0.0.0:1314          0.0.0.0:*             LISTEN    11444/nginx: master  off(0.00/0/0)
tcp       0     0 0.0.0.0:3344          0.0.0.0:*             LISTEN     32356/nginx: master  off(0.00/0/0)
unix  2     [ ACC ]    STREAM     LISTENING    221191  9619/SCREEN        /var/run/screen/S-zhipeng/9619.nginx
unix  3     [ ]        STREAM    CONNECTED    226483   11444/nginx: master
unix  3     [ ]        STREAM    CONNECTED    196061   32356/nginx: master
unix  3     [ ]        STREAM    CONNECTED    226484   11444/nginx: master
unix  3     [ ]        STREAM    CONNECTED    196062   32356/nginx: master

既然是nginx的管理的端口,那在nginx日志中找呗,但是找了很久也没找到有用的信息。
因为我nginx服务器里面只配置了一个1314的端口,80端口是apache配置的,3344(gitlab)是gitlab用external_url配置的。

找半天,突然想起来看看gitlab的配置,应该有gitlab自己的日志。
/etc/gitlab/gitlab.rb中扫到有用信息,虽然都加了注释,但起码知道还有一个默认日志路径,/var/log/gitlab/* 
挨个看,在gitlab-shell/中找到gitlab-shell.log,发现很多权限不足的错误日志,清掉重新clone一下。

W,[2015-06-08T20:29:50.605406 #12585]  WARN -- :gitlab-shell: Access denied for git command by user with keykey-2.
又来了,可以确认的是因为用户权限的问题。
其实这些配置还可以在/opt/gitlab/embedded/service/gitlab-shell/config.yml中找到,配置项就是log_file=/var/log/gitlab/gitlab-shell/gitlab-shell.log

sudo yum install gem
sudo gem install bundler --no-ri --no-rdoc

gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources

gem sources -a https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources

gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/

gem install bundler --no-ri --no-rdoc
Fetching: bundler-1.7.6.gem (100%)
Successfully installed bundler-1.7.6
1 gem installed


还是没有解决,who can helpme..
/var/log/gitlab/gitlab-shell/gitlab-shell.log


0 0
原创粉丝点击