Gitlab 安装成功、创建项目后添加 ssh key、push 遇到各种问题

2015-01-22 15:11:59 +08:00
 tekin

按照官方教程安装成功、参考地址:
https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos
但最后创建项目push遇到各种哦你我跟体、想放弃的念头都有了、折腾了一个星期多、还未能解决。
相关设置和数据如下:
gitlab版本和相关数据:
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.5p273
Gem Version: 2.2.2
Bundler Version:1.7.12
Rake Version: 10.3.2
Sidekiq Version:2.17.8

GitLab information
Version: 7.6.2
Revision: 16f0968
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://git.urumqi.cn
HTTP Clone URL: http://git.urumqi.cn/some-project.git
SSH Clone URL: git@git.urumqi.cn:some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version: 2.1.0
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git

gitlab环境检查:
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 2.4.0 ? ... FAIL. Please update gitlab-shell to 2.4.0 from 2.1.0
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ...
Administrator / Katip ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories/: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.4.10
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... no
Try fixing it:
Redownload the init script
For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
projects have namespace: ...
Administrator / Katip ... yes
Projects have satellites? ...
Administrator / Katip ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.5)
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (2.1.3)

Checking GitLab ... Finished

gitlab.yml修改的数据:
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: git.urumqi.cn
port: 80 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
https: false

email_from: 84247764@qq.com
ssh_port: 51905

unicorn.rb修改的数据:
worker_processes 1
listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true

resque.yml数据:
development: redis://localhost:6379
test: redis://localhost:6379
production: unix:/var/run/redis/redis.sock

gitlab-sheel/config.yml数据:

user: git
gitlab_url: http://git.urumqi.cn/
http_settings:
self_signed_cert: false
repos_path: "/home/git/repositories/"
auth_file: "/home/git/.ssh/authorized_keys"
redis:
bin: "/usr/bin/redis-cli"
host: 127.0.0.1
port: 6379
namespace: resque:gitlab
socket: "/var/run/redis/redis.sock"
log_level: INFO
audit_usernames: false

nginx参数设置:
listen 0.0.0.0:80 default_server;
#listen [::]:80 default_server;
server_name git.urumqi.cn; ## Replace this with something like gitlab.example.com
server_tokens off; ## Don't show the nginx version number, a security best practice
root /home/git/gitlab/public;

git目录权限:
4.0K drwxr-xr-x 17 git git 4.0K 1月 21 15:03 gitlab
4.0K drwxr-x--- 2 git git 4.0K 1月 21 12:49 gitlab-satellites
4.0K drwxr-xr-x 8 git git 4.0K 1月 22 12:49 gitlab-shell
83M -rw-r--r-- 1 git git 83M 1月 21 11:43 gitlab.tzr.gz
4.0K drwxr-xr-x 2 git git 4.0K 11月 12 2010 .gnome2
4.0K drwxr-xr-x 4 git git 4.0K 11月 29 2013 .mozilla
4.0K -rw------- 1 git git 19 1月 21 12:37 .mysql_history
4.0K drwxr----- 3 git git 4.0K 1月 21 10:57 .pki
4.0K drwxrws--- 3 git git 4.0K 1月 21 15:15 repositories
4.0K drwx------ 2 git git 4.0K 1月 21 17:24 .ssh
4.0K -rw------- 1 git git 3.1K 1月 21 15:09 .viminfo

.ssh目录权限:
drwx------ 2 git git 4.0K 1月 21 17:24 .
drwxr-x--x 10 git git 4.0K 1月 21 16:44 ..
-rw------- 1 git git 517 1月 21 17:24 authorized_keys
-rw-r--r-- 1 git git 0 1月 21 17:24 authorized_keys.lock
-rw-r--r-- 1 git git 96 1月 21 15:03 environment

本地生成id_rsa.pub内容和authorized_keys内容匹配。

但现在push无法工作, http和ssh方式都不行,希望有经验的高手能帮我看看、谢谢

push错误信息:
$ git push -u origin master
Permission denied (publickey,password).
fatal: Could not read from remote repository.

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

网上的各种修改都试过了无解。

联系QQ:
84247764

11383 次点击
所在节点    Ruby on Rails
40 条回复
koy1619
2015-01-22 16:19:19 +08:00
lex
2015-01-22 17:11:29 +08:00
现在官方有 Omnibus 的安装包相当好用:
https://about.gitlab.com/downloads/

如果会用 Ansible,可以用我做的一键安装 GitLab 的配置:
https://github.com/lexrus/ios-dev-playbook
tekin
2015-01-22 17:31:46 +08:00
官方一键安装包返回:
package gitlab-7.2.1_omnibus-1.el6.x86_64 is intended for a x86_64 architecture
不支持还是怎么回事?
timsims
2015-01-22 17:51:18 +08:00
表示折腾过一次之后压根不想再碰gitlab

我们公司现在直接上Docker,镜像别人弄好了,只要配置好redis和mysql账号密码什么的就可以使用,而且升级也方便

https://github.com/sameersbn/docker-gitlab
tekin
2015-01-22 18:00:49 +08:00
如果有谁想远程帮我看看,联系QQ:84247764、到时候也 可以提供服务器
ldehai
2015-01-22 20:34:19 +08:00
@tekin 是不是gitlab服务器里面ip地址没写对,要写服务器实际的ip地址。我们也是用的gitlab,不过没折腾ssh,都是用的https。
mengzhuo
2015-01-22 20:55:59 +08:00
>>> package gitlab-7.2.1_omnibus-1.el6.x86_64 is intended for a x86_64 architecture
>>> 不支持还是怎么回事?

人家只支持x86 64位
tekin
2015-01-22 22:33:52 +08:00
@ldehai 是gitlab--config/gitlab.yml里写的是域名、上面提供了相关配置参数,能帮我看看吗? 配置参数是否正确?
tekin
2015-01-22 22:37:32 +08:00
@ldehai 能否把你的相关配置参数文件提供下,只提供IP和端口相关的设置。如:gitlab.yml, gitlab-shell config.yml, unicorn.rb, resque.yml里的IP和端口、ssh key等参数设置。
sarices
2015-01-22 22:40:37 +08:00
https://github.com/gogits/gogs 不想折腾用这个,部署gitlab太虐了
tekin
2015-01-22 22:53:28 +08:00
@sarices 已经折腾这么久了,暂时不想放弃,先解决了gitlab问题,后面有空时好好体验下,谢谢推荐。
lerry
2015-01-22 23:00:52 +08:00
我是在一个纯净系统里用一键安装包安装的,简单配置后就可以用,用的挺好的
安装包只能用在64位系统
lerry
2015-01-22 23:02:11 +08:00
@sarices 这个用过,但是感觉完成度和稳定性太低了,之前群组什么都用不了,好多操作都报500错误。
RoshanWu
2015-01-22 23:13:28 +08:00
前些天刚给公司安装了个 Gitlab,现在用的正欢。希望对你有点帮助: http://git.cairenhui.com/gitlab/how-to-use/wikis/Generating-SSH-keys
tekin
2015-01-22 23:34:46 +08:00
@RoshanWu 谢谢,我先看看
tekin
2015-01-22 23:35:54 +08:00
@lerry 我系统已经部署了一些应用,暂时就手动安装看看,能否把你的相关配置参数给我们看看,如:gitlab.yml, gitlab-shell config.yml, unicorn.rb, resque.yml里的IP和端口、ssh key等参数设置。
lerry
2015-01-23 00:12:13 +08:00
我的就是默认配置,只是配置了域名、smtp、ldap,默认配置就可以跑的
tekin
2015-01-23 00:57:37 +08:00
@lerry 系统是centos吗?我也是默认配置,改了域名,但无法push,你的http还是https, ssh push正常吗?能Q远程看看吗?
zcbenz
2015-01-23 01:30:36 +08:00
人生苦短,还是用GitHub企业版吧。
lyf362345
2015-01-23 02:06:50 +08:00
看检查输出提示 gitlab shell 版本不对,你升级下看看,另外系统是什么系统,我最近 vps 干坏事被清空了,昨天花了半小时就装好了啊呀

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/164493

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX