justinbattle

Q: 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, OS X Yosemite (10.10.1), OSX Server 4.0

Posted on Dec 2, 2014 10:38 AM

Close

Q: Xcode - Unable to Connect to Remote Repository

  • All replies
  • Helpful answers

  • by kevinfromnürnberg,

    kevinfromnürnberg kevinfromnürnberg Dec 15, 2014 1:36 AM in response to justinbattle
    Level 1 (0 points)
    Dec 15, 2014 1:36 AM in response to justinbattle

    Same here...

    I'have also the effect that the WebDAV access (e.g. via Pages from iPad) isn't working if xcode is activated on the Server.

     

  • by tlawrie,

    tlawrie tlawrie Dec 17, 2014 2:37 PM in response to kevinfromnürnberg
    Level 1 (0 points)
    Dec 17, 2014 2:37 PM in response to kevinfromnürnberg

    Did anyone find a solution to this issue?

  • by kevinfromnürnberg,

    kevinfromnürnberg kevinfromnürnberg Dec 21, 2014 11:18 AM in response to kevinfromnürnberg
    Level 1 (0 points)
    Dec 21, 2014 11:18 AM in response to kevinfromnürnberg

    Solved on my side.
    I didn't activate the Websites...

     

    After activating websites and Xcode, push/pull (etc.) is working and webdav access via iPad as well. Surprisingly Wiki and Profile manager is running without "websites" started.

  • by maithri.vm,

    maithri.vm maithri.vm Jan 19, 2015 1:25 AM in response to justinbattle
    Level 1 (0 points)
    Jan 19, 2015 1:25 AM in response to justinbattle

    Were you able to solve this issue? I too am riding along the same boat and frustrated!

    Please advice!

  • by shmohajerani,

    shmohajerani shmohajerani Jan 21, 2015 10:36 AM in response to justinbattle
    Level 1 (0 points)
    Jan 21, 2015 10:36 AM in response to justinbattle

    I have the same problem, can create any new repository via Xcode even on the server machine.

    (it actually creates the repository but not link it back to Xcode!)

    I use no WebSite or any other services but file sharing ..

     

    Any Solution?

  • by mdesjardins123,

    mdesjardins123 mdesjardins123 Jan 28, 2015 8:42 AM in response to justinbattle
    Level 1 (0 points)
    Jan 28, 2015 8:42 AM in response to justinbattle

    I have that same problem. Actually, the repository get's created but still have that error message. If later I decide to commit to the server, it does work and I can continue using the GIT reposiroty has usual. It's just an error message on the creation of the repository.

     

    Timing issue maybe...

  • by Farkas Seb,

    Farkas Seb Farkas Seb Feb 25, 2015 2:00 PM in response to justinbattle
    Level 1 (5 points)
    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.)

  • by Farkas Seb,

    Farkas Seb Farkas Seb Feb 25, 2015 2:28 PM in response to Farkas Seb
    Level 1 (5 points)
    Feb 25, 2015 2:28 PM in response to Farkas Seb

    Another possible error is that the DNS doesn't work correctly and Xcode cannot find the given address.

    ssh://myServer.private/git/... won't work...

  • by theFerret,

    theFerret theFerret Feb 27, 2015 1:45 AM in response to kevinfromnürnberg
    Level 1 (15 points)
    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.

  • by dboals,

    dboals dboals Mar 1, 2015 11:57 AM in response to justinbattle
    Level 1 (0 points)
    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.

  • by Artaqif,

    Artaqif Artaqif Mar 9, 2015 2:35 PM in response to dboals
    Level 1 (0 points)
    Mar 9, 2015 2:35 PM in response to dboals

    Work for me thank you!

  • by mdesjardins123,

    mdesjardins123 mdesjardins123 Apr 17, 2015 12:56 PM in response to dboals
    Level 1 (0 points)
    Apr 17, 2015 12:56 PM in response to dboals

    Good job DBoals,

     

    This is now working perfectly for me!

     

    Thank you my friend!

  • by Nostradani,

    Nostradani Nostradani May 24, 2015 2:50 PM in response to justinbattle
    Level 1 (0 points)
    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!