升级后GitLab API访问失败

时间:2015-10-13 11:20:04

标签: gitlab

我最近将GitLab更新到版本7.14,当我运行时

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

我收到以下错误

Check GitLab API access: FAILED: Failed to connect to internal API
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

我已经在反向代理后面运行了gitlab,并设置了以下规则

DNAT            net             loc:192.168.122.38:22    tcp     2227    -               <externalip>
DNAT            net             loc:192.168.122.38:80    tcp     2280    -               <externalip>
DNAT            net             loc:192.168.122.38:443   tcp     2443    -               <externalip>

和gitlab-shell / config.yml看起来像

 GitLab user. git by default
 user: git

# Url to gitlab instance. Used for api calls
gitlab_url: "https://<external_url>:2443/"

# Repositories path
repos_path: "/home/git/repositories"

# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"

ssh_port: 2227

self_signed_cert: true

1 个答案:

答案 0 :(得分:0)

根据您描述的配置,问题是gitlab-shell正在尝试通过https://:2443访问GitLab。但是,您指出只有端口22,80和443被代理。您需要调整gitlab-shell配置,使其指向localhost的适当端口或外部URL上的端口443。