0

EDIT:
The problem is apparently solved with OSX Server Version 4.

Original post:
I have some git repositories on OS X server. Earlier I could access them from a remote Xcode without problems.
After the upgrade to OS X Server 3.2.1 with Xcode 6.0.1, I can no longer access them:

If I try to add the server to a the Xcode via Preferences / Accounts, it says

Xcode Server is unavailable 

If I try it via the terminal with the command

git clone <repository path>

it is asking for the password (i.e. it can access the server), and then says

fatal: repository '<repository path>' not found  

It is really annoying since everything worked fine before. Any help how I could fix this?

EDIT 1:

Of course, the new OS X server shows the repositories under Xcode / Repositories, so they are still there...

EDIT 2:

I just realized that sometimes (very rarely) a local Xcode as well as a remote Xcode find the repositories and can access them either immediately, or after asking for the password. Very frustrating!

EDIT (due to the answer of Dan Hansen):

I tried to use SSH, but failed:

  • On the remote OS X server, I enabled SSH access to the repositories.
  • On my Mac under Xcode, I added the remote repository using SSH protocol. This worked fine.
  • I then tried a pull under Xcode, and was asked for the password. After entering the correct password, it claimed that it were wrong.
  • Further accesses from Xcode always gave „no remotes“.
  • I switched to terminal, and issued a „git clone“ command. I was asked 3 times for the password, and got then the error „Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive)“

So it seems to me like an authorization problem, but I don’t know how to approach it.

2 Answers 2

2

I encountered this same problem after the upgrade and worked out a fix that works for me. Perhaps it will help you as well.

I have an HTTPS GIT repository running under the Xcode service in the Server app. I use it for syncing projects that are on the local macbook pro (the Server), a VM (virtual machine) running Win 8.1 and a remote VM running on another macbook pro (also Win 8.1).

On the two macbook pro's I use Xcode to interact with the GIT repo. I use "GIT bash" command line to interact with the Win 8.1 repo(s). Works great.

The upgrade to OS X Server 3.2.1 with Xcode 6.0.1 broke my repositories. First I encountered certificate issues - once I worked through those I started getting the "fatal: repository ... not found" errors you are seeing.

I researched the issue and started digging into the logs and new Service. I suspect the underlying problem may be something like a bad symlink (there were complaints in the log about ScriptAliases for /git being wrong) but the more I dug into the new directory structure the more I saw it was a bit of a convoluted beast, and I did not really want to just start messing around with the symlinks, etc. Seemed like a formula for disaster.

The fix for me was to switch to using SSH for referencing the repo (rather than HTTPS).

So on the remote VM I did the following:

git remote rm origin

git remote add origin ssh://dhansen@my-server-address/git/my-repo.git

git push -u origin master

Of course, I had to make sure that I had "remote login" turned on in "Sharing" and had ssh set up properly, but otherwise it worked like a charm.

On the other remote VM, I had to do much the same thing. I did encounter a wrinkle when trying to push from one of the remote Win 8.1 VM to the second Xcode service repo, when it had an error "remote:error: insufficient permission for adding an object to the repository database ./objects. remote: fatal: failed to write object"

I had to:

cd /Library/Developer/XcodeServer/HostedRepositories

and change the permissions. Looked like somethings were now root:_xcs and some were owned by root:_www.

That fixed the last issue. And now it all works like a charm again, I am much relieved, though annoyed I had to spend so much time troubleshooting it.

It is a complete annoyance that a normal upgrade broke perfectly fine HTTPS connections to the repositories, but luckily for me it looks like you can work around it using SSH.

Good luck!

5
  • Thanks for this very detailed answer. So I know I am not the only one, and it is probably not my fault. I tried to use SSH, but could not solve my problem. I will edit my question accordingly. Sep 25, 2014 at 7:17
  • Are you able to ssh to that remote machine from your mac using the command line? That is, can you from a terminal
    – Dan Hansen
    Sep 29, 2014 at 4:28
  • As I mentioned in my edit above, I also tried to access the server from the terminal using a git command, and got "„Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive)“". Sep 29, 2014 at 4:55
  • I meant, are you able to ssh directly (not with git) to that remote machine from your mac using the command line? Can you from a terminal type "ssh mylogin@remote-system" and login into the remote system? That will at least tell you whether you have your basic ssh set-up correctly for your account. Did you ssh-keygen your ssh keys on the remote machine? The first time you try to ssh into the remote machine from the command line, it should ask or tell (I forget which) you that your machine is getting added to known-hosts. Anyway, if basic ssh logins don't work,that might be the problem.
    – Dan Hansen
    Sep 29, 2014 at 7:01
  • I just tried to ssh directly. I was then asked for the password 3 times, and then I got again the error message "Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).". Sep 29, 2014 at 8:47
0

Maybe this will help. Seems like xCode bug for me. Instead of trying to add an repository in xCode preferences in accounts tab i did next steps (some might be unnecessary):

1) Goto xCode Preferences -> Accounts and delete bugged repository if it present (it seems like even if you chose username xCode deleting it)

2) Goto Keychain Access and delete key for your repository if it present

3) Goto Source Control -> "Your_Project_Name - Your_Branch_Name" -> Configure Your_Project_Name -> Remotes. Check if there is your remote and IF NO add it, you'll only need url without login and password. Then go to tab Branches and xCode will try to receive remote branches and will ask for your login and password. After i entered it, repository was added properly to my accounts and i can use it for pushes.

1
  • I tried your solution, and everything works as you described, until the last step: After I entered the password, I get the message "fatal: repository ... not found". So the password is OK, but it does not find the file although the OSX Server shows in the Xcode/Repositories tab that it is there. Nov 10, 2014 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.