Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

502 Whoops, GitLab is taking too much time to respond

Tags:

gitlab

I installed Gitlab on Raspberry Pi2, and it had worked well for a couple of months. But since shutting down the power of RPi, it doesn't work anymore. The webpage returns 502 error.

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

So I tried reconfigure (sudo gitlab-ctl reconfigure) but, it failed with the error message:

FATAL: Errono::EAFNOSUPPORT: Address family not supported by protocol - socket(2)

I don't know how to resolve this problem.

like image 641
SeoHwa EunHa Avatar asked Oct 21 '15 08:10

SeoHwa EunHa


3 Answers

I saw issue like this several times.

If GitLab has been worked fine please do not touch anything. Just wait. It seems GitLab has not been started properly :(

I mean that after booting system you have to wait 1-2 minutes before using GitLab. GitLab needs some time for starting.

like image 121
Vlad Avatar answered Nov 09 '22 20:11

Vlad


I am not adding a comment since my answer needs some good formatting.

So that means, your port 8080 is already being used. I would advise to stop GitLab, and change unicorn port from 8080 to 8081 (or some unused port).

After starting/restarting GitLab wait for 2 minutes, and you should be okay. If not, again check gitlab-ctl tail for any errors.

# gitlab-ctl stop

# vi /etc/gitlab/gitlab.rb   (change only these lines, uncomment if required)
unicorn['port'] = 8081
gitlab_git_http_server['auth_backend'] = "http://localhost:8081"

# gitlab-ctl reconfigure  (to apply the changes)
# gitlab-ctl restart
# lsof -i:8081        (check whether unicorn has started properly)

You need to be root or a sudo user (with root privileges) to run these commands.

like image 26
vikas027 Avatar answered Nov 09 '22 21:11

vikas027


After inspecting the gitlab-ctl tail (reboot loop) it turned out that there is not enough RAM (2GB) and there is no swap file in my fresh Ubuntu setup.

As mentioned in requirements GitLab requires at least 2GB RAM + 2GB swap memory ...

So to create a swap file follow those steps:

  1. gitlab-ctl stop

  2. mkdir /swap && touch /swap/swapfile.img

  3. dd if=/dev/zero of=/swap/swapfile.img bs=1024 count=2M # if you want 4G change 2M to 4M
  4. chmod 0600 /swap/swapfile.img
  5. mkswap /swap/swapfile.img
  6. nano /etc/fstab and add "/swap/swapfile.img swap swap sw 0 0"
  7. swapon /swap/swapfile.img
  8. Verify if it works : cat /proc/swaps

    Filename                Type        Size    Used    Priority
    
    /swap/swapfile.img      file        2097148 0       -1
    
  9. gitlab-ctl start

more info about creating swap : here

like image 11
trojan Avatar answered Nov 09 '22 21:11

trojan