3

After taking gitlab backup everyday gitlab is throwing 502 error. I saw nginx logs but did not find that much information.

enter image description here

After gitlab-ctl restart it starts working again.

System Configurations: OS : Ubuntu 16.04 LTS 4 GB Ram 200 GB Disk Space

can anyone give permanent solution for it.

Saurabh Agrawal
  • 421
  • 2
  • 7
  • 16

3 Answers3

3

There is a high possibility that it run out of shared memory. As each time after the backup you got the 502 error.

To check it with gitlab-ctl tail tail detail

It will show something like:

2019-04-12_12:37:17.27154 FATAL:  could not map anonymous shared memory: Cannot allocate memory
2019-04-12_12:37:17.27157 HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 4345470976 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
2019-04-12_12:37:17.27171 LOG:  database system is shut down

Then check it with free -m, which shows there is no available shared memory.

             total       used       free     shared    buffers     cached
Mem:         16081      13715       2365          0        104        753
-/+ buffers/cache:      12857       3223

Then you need to check if there is some process take too many shared memory, or too many zomibe process, then kill it with command like ps -aef | grep ffmpeg | awk '{print $2}' | xargs kill 9

Check it with free -h, there is about 112M shared memory now.

             total       used       free     shared    buffers     cached
Mem:           15G       4.4G        11G       112M        46M       416M
-/+ buffers/cache:       3.9G        11G
Swap:           0B         0B         0B

At last,restart you gitlab with gitlab-ctl restart, after sometime the gitlab booted, the 502 gone.

LF00
  • 27,015
  • 29
  • 156
  • 295
0

After long search i got something about it. After taking backup my gitlab-workhorse is getting ideal and gitlab.socket is refusing the connection. As temporary solution i have installed a new cron job for restarting gitlab service after the complpetion of gitlab backup cronjob.

Saurabh Agrawal
  • 421
  • 2
  • 7
  • 16
0

If the gitlab is installed in Virtual-Box - Ubuntu server either 18.04 or 20.04,

please increase the RAM to 4gb and the provide atleast 3 processors.

Sabbha
  • 21
  • 1
  • 7