title: OS X Server - bot can't get source from repository
body: <p>I had a previous version of OS X Server set up and running fine, but when I installed the upgrade to 3.2.1, I found that none of my bots would work correctly. These are the issues I get on each attempted integration:</p>
  <blockquote>
  <p><strong>Build Service Error</strong> Can't fit data in the buffer (-1).</p>
  <p><strong>Build Service Warning</strong> The source control operation failed because no working copy could be found.</p>
  <p><strong>Build Service Warning</strong> An error occurred updating existing checkout. Falling back to a clean checkout..</p>
  </blockquote>
  <p>I may be looking in the wrong place, but I think the errors mean that I can't connect to my Git repository. This was partially confirmed when I deleted my repository from Xcode and ran the bot again and got the same errors. (I have since re-added the repository in Xcode and performed a Check Out to test it, so am pretty certain I have all the connection details right.)</p>
  <p>With the previous version of OS X Server, I'm sure I'd connected to the repository directly from the server, as explained in <code>Help &gt; Server Tutorials &gt; Automate Xcode builds</code>:</p>
  <blockquote>
  <p><strong>Step 3. Give Xcode service access to the git repository</strong></p>
  <p>Xcode service bots access projects and code from your source git repository.</p>
  <p>Click Repositories, then click the Add button (+). Choose Connect to a Git Repository from the New Repository pop-up menu.</p>
  </blockquote>
  <p>But in the latest version, when you click the Add button you just get the option to create a new repository, rather than connect to an existing one. And the instructions on the web (now) say:</p>
  <blockquote>
  <p><em><strong>Connect to Remote Repositories</strong></em></p>
  <p>If you have projects in Git or Subversion repositories on remote servers, you can store your credentials for them on your development Mac in the Accounts preferences in Xcode. Then, when you need to access the repositories, you won’t have to reenter your credentials every time.</p>
  <p><strong>To add a remote repository’s credentials to a development Mac</strong></p>
  <p>For Xcode Server to perform integrations on your projects, it must also have access to their source code repositories. Configure Xcode Server to connect to your remote repositories.</p>
  <ul>
  <li><p>Choose Xcode &gt; Preferences on your development Mac.</p>
  </li>
  <li><p>Click Accounts in the toolbar.</p>
  </li>
  <li><p>Click the Add button (+), and choose Add Repository.</p>
  </li>
  <li><p>In the text field, enter the URL for the repository (for example, svn+ssh://svn.example.com/ProjectName or <a href="https://example.com/git/repository.git" rel="noreferrer">https://example.com/git/repository.git</a>), and click the Next button.</p>
  </li>
  <li><p>Enter your user name and password in the Repository pane of Accounts preferences.</p>
  </li>
  </ul>
  </blockquote>
  <p>which is a bit vague, but seems to suggest that now OS X Server uses repositories that are set up in Xcode's preferences.</p>
  <p>Anyway, now my OS X Server can't seem to access the repository. Am I missing something here?</p>
  <p>Thanks</p>
  <p><strong>UPDATE:</strong></p>
  <p>I've come back to this problem after a month of pretending it didn't exist, and have made the following findings:</p>
  <p>-The problem occurs with OS X Server 3.2.1, OS X Server 3.2.2 and OS X Server 4.0, on two different machines.</p>
  <p>-The problem occurs when the repo is on a server running Gitblit, but not for remote Bitbucket repos, or for a Git repo hosted within a local OS X Server.</p>
  <p>-The problem only occurs for larger repos.</p>