Continuous integration with Xcode Bots

2019-04-20 18:26发布

问题:

I want to to do the continuous integration using Xcode bots. I have installed OSX Mavericks and Server(version 3). I am able to create bots using Xcode 5.0.1. While integrating it is successfully performing analyzing testing but always the final integration result is failure.

Integration failed. Unexpected internal server error. See the integration's logs for more details.`

I didnt understand anything from the server error logs.Its failing due to some wiki service related errors.

Can anyone help me?

Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:233 7e026310 +0ms] didReceiveData
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:246 7e026310 +2ms] connectionDidFinishLoading
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:172 7e026310 +0ms] Out of runloop; request completed
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceProxy.m:79 7e026310 +0ms] Received successful response.
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:97 7e026310 +0ms] Updating bot run with GUID fc16d3af-093e-44aa-8a40-ebfef45bbbd9
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:102 7e026310 +0ms] Updating bot run (fc16d3af-093e-44aa-8a40-ebfef45bbbd9): {
        guid = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
        status = failed;
        subStatus = "internal-error";
    }
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSRemoteServiceClient.m:151 7e026310 +0ms] Connecting to https://localhost:4443/svc to execute [https]Request{XCBotService.updateBotRun:({
        guid = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
        status = failed;
        subStatus = "internal-error";
    })}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:159 7e026310 +0ms] Secure, async request
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:169 7e026310 +0ms] Before runloop; request pending
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:223 7e026310 +157ms] didReceiveResponse
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:225 7e026310 +0ms] response=<NSHTTPURLResponse: 0x7fd24a5a7980> { URL: https://localhost:4443/svc } { status code: 200, headers {
        "Accept-Ranges" = bytes;
        "Content-Length" = 3700;
        "Content-Type" = "x-apple/msgpack";
        Date = "Tue, 29 Oct 2013 04:48:41 GMT";
        Status = 200;
        "X-Apple-collabd" = yes;
    } }
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:233 7e026310 +0ms] didReceiveData
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:246 7e026310 +0ms] connectionDidFinishLoading
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:172 7e026310 +0ms] Out of runloop; request completed
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceProxy.m:79 7e026310 +0ms] Received successful response.
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:108 7e026310 +0ms] Updating bot with GUID 4e122aa2-56dd-4e3a-ad6e-25be1a65e657
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:117 7e026310 +0ms] Updating bot with latest bot run GUID key
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:124 7e026310 +0ms] Updating bot (4e122aa2-56dd-4e3a-ad6e-25be1a65e657): {
        guid = "4e122aa2-56dd-4e3a-ad6e-25be1a65e657";
        latestFailedBotRunGUID = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
        latestRunStatus = failed;
        latestRunSubStatus = "internal-error";
    }
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSRemoteServiceClient.m:151 7e026310 +0ms] Connecting to https://localhost:4443/svc to execute [https]Request{XCBotService.updateBot:({
        guid = "4e122aa2-56dd-4e3a-ad6e-25be1a65e657";
        latestFailedBotRunGUID = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
        latestRunStatus = failed;
        latestRunSubStatus = "internal-error";
    })}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:159 7e026310 +0ms] Secure, async request
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:169 7e026310 +0ms] Before runloop; request pending

回答1:

The problem seems to be that XCode5 Bots do not know how to use pure svn. You have to use svn+ssh.

[UPDATE] You could also use git ... synchronized with your SVN. The workflow ist slightly different, but it works great.

I found this today: subgit

It perfectly integrates into GIT and SVN, you can set up GIT repositories in Xcode Server and upgrade them with subgit - they will both stay in sync. (took me about half an hour to completely understand how it works)

Best of all: a 10 seat license (meaning 10 collaborator via subgit) is totally free (and quite enough for my use case).

[PREVIOUS ANSWER] I made a simple solution that involves an SSH Server on the SVN Server machine. I think it does not matter which one, but I'm currently using Cygwin.

In the /etc/sshd_config you need to add a subsystem

Subsystem "svnserve -t" /etc/svnserve-proxy

You need to create the file /etc/svnserve-proxy

cat > /etc/svnserve-proxy
#!/bin/bash
svnserve -t -r <repository>

You have to modify the svnserve command and repository respectively. On your local computer you have to modify the file ~/.subversion/config and add a [tunnels] line:

[tunnels]
ssh = $SVN_SSH ssh -v -l <username> -s

username is the name of the user you want to authenticate with. This solution is quick and dirty and does not allow for different users to authenticate. In addition, Xcode needs to use the same username on your local machine and the Bot-Server. It is quite possible that you have to create a _teamsuser home directory and put an subversion/config in there as well.

An alternative would be to use public-keys (As the bot server already creates) You can then put these into authorized_keys and put a command in front:

command="svnserve -t -r <repository> --tunnel-user=<user>" rsa-ssh AAA


回答2:

I had a similar problem. In my case it was issue accessing the source code repository. The OSX Server had DNS issue which was preventing it from reaching the host. Can you check if you are able to access your source code repository?



回答3:

With Xcode 9 apple brings ease to continuous integration with Xcode bots.

Xcode Server built-in. Continuous integration bots can be run on any Mac with Xcode 9, no need to install macOS Server.

I found very good article explaining how to configure it with Xcode 9.

Xcode9 - Xcode server comprehensive iOS continuous integration