Git Lab 502 - Cent OS

Still cant get past 502 error after upgrades and setting changes, any help really really appreciated.

Have set up and install Gitlab as per Cent OS 6 instructions
created a subdomain and edited gitlab.rb

nginx['enable'] = false
external_url 'http://gitlab.adamprocter.co.uk:8081'
web_server['external_users'] = ['nginx']
gitlab_rails['trusted_proxies'] = [ '192.168.1.0/24', '192.168.2.1', '2001:0db8::/32' ]
in my custom nginx I also have

upstream gitlab {
server unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;
}

server {
listen 217.147.85.86:8081 default_server;
listen [::]:8081 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.html index.htm;
server_name gitlab.adamprocter.co.uk;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://gitlab;
}
}

Hi

Please try to reconfigure the instance by running below command

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

If the issue persists run the rake tests to identify the issue.

sudo gitlab-rake gitlab:check --trace

Please feel free to post question if any.

no luck here is rack output

** Invoke gitlab:check (first_time)
** Invoke gitlab:gitlab_shell:check (first_time)
** Invoke environment (first_time)
** Execute environment
Rails Error: Unable to access log file. Please ensure that /opt/gitlab/embedded/service/gitlab-rails/log/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /opt/gitlab/embedded/service/gitlab-rails/log/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
** [Raven] Raven 0.15.6 configured not to send errors.
** Execute gitlab:gitlab_shell:check
Checking GitLab Shell …

GitLab Shell version >= 3.0.0 ? … OK (3.0.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
hooks directories in repos are links: … can’t check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
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 /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks.

Checking GitLab Shell … Finished

** Invoke gitlab:sidekiq:check (first_time)
** Invoke environment
** Execute gitlab:sidekiq:check
Checking Sidekiq …

Running? … no
Try fixing it:
sudo -u git -H RAILS_ENV=production bin/background_jobs start
For more information see:
doc/install/installation.md in section “Install Init Script”
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.

Checking Sidekiq … Finished

** Invoke gitlab:incoming_email:check (first_time)
** Invoke environment
** Execute gitlab:incoming_email:check
Checking Reply by email …

Reply by email is disabled in config/gitlab.yml

Checking Reply by email … Finished

** Invoke gitlab:ldap:check (first_time)
** Invoke environment
** Execute gitlab:ldap:check
Checking LDAP …

LDAP is disabled in config/gitlab.yml

Checking LDAP … Finished

** Invoke gitlab:app:check (first_time)
** Invoke environment
** Execute gitlab:app:check
Checking GitLab …

Git configured with autocrlf=input? … yes
Database config exists? … yes
All migrations up? … yes
Database contains orphaned GroupMembers? … no
GitLab config exists? … yes
GitLab config outdated? … no
Log directory writable? … yes
Tmp directory writable? … yes
Uploads directory setup correctly? … skipped (no tmp uploads folder yet)
Init script exists? … skipped (omnibus-gitlab has no init script)
Init script up-to-date? … skipped (omnibus-gitlab has no init script)
projects have namespace: … can’t check, you have no projects
Redis version >= 2.8.0? … yes
Ruby version >= 2.1.0 ? … yes (2.1.8)
Your git bin path is “/opt/gitlab/embedded/bin/git”
Git version >= 2.7.3 ? … yes (2.7.4)
Active users: 1

Checking GitLab … Finished

Hi

There are many errors in the installation actually the gitllab hasn’t installed properly.
I would suggest you the following:
I assume you don’t have any projects, users or data in your Gitlab instance
Rather debugging issues one by one, cleanse the config and data, and then uninstall Gitlab. This step will erase all data, repos, users and config and all data associated with your gitlab server. Install Gitlab freshly that will be a good option to save time and reduce frustration.

**Steps : **
Cleanse/erase
sudo gitlab-ctl cleanse --trace

Note: For RHEL, I am not sure abt Cent OS. U might need to register to RHN for yum to install packages properly.
Install Steps
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
rpm -i gitlab-ce-XXX.rpm
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-ctl status
sudo gitlab-rake gitlab:check SANITIZE=true --trace

Please do these steps and let us know if you are still facing issues. In case you have data in your Gitlab instance you need to resolve problems one by one from the rake o/p you have posted above, starting with creating a production log file.
Please feel free to post your questions.

Cheers :slight_smile: Good Luck :slight_smile:

1 Like

Thanks for the reply

I did the Cleanse and the following steps to install as below

Install Steps
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-ctl status
sudo gitlab-rake gitlab:check SANITIZE=true --trace

this was the output

** Invoke gitlab:check (first_time)
** Invoke gitlab:gitlab_shell:check (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:gitlab_shell:check
Checking GitLab Shell ...

GitLab Shell version >= 3.0.0 ? ... OK (3.0.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
hooks directories in repos are links: ... can't check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
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 /opt/gitlab/embedded/service/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

** Invoke gitlab:sidekiq:check (first_time)
** Invoke environment 
** Execute gitlab:sidekiq:check
Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

** Invoke gitlab:incoming_email:check (first_time)
** Invoke environment 
** Execute gitlab:incoming_email:check
Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

** Invoke gitlab:ldap:check (first_time)
** Invoke environment 
** Execute gitlab:ldap:check
Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

** Invoke gitlab:app:check (first_time)
** Invoke environment 
** Execute gitlab:app:check
Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... can't check, you have no projects
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 1

Checking GitLab ... Finished

** Execute gitlab:check

external URL was set incorrect to VPS name but didnt load anyway changed it to gitlab.adamprocter.co.uk
reconfigured/ restarted/ did check

** Invoke gitlab:check (first_time)
** Invoke gitlab:gitlab_shell:check (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:gitlab_shell:check
Checking GitLab Shell ...

GitLab Shell version >= 3.0.0 ? ... OK (3.0.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
hooks directories in repos are links: ... can't check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
    /var/opt/gitlab/git-data/repositories: OK
    /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: gitlab-shell self-check successful

Checking GitLab Shell ... Finished

** Invoke gitlab:sidekiq:check (first_time)
** Invoke environment 
** Execute gitlab:sidekiq:check
Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

** Invoke gitlab:incoming_email:check (first_time)
** Invoke environment 
** Execute gitlab:incoming_email:check
Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

** Invoke gitlab:ldap:check (first_time)
** Invoke environment 
** Execute gitlab:ldap:check
Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

** Invoke gitlab:app:check (first_time)
** Invoke environment 
** Execute gitlab:app:check
Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... can't check, you have no projects
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 1

Checking GitLab ... Finished

** Execute gitlab:check

visited gitlab.adamprocter.co.uk standard hosting page still

changed rb to be

nginx['enable'] = false
external_url 'http://gitlab.adamprocter.co.uk:8081'
web_server['external_users'] = ['nginx']
gitlab_rails['trusted_proxies'] = [ '192.168.1.0/24', '192.168.2.1', '2001:0db8::/32' ]

reconfigure/ restarted and did check

** Invoke gitlab:check (first_time)
** Invoke gitlab:gitlab_shell:check (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:gitlab_shell:check
Checking GitLab Shell ...

GitLab Shell version >= 3.0.0 ? ... OK (3.0.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
hooks directories in repos are links: ... can't check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
    /var/opt/gitlab/git-data/repositories: OK
    /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: gitlab-shell self-check successful

Checking GitLab Shell ... Finished

** Invoke gitlab:sidekiq:check (first_time)
** Invoke environment 
** Execute gitlab:sidekiq:check
Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

** Invoke gitlab:incoming_email:check (first_time)
** Invoke environment 
** Execute gitlab:incoming_email:check
Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

** Invoke gitlab:ldap:check (first_time)
** Invoke environment 
** Execute gitlab:ldap:check
Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

** Invoke gitlab:app:check (first_time)
** Invoke environment 
** Execute gitlab:app:check
Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... can't check, you have no projects
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 1

Checking GitLab ... Finished

** Execute gitlab:check

visiting :8081 Server not found ?
I feel like this is better but not closer

actually it took down my whole server :frowning: grrrr
have stopped gitlab… this had better fix it
restarted server to get everything else back working

It is working ! thanks @ershad.ahmad - your steps fixed it I just need to have adjust the rb file first (obviously) so initially gitlab took over port 80 :smiley:

1 Like