Unicorn Error: GitLab Configuration

After following the GitLab setup guide to install GitLab, I recieved Nginx errors. Running the recommended checks (section 6, “Check Application Status”), didn’t show any problems.

The Nginx errors said:

upstream prematurely closed connection while reading response header from upstream github

Examining the logfiles in /home/gitlog/gitlog/log, my unicorn.stderr.log was also displaying errors:

I, [2013-01-18T19:30:44.454863 #4806]  INFO -- : worker=0 ready
E, [2013-01-18T19:31:44.357351 #4652] ERROR -- : worker=1 PID:4693 timeout (31s > 30s), killing
E, [2013-01-18T19:31:44.380381 #4652] ERROR -- : reaped #<Process::Status: pid 4693 SIGKILL (signal 9)> worker=1
I, [2013-01-18T19:31:44.563039 #4809]  INFO -- : worker=1 ready
E, [2013-01-18T19:32:19.439897 #4652] ERROR -- : worker=0 PID:4806 timeout (31s > 30s), killing
E, [2013-01-18T19:32:19.466585 #4652] ERROR -- : reaped #<Process::Status: pid 4806 SIGKILL (signal 9)> worker=0

From this StackOverflow question, the solution is to increase the unicorn timeout to give GitLab time to generate the initial files the first time you log in.