2014-03-04 58 views
2

如果我做ssh -T [email protected] 我越來越Gitlab-shell拋出404請求的內部API請求?

Welcome to GitLab, Anonymous! 

如果我做git clone [email protected]: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克隆工作正常。

現在我知道這是不是與具有錯誤的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 

回答

1

我偶然發現了這個問題,因爲我遇到了同樣的錯誤。很多故障排除後,這已爲我工作:

  1. 清除所有當前設置的授權密鑰:

    須藤-u git的-H斌/ gitlab,按鍵清晰

  2. 重新啓動和設置gitLab殼:

    須藤-u的git -H捆綁EXEC耙gitlab:外殼:設置RAILS_ENV =生產

  3. 登入gitLab與瀏覽器,並從 用戶配置文件中刪除RSA密鑰

  4. 再次添加您的RSA密鑰對用戶配置文件

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