【问题标题】:Gitlab-shell throwing 404 request for internal api requests?Gitlab-shell 对内部 api 请求抛出 404 请求?
【发布时间】:2014-05-27 07:03:23
【问题描述】:

如果我这样做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 工作正常。

现在我知道配置错误的 url 不是问题,因为我可以在同一台服务器上进行操作(注意我复制/粘贴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

【问题讨论】:

    标签: git version-control ssh gitlab


    【解决方案1】:

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

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

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

    2. 重启并设置 GitLab 外壳:

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

    3. 使用浏览器登录 GitLab 并从您的 用户个人资料

    4. 再次将您的 RSA 密钥添加到您的用户配置文件中

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-12
      • 2017-02-10
      • 2019-03-12
      • 2020-10-28
      • 2014-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多