安装后 GitLab 重定向到页面 422

GitLab redirects to page 422 upon installation

我按照他们的 documentation page. The server would be accessible as http://foobar.com/gitlab 安装了 GitLab。我有 passenger+apache 安装。 (独角兽也是运行)。安装完成后,它会加载登录页面,当我输入默认值 username/password(root/5iveL!fe) 时,它会重定向到 422 页面,并出现以下错误:

422
The change you requested was rejected.

我以为密码可能有问题,尝试 reset password from console 但是当 运行 gitlab-rails console productionsudo -u git -H gitlab-rails console production 时,我收到以下错误:

ls: cannot access /opt/gitlab/embedded/service/gitlab-rails/log: No such file or directory
chpst: fatal: unknown user/group: -U

由于第一个错误是因为没有日志文件,我手动创建了一个日志文件,但是在 运行 命令之后我得到了以下错误:

chpst: fatal: unable to setgroups: permission denied

我不知道还能做什么。同样在 production.log 中,它抱怨 CSR 令牌无效。我认为这意味着我没有提供正确的密码,但这是 GitLab 安装给出的密码。

也可能是相关的,我用这个guide来配置apache。 GitLab 的 Apache vhost 部分看起来像这样

 35  ProxyPass→→ → → /gitlab/→ http://127.0.0.1:8080/gitlab/
 36  ProxyPassReverse →/gitlab/→ http://127.0.0.1:8080/gitlab/
 37  ProxyPass→→ → → /gitlab http://127.0.0.1:8080/gitlab
 38  ProxyPassReverse /gitlab http://127.0.0.1:8080/gitlab
 39  ProxyPass→→ → → /assets→→ http://127.0.0.1:8080/gitlab/assets
 40  ProxyPassReverse /assets→ http://127.0.0.1:8080/gitlab/assets

由于没有人回答,我将 post 我的解决方案,以便其他人可能会发现它有用。 问题出在 https 上。如果我在 gitlab.yml (https: false) 中关闭 https 选项,那么我就能够登录。详细的解决方法可以参考here。我必须在我的虚拟主机中添加以下内容(因为我有一个用于 foobar.com.conf 和 foobar.com-ssl.conf)文件。

在 foobar.com.conf 文件中我必须添加:

 RewriteCond %{HTTPS} !=on
 RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]

并且在 foobar.com-ssl.conf 中我必须添加:

  RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
  RequestHeader set X_FORWARDED_PROTO 'https'

有关更多故障排除问题,请访问 here