This error occurs when the Web server times out (default: 60 s) after not hearing back from the unicorn worker. If the CPU spins to 100% while this in progress, there may be something taking longer than it should.

To fix this issue, we first need to figure out what is happening. The following tips are only recommended if you do NOT mind users being affected by downtime. Otherwise skip to the next section.

Load the problematic URL

Run sudo gdb -p <PID> to attach to the unicorn process.

In the gdb window, type:

call (void) rb_backtrace()

This forces the process to generate a Ruby backtrace. Check /var/log/gitlab/unicorn/unicorn_stderr.log for the backtace. For example, you may see:

Once you're done debugging with gdb, be sure to detach from the process and exit:

detach
exit

Note that if the unicorn process terminates before you are able to run these commands, gdb will report an error. To buy more time, you can always raise the Unicorn timeout. For omnibus users, you can edit /etc/gitlab/gitlab.rb and increase it from 60 seconds to 300:

The previous section attached to a running unicorn process, and this may have undesirable effects for users trying to access GitLab during this time. If you are concerned about affecting others during a production system, you can run a separate Rails process to debug the issue: