Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Xcode - Unable to Connect to Remote Repository

I have a mac mini running OS X Server 4 on Yosemite 10.10.1 and I am trying to set up the Xcode server to host my repositories.


On my development machine, when I try to create a project on the remote server, or when I try to push to the server I get the error..


"Unable to Connect to Remote Repository

Could not connect to the remote repository because the server was unreachable. Verify the server is running and try again."


My machine knows that the remote server is there and alive. I am able to add the server in Xcode preferences without any problem.

I can even pull projects that were already on the server. But anything new I cannot push or create.


All the other services I use on the server are working. Hosting a website, Screen sharing and I can SSH into it without any problem.


The strangest part is that when I get the error about being unable to connect, the project I am trying to push actually does show up on the server.

The project shows up on the server in the Repositories. Just my development machine doesn't know it.


Its driving me nuts, can anyone offer any ideas?

OSX Server-OTHER, OS X Yosemite (10.10.1), OSX Server 4.0

Posted on Dec 2, 2014 10:37 AM

Reply
13 replies

Feb 25, 2015 2:00 PM in response to justinbattle

I had the exact same problem. However my case might be special, because I've changed the default SSH port from 22.

After that you can say that it is "normal" that the Xcode doesn't find the remote server. (Good question how is it able to create

the repository itself, but I assume it is doing it with another protocol (?))


So the solution is that I have created this faulty repository and then clicked on "Add remote..." and entered the following address.

ssh://myusername@IPAddressOfServer:XXXXX/git/... where that XXXXX are the new SSH port number.

(I only checked it with direct IP address but I suppose it should work with domain names too.)

Feb 27, 2015 1:45 AM in response to kevinfromnürnberg

The service "Web sites" visible in Server.app isn't totally correlated to the Apache server. It's just the interface for e g setting up your own web sites so some services activate Apache on their own when the service in question is activated, like Profile Manager. It's inconsistent though to have to manually activate web sites for some services and not for some but I think it has to do with activating general access to the web server. Wiki and similar things are more "general" than, say, Profile Manager. That's just a speculation though trying to find the principle behind when the service "Web Sites" needs to be activated or not.

Mar 1, 2015 11:57 AM in response to justinbattle

You said you had SSH access working so this may be a different issue. I was able to ssh into my server only with my admin account which made me think that ssh was working, but it turns out it wasn't for all user accounts. I had the same error message and it turned out I could not ssh into the server with my developer accounts. If I tried to clone a local repository to the server I got the same error, however the repository was actually create, but it was empty. For reasons that don't matter to this discussion I originally setup all my users as "local network users" with no "Home Folder". And that was the problem. Basically ssh won't allow you to login without a home directory.

I had to go back and add a "Home Folder" of "Local Only" for those users who were going to have xCode access. Once the "home" directory was created I could login via ssh on those accounts AND creating and cloning repositories through xCode worked fine. The admin account that I was able to login with already had a home directory and wasn't a network user.


Your issue slightly different even though I got the same error message, so not sure if this will solve your issue or not. But on the off chance that it is the same issue, I figured I would post my solution to my problem. ymmv


P.S. I did turn off websites on my server and haven't turned it back on yet, so not sure if that will be a problem if I turn it back on.

May 24, 2015 2:50 PM in response to justinbattle

Ok, I had the same problem and for me it seems that it has problems resolving the server.


I managed to get the project running by first creating it in Xcode (which then brings the error mentioned in this thread), checking out the (empty) repository at a new location, then copy the contents of the old location and commit and push those changes. Really not what you want to do. When I then tested CI, I noticed that I could not use the "Archive" button of the web interface, giving me an error that it could not access my server and I should try to enter it in Xcode preferences.


In my case, I have a server named "Daniel's iMac" which Xcode has no problem to find (e.g. when it asks me on which Server to create the git repository).

When I created a repo in Xcode server, it would have the following address: "https://daniels-imac.fritz.box/git/MyProject.git".

So then I tried to add daniels-imac.fritz.box manually in the Xcode preferences. It actually found the server and asked for my credentials.


Then I tried to create a new project, including git repo using the newly added server. And it actually worked!

Xcode - Unable to Connect to Remote Repository

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.