Gitlab-shell抛出404请求内部api请求?

时间:2014-03-04 11:15:23

标签: git version-control ssh gitlab

如果我ssh -T git@my-server 我正在

Welcome to GitLab, Anonymous!

如果我git clone git@gitlab.advantage4me.co:matthew/dummy.git 我正在

Cloning into 'dummy'...
Access denied.
fatal: Could not read from remote repository.

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

这很奇怪,因为密钥存在,但是查看gitlab-shell.log它给了我

API call <GET https://my-server/api/v3/internal/discover?key_id=1>
failed: 404 => <{"message":"404 Not found"}>.

通过https使用git clone工作正常。

现在我知道配置错误的网址不是问题,因为我可以从同一台服务器上配置错误的网址(注意我复制/粘贴'd my-server以确保没有拼写错误)

wget https://my-server/api/v3/projects
?private_token=zogmVjiVBZcEn39Vx4qK

这会导致什么,gitlab似乎认为它运行正常?

Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.9 ? ... OK (1.8.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
update hook up-to-date? ... yes
update hooks in repos are links: ... 
Api / core ... repository is empty
Matthew Hailwood / dummy ... ok
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.8.6
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
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: ... 
Api / core ... yes
Matthew Hailwood / dummy ... yes
Projects have satellites? ... 
Api / core ... can't create, repository is empty
Matthew Hailwood / dummy ... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

1 个答案:

答案 0 :(得分:1)

我偶然发现了这个问题,因为我遇到了同样的错误。经过大量的故障排除后,这对我有用:

  1. 清除所有当前设置的授权密钥:

    sudo -u git -H bin / gitlab-keys clear

  2. 重新启动并设置GitLab shell:

    sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV = production

  3. 使用浏览器登录GitLab并从中删除RSA密钥 用户个人资料

  4. 再次将RSA密钥添加到您的用户个人资料

  5. 来源: https://github.com/gitlabhq/gitlabhq/issues/4730#issuecomment-23219136