Xcode Server won't build because source control information is in an invalid format - xcode

I have XCode Server set up with XCode 6.4 and OSX Server 4.1.5. I had integrations running fine until I transferred my git repository to another bitbucket account. No big deal right? Wrong for me :(. After I transferred my repository, I changed my git remote, I changed the repository location in Preferences in Xcode on my dev computer as well as on my server. Regular git functions are working fine from the command line and from within XCode. Nothing seems wrong until I try to run an integration and then it gives me the following build service error:
Could not check out sources because the source control information is in an invalid format.
I tried deleting my bot and creating another one. I tried cloning my project straight from the new location into another folder in case something had gotten out of sync. I git reset hard to the remote branch just in case even though there was nothing different. I tried cleaning and restarting everything multiple times. I reset XCode Server too (sudo xcrun xcscontrol --reset) and am still getting the error making me think I really did somehow mess up my git repository as far as XCode is concerned, but I have no ideas about what XCode doesn't like about my source control information. Does anyone have any ideas for what I can do or try? I've been tearing my hair out for hours.

Related

Xcode stuck on wrong git branch

When trying to change branches I got an error saying my credentials were bad. Since then, Xcode shows the wrong branch. When I'm in command line it allows me to change branches, pull, commit etc...
When I try to change branches in Xcode, it says the repository is locked.
There's no lock file in .git and I can change from terminal (xcode doesn't change)
I've wiped derived data, restarted etc...
I completely deleted the project and recloned from GitHub Enterprise.
For a second it seemed to work...
but I tried to change branches and my old branches showed up and I got frozen again.
had to clone to the same directory however
Where is this state being cached so I can delete it and start fresh?
EDIT:
I've completely deleted Xcode, redownloaded the version I'm using (10.3), deleted these caches:
sudo rm -R ~/Library/Caches/com.apple.dt
sudo rm -R ~/Library/Preferences/com.apple.dt
as per this answer: https://stackoverflow.com/a/52541405/4522329
After I was setup, I reconfigured my Apple ID and GitHub Enterprise Account and recloned a second time.
Again things looked fine, until I tried to change branches...
Then my previous local branches popped up again showing me back on an entirely different branch and any attempt switch throws a repo locked error.
When I run 'git status' from command line, tons of duplicate files were pulled in from some cache and I'm shown on the branch I expect to be. I can do whatever I want from command line (still no lock file in .git), but it's not reflected in Xcode!!!
Also the launcher screen on Xcode is showing older, formerly deleted projects. There's some Xcode cache that's trying to recover from somewhere...
So this was weird. Still not sure the underlying reason.
I was able to resolve by wiping everything out again, cloning to a different location opening up in Xcode and cycling branches from within the IDE and then cycling through a few from command line and confirming the IDE was updating.
After that I moved the project to it's previous directory address. When I opened Xcode the recents list had two entries for the project in that location. I cleared both, then opened by directly clicking on my xcworkspace.
So far so good.

Xcode 5: The repository could not be reached

I have this issue with Xcode 5 where I'm trying to commit a file to a remote git repository (BitBucket) and getting a pop up window with the following error: "The repository "project_name" could not be reached. Please verify that the repository is online and reachable and try again."
I've been working with this setup for awhile now (since Xcode 4) and didn't have any problems with it. Under Xcode->Preferences->Accounts->Repositories I saw the correct repository, but duplicated. I deleted and added it again, but it didn't help. I tried closing the project and rebooting the computer and it didn't help either. I can see the project's history under Source Control->History. I can access the repository on BitBucket.
Any idea where this is coming from and how to solve this issue?
Not sure if this helps in the tracking down of this problem, but here goes anyway:
I have been connecting to a local network git repository perfectly well for a number of months, but I encountered this problem later yesterday and nothing I did seemed to improve the situation. That included:
Rebooting both the development machine and the server;
Reinstalling Xcode from the App Store;
Re-cloning the project from the git command line (which could see the repository perfectly well);
Checking out the repository from Xcode (I was able to check out but every other operation, such as , Commit, Refresh Status etc. seemed to cause the problem...)
Manipulation the repository with SourceTree (which could also see it fine).
Eventually I stumbled across a solution to my local issue. If I launch Xcode with a wired and wireless network enabled then I can't see the repository. If I close it, disable wifi and relaunch it then I can.
I've not had much opportunity to work out what the difference is (especially as the wifi connects to the same network and is the secondary choice for networking) but it does seem to fix it.
Hope that might help others and hopefully I can find a real explanation soon!
Dave,
Well it seems this had nothing to do with Bitbucket.
The problem was a messed up .git folder on my machine.
My project resides in a Dropbox folder. Somehow, perhaps because of accessing it from different machines, it created copy/duplicate files in the .git folder and it messed up Git. After fixing all the conflicts Git returned to working as usual and I was able to commit from Xcode to the remote repository.
Now, if you encounter this issue, you might not have the same setup as mine or work on Dropbox or any similar service, but I strongly recommend checking your Git folder thoroughly. Good chance something is messed up there.
Check internet connection of system.also quit xcode and reopen it.

XCode 5 - the local git repository could not be reached

I created a project with local git repository using XCode 5 (preview 6), made some changes and tried to commit, and finally got the message "The repository 'HelloWorld2' could not be reached, please verify that the repository is online and reachable and try again".
The same message is also shown when the Refresh Status menu item under Source Control menu is clicked.
Actually, I have XCode 4.5 installed and run side by side with 5.0, but the issue does not exist when the project is opened using Xcode 4.5. Also, the commit action works fine as well via command line.
Not sure if this helps in the tracking down of this problem, but here goes anyway:
I have been connecting to a local network git repository perfectly well for a number of months, but I encountered this problem later yesterday and nothing I did seemed to improve the situation. That included:
Rebooting both the development machine and the server;
Reinstalling Xcode from the App Store;
Re-cloning the project from the git command line (which could see the repository perfectly well);
Checking out the repository from Xcode (I was able to check out but every other operation, such as , Commit, Refresh Status etc. seemed to cause the problem...)
Manipulation the repository with SourceTree (which could also see it fine).
Eventually I stumbled across a solution to my local issue. If I launch Xcode with a wired and wireless network enabled then I can't see the repository. If I close it, disable wifi and relaunch it then I can.
I've not had much opportunity to work out what the difference is (especially as the wifi connects to the same network and is the secondary choice for networking) but it does seem to fix it.
Hope that might help others and hopefully I can find a real explanation soon!
Dave,

XCode Won't Commit To GIT

Been googling for a while with no luck.
I have been working on my app for a week and I'm trying to commit to git now, so I can start branching and try some new stuff. But I can't commit my changes. I get the following message:
"The working copy "APP NAME" failed to commit files.
fatal: Could not switch to '/Users/Leonne/Documents/iOS Projects/APP NAME/APP NAME/Resources': No such file or directory"
I have initialized the git repository. I don't understand what could be going on.
Before, I did create a "Resources" folder, but deleted it afterwards. I never committed with the existence of this "Resources" folder. I deleted the Resources folder because it was giving me troubles whenever I tried to compile my app. I'm working with XCode 4.4.
Any help will be appreciated.
Ok, I just experienced this problem today morning. I don't know if mine is THE perfect fix. My Mac crashed and I restarted, and I could commit again.
If my fix hold true with you as well, then it could be a bug with XCode.
Edited
It seem my error still exists and the following is my fix.
It seem Xcode GUI have some problem with using GIT properly. So i used the terminal to do this. I went to the working directory and then did a git status this will show you a list of files that were deleted/modified/added. You can manually add them all together using git add or just a straight git commit -a (not recommended on complex projects)
This solved the commit issues and when i went to Xcode, the error doesn't seem to exists anymore
Looks like I have the bad habit of solving my hour-long problems 5 minutes after I post about them on StackOverflow, haha.
My fix was rather easy. I navigated to the specified route and re created the Resources folder. I added the folder to my project via XCode's "add files" feature. Directly afterwards I deleted it from there, moving it to trash. Now I can compile and commit, thank goodness.

Cannot get Xcode SCM to work with Gitolite based server

For whatever reason, I cannot get the built-in source control tools in Xcode 4.1 to work with the git repository I have setup on my server. The server is setup to use Gitolite.
Everything works fine from the command line. I can add the remote, push, pull, and then clone out again. I can also access Github in Xcode just fine.
Has anyone been successful getting these two tools to work together?
Any idea how I can debug this (I have no idea what Xcode is doing behind the scenes)?
The only thing that has stood out to me is that Xcode wants to include a top-level folder when accessing the repository, i.e.: git#my-server.com:folder/repository-name.git and Gitolite doesn't want you to do that. It wants: git#my-server.com:repository-name.git
I have a Gitolite 2.0.3 server running on Ubuntu 11.10, and I am able to use with the built-in SCM integration in Xcode 4.2 running on Snow Leopard.
To see log information about commits and other SCM operations, go to the Xcode log navigator (speech bubble icon in the left column, or select View > Navigators > Show Log Navigator, or press Cmd-9). The log navigator has filters to show only error messages. That should give you more information about what's going on.
One thing that stands out for me in your question is that when using Gitolite, I never use the .git suffix on the client went entering the git URI. Try omitting that and see if that makes any difference when working in Xcode. For example, I have git repositories on the server in folders like ~gitolite/repositories/project1.git or ~gitolite/repositories/apps/ios/project2.git, but when I am on the client, the git URIs look like: ssh://gitolite#myserver.com:12345/project1, or ssh://gitolite#myserver.com:12345/apps/ios/project2.

Resources