502-Whoops, GitLab is taking too much time to respond

Аfter installing gitlab on my server (specifications below) I get the error “502-Whoops, GitLab is taking too much time to respond” when following the link I specified in /etc/gitlab/gitlab.rb

external_url ‘http://185.183.120.92:7788

I attach the file with logs and settings below, please help me, what could be the problem

System information
System:         Ubuntu 20.04
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   2.7.2p137
Gem Version:    3.1.4
Bundler Version:2.1.4
Rake Version:   13.0.3
Redis Version:  6.0.12
Git Version:    2.31.1
Sidekiq Version:5.2.9
Go Version:     unknown

GitLab information
Version:        13.11.3-ee
Revision:       7fde0affe23
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     12.6
URL:            http://185.183.120.92:7788
HTTP Clone URL: http://185.183.120.92:7788/some-group/some-project.git
SSH Clone URL:  git@185.183.120.92:some-group/some-project.git
Elasticsearch:  no
Geo:            no
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        13.17.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git

logs file: logs - Google Drive

Hi @druschic.alex
502-Whoops, GitLab is taking too much time to respond is normal during GitLab startup and goes away after couple minutes.
If it still there, please also provide output of gitlab-ctl status

Hello @balonik, here it’s definitely not a couple of minutes, I’ve already waited more than a day)
output of gitlab-ctl status:

root@subuntu:/etc/gitlab# gitlab-ctl status
run: alertmanager: (pid 2095063) 89371s; run: log: (pid 1721296) 186791s
run: gitaly: (pid 2095078) 89371s; run: log: (pid 1720630) 186892s
run: gitlab-exporter: (pid 2095108) 89370s; run: log: (pid 1721103) 186809s
run: gitlab-workhorse: (pid 2095110) 89369s; run: log: (pid 1721005) 186828s
run: logrotate: (pid 2322981) 2968s; run: log: (pid 1720469) 186905s
run: nginx: (pid 2095129) 89369s; run: log: (pid 2046027) 105649s
run: node-exporter: (pid 2095213) 89368s; run: log: (pid 1721082) 186817s
run: postgres-exporter: (pid 2095220) 89368s; run: log: (pid 1721317) 186787s
run: postgresql: (pid 2095232) 89367s; run: log: (pid 1720718) 186885s
run: prometheus: (pid 2095242) 89367s; run: log: (pid 1721158) 186799s
run: puma: (pid 2330788) 21s; run: log: (pid 2046012) 105651s
run: redis: (pid 2095285) 89366s; run: log: (pid 1720504) 186901s
run: redis-exporter: (pid 2095291) 89366s; run: log: (pid 1721130) 186803s
run: sidekiq: (pid 2095299) 89362s; run: log: (pid 1720957) 186835s

I found these errors in /var/log/gitlab/gitlab-workhorse/current:

{“correlation_id”:“01F50B1TK6P34M3WPR4KBM2DY2”,“duration_ms”:0,“error”:“badgateway: failed to receive response: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: connection refused”,“level”:“error”,“method”:“GET”,“ms
g”:"",“time”:“2021-05-06T08:00:06Z”,“uri”:"/"}
{“content_type”:“text/html; charset=utf-8”,“correlation_id”:“01F50B1TK6P34M3WPR4KBM2DY2”,“duration_ms”:0,“host”:“185.183.120.92:7788”,“level”:“info”,“method”:“GET”,“msg”:“access”,“proto”:“HTTP/1.1”,“referrer”:"",“remote_addr”:“91.149.165
.183:0”,“remote_ip”:“91.149.165.183”,“route”:"",“status”:502,“system”:“http”,“time”:“2021-05-06T08:00:06Z”,“ttfb_ms”:0,“uri”:"/",“user_agent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0”,“written_bytes”
:2940}
{“correlation_id”:“01F50B1TRKCWK9JSEAPBSH66X1”,“duration_ms”:0,“error”:“badgateway: failed to receive response: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: connection refused”,“level”:“error”,“method”:“GET”,“ms
g”:"",“time”:“2021-05-06T08:00:06Z”,“uri”:"/"}
{“content_type”:“text/html; charset=utf-8”,“correlation_id”:“01F50B1TRKCWK9JSEAPBSH66X1”,“duration_ms”:0,“host”:“185.183.120.92:7788”,“level”:“info”,“method”:“GET”,“msg”:“access”,“proto”:“HTTP/1.1”,“referrer”:"",“remote_addr”:“91.149.165
.183:0”,“remote_ip”:“91.149.165.183”,“route”:"",“status”:502,“system”:“http”,“time”:“2021-05-06T08:00:06Z”,“ttfb_ms”:0,“uri”:"/",“user_agent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0”,“written_bytes”
:2940}

root@subuntu:/var/opt/gitlab/gitlab-rails/sockets# ls -l
total 0
srwxrwxrwx 1 git git 0 May 6 07:50 gitlab.socket

maybe the problem is this?

You can check in /var/log/gitlab/gitlab-rails if gitlab-rails has some issues. Check in application.log and production.log.
Also make sure you meet the 4 CPU and 4GB RAM minimum requiremts.

1 Like

root@subuntu:/var/opt/gitlab/gitlab-rails/sockets# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 43 bits physical, 48 bits virtual
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz
Stepping: 4
CPU MHz: 3000.000
BogoMIPS: 6000.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32 KiB
L1i cache: 32 KiB
L2 cache: 1 MiB
L3 cache: 24.8 MiB
NUMA node0 CPU(s): 0-3
Vulnerability Itlb multihit: KVM: Vulnerable
Vulnerability L1tf: Mitigation; PTE Inversion
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP disabled, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

root@subuntu:/var/log/gitlab/gitlab-rails# free -h
total used free shared buff/cache available
Mem: 19Gi 1.4Gi 3.0Gi 14Mi 15Gi 18Gi
Swap: 8.0Gi 1.0Mi 8.0Gi

here are the logs application.log and production.log .
https://drive.google.com/drive/folders/1OWtR180YjQJbBEhI40oe7Ol0fWQfyYbD?usp=sharing
but there are no errors in them

puma seems not right only 21s so it must be restarting all the time. check gitlab-ctl tail puma

1 Like
root@subuntu:/etc/gitlab# gitlab-ctl tail puma
==> /var/log/gitlab/puma/current <==
2021-05-07_05:54:27.19061   /opt/gitlab/embedded/bin/puma:23:in `<top (required)>'
2021-05-07_05:54:27.93694 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"Puma starting in cluster mode..."}
2021-05-07_05:54:27.93696 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"* Puma version: 5.1.1 (ruby 2.7.2-p137) (\"At Your Service\")"}
2021-05-07_05:54:27.93697 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*  Min threads: 4"}
2021-05-07_05:54:27.93697 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*  Max threads: 4"}
2021-05-07_05:54:27.93698 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*  Environment: production"}
2021-05-07_05:54:27.93698 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*   Master PID: 2655207"}
2021-05-07_05:54:27.93699 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*      Workers: 4"}
2021-05-07_05:54:27.93701 {"timestamp":"2021-05-07T05:54:27.936Z","pid":2655207,"message":"*     Restarts: (✔) hot (✖) phased"}
2021-05-07_05:54:27.93702 {"timestamp":"2021-05-07T05:54:27.937Z","pid":2655207,"message":"* Preloading application"}

==> /var/log/gitlab/puma/state <==

==> /var/log/gitlab/puma/puma_stdout.log <==

==> /var/log/gitlab/puma/puma_stderr.log <==

==> /var/log/gitlab/puma/current <==
2021-05-07_05:55:12.85761 {"timestamp":"2021-05-07T05:55:12.857Z","pid":2655207,"message":"* Listening on unix:///var/opt/gitlab/gitlab-rails/sockets/gitlab.socket"}
2021-05-07_05:55:12.85775 bundler: failed to load command: puma (/opt/gitlab/embedded/bin/puma)
2021-05-07_05:55:12.85781 Errno::EADDRINUSE: Address already in use - bind(2) for "127.0.0.1" port 8080
2021-05-07_05:55:12.85783   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `initialize'
2021-05-07_05:55:12.85783   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `new'
2021-05-07_05:55:12.85783   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `add_tcp_listener'
2021-05-07_05:55:12.85783   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:168:in `block in parse'
2021-05-07_05:55:12.85784   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:152:in `each'
2021-05-07_05:55:12.85784   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:152:in `parse'
2021-05-07_05:55:12.85784   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/runner.rb:144:in `load_and_bind'
2021-05-07_05:55:12.85784   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/cluster.rb:342:in `run'
2021-05-07_05:55:12.85785   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/launcher.rb:182:in `run'
2021-05-07_05:55:12.85785   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/cli.rb:80:in `run'
2021-05-07_05:55:12.85786   /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/bin/puma:10:in `<top (required)>'
2021-05-07_05:55:12.85786   /opt/gitlab/embedded/bin/puma:23:in `load'
2021-05-07_05:55:12.85786   /opt/gitlab/embedded/bin/puma:23:in `<top (required)>'
2021-05-07_05:55:13.61955 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"Puma starting in cluster mode..."}
2021-05-07_05:55:13.61960 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"* Puma version: 5.1.1 (ruby 2.7.2-p137) (\"At Your Service\")"}
2021-05-07_05:55:13.61960 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*  Min threads: 4"}
2021-05-07_05:55:13.61960 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*  Max threads: 4"}
2021-05-07_05:55:13.61961 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*  Environment: production"}
2021-05-07_05:55:13.61961 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*   Master PID: 2655341"}
2021-05-07_05:55:13.61961 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*      Workers: 4"}
2021-05-07_05:55:13.61962 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"*     Restarts: (✔) hot (✖) phased"}
2021-05-07_05:55:13.61962 {"timestamp":"2021-05-07T05:55:13.619Z","pid":2655341,"message":"* Preloading application"}

maybe the problem is this?
2021-05-07_05:56:43.40789 Errno::EADDRINUSE: Address already in use - bind(2) for “127.0.0.1” port 8080

yup. Are you running anything on port 8080?

Oh, I cannot publish the same reply again if I already have deleted.

1 Like

yes, my port 8080 is occupied by another application, but I specified in the /etc/gitlab/gitlab.rb settings so that the gitlab would work on a different port: 7788

external_url ‘http://185.183.120.92:7788

you need to tell Puma to listen on a different port than 8080:
puma['port'] = some_port_here

external_url is for the embedded Nginx

2 Likes

thanks a lot, gitlab worked, the problem was in the port :slight_smile:

1 Like


I also encountered thesame error. I found out that because my gitlab and phpmyadmin here listening to thesame port 8080, so I had to change the port my phpmyadmin container was listening to from 8080 to 8081. That solved the problem.