3

I installed GitLab by following their documentation page. The server would be accessible as http://foobar.com/gitlab. I have passenger+apache installation. (unicorn is also running). After installation finished, it loads the login page, when I type the default username/password(root/5iveL!fe), it redirects to a 422 page with following error:

422
The change you requested was rejected.

I thought maybe there is something wrong with password, tried to reset password from console but when running gitlab-rails console production and sudo -u git -H gitlab-rails console production I got the following error:

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

Since the first error is cause there is no log file, I manually created a log file but after running the command i got the following error:

chpst: fatal: unable to setgroups: permission denied

I don't know what to do else. Also in production.log, it complains about CSR Token not being valid. Which I assume means I am not supplying the correct password, but that is the password that was given by GitLab installation.

Also might be relevant, I used this guide to configure apache. Apache vhost portion for GitLab looks like this

 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
Community
  • 1
  • 1
Neo
  • 349
  • 5
  • 18

1 Answers1

11

Since nobody has answered, I will post my solution so that anyone else might find it beneficial. The problem was with https. If I turned off https option in gitlab.yml (https: false) then I was able to login. The detailed solution can be found here. I had to add the following in my virtualhosts(since I have one for foobar.com.conf and foobar.com-ssl.conf) file.

In foobar.com.conf File I had to add:

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

and in foobar.com-ssl.conf I had to add:

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

For more troubleshooting problems visit here.

Neo
  • 349
  • 5
  • 18