Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #220

Closed
Open
Created Dec 20, 2011 by Administrator@rootOwner

Unable to Save Public Key with Large Number of Repos

Created by: mutewinter

With a large number of repos (> 100), saving a pubic key fails. This is due to the timeout in the Gitlabhq::Gitolite.configure method being too short.

Here's the responsible code

def configure
      status = Timeout::timeout(20) do
        File.open(File.join(Dir.tmpdir,"gitlabhq-gitolite.lock"), "w+") do |f|
          begin 
            f.flock(File::LOCK_EX)
            pull
            yield(self)
            push
          ensure
            f.flock(File::LOCK_UN)
          end
        end
      end
    rescue Exception => ex
      raise Gitolite::AccessDenied.new("gitolite timeout")
    end

The problem is that this fails silently because the Gitolite error page is returned to the POST request initiated by JavaScript. Here's the error returned from the POST at /keys

<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but we cant get access to your gitosis</title>
  <style type="text/css">
    body { background-color: #EAEAEA; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 600px;
      padding: 0 4em;
      margin: 4em auto 0 auto;
    }
    h1 { font-size: 48px; color: #444; line-height: 1.5em; }
    h2 { font-size: 24px; color: #666; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>Gitolite Error</h1>
    <h2>We're sorry, but we cant get access to your gitolite system.</h2>
    <h3> 1. Check 'config/gitlab.yml' for correct settings.</h3>
    <h3> 2. Be sure web server user has access to gitolite.</h3>
  </div>
</body>
</html>

This error message is only visible when running Chrome Developer Tools with the Network tab loaded. Selecting the POST request after the 20 second timeout displays the above error html.

The temporary solution to this problem is to increase the timeout to allow for the update_project method to finish being called for all 200 projects. The long term solution would be some sort of background job system so that the updates take place off the web request thread.

Assignee
Assign to
Time tracking