7

I'm running several projects in CruiseControl.NET. Many of them have no build errors and have successful builds. They all try to pull the latest code prior to building.

I've noticed that they frequently fail building; CruiseControl reports "Exception." The exception is an SVN 500 error (internal server error). It strikes randomly but persistently (eg. in one project, every alternating build fails).

I've tried checking out some of these sporadically failing projects with the same credentials, and it works. I know the projects build, because not every build fails.

What could the problem be?

For what it's worth, here's the top line of an exemplary exception (without SVN project URL or credentials):

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: Server sent unexpected return value (500 Internal Server Error) in response to OPTIONS request for 'https://some/url/trunk'
. Process command: C:\Program Files\CollabNet Subversion Client\svn.exe log https://some/url/trunk -r "{2010-12-04T09:09:19Z}:{2010-12-07T09:08:48Z}" --verbose --xml --username ******** --password ******** --non-interactive --no-auth-cache

Edit: Sometimes this seems to be because there's an SVN conflict in the local folder. But it's not consistent.


Bounty: I've added a bounty for a general solution to this: how can CC.NET be configured to gracefully cope with SVN errors, i.e. do not treat SVN failures triggered by a periodic update check (as opposed to scheduled daily builds) as build failures but instead gracefully back off until it's fixed or until the connection recovers.

I haven't managed to figure this out myself, although I'm not a CC.NET expert and haven't looked for a long time. Is there support for this or would it need coding up? Thanks!

To clarify,

  • We have a CC.NET server to set up to check for new commits and checkout + build + test all changes then report the result.
  • If, however, the SVN server goes down or if we lose connection to it then it treats this as if the last commit broke the build: it sets the build status to red and emails the last committer as if it was their fault.
  • Yes, this would be a problem for a once-a-day build job but for continuous every-commit integration I don't think this is useful behaviour.
Rup
  • 33,765
  • 9
  • 83
  • 112
ashes999
  • 9,925
  • 16
  • 73
  • 124
  • Regardless of the cause, I'd also be interested in a way to configure CC.NET to ignore SVN exceptions rather than failing the build. – Rup Dec 08 '10 at 21:15
  • Shouldn't your CI setup produce whatever a clean checkout would produce? If so, then if an exception happens, your entire build environment would be invalid. – Mark Dec 10 '10 at 15:55
  • To be 100% clear here, in the case of a source control failure, what exactly would you be building? At best, certainly something unreproducible, and therefore useless. At worst, something that wouldn't build at all. – Mark Dec 10 '10 at 15:57
  • 2
    @Mark I'm not so much interested in the build output but more the reporting and failure notification. We've set up CC.NET to run for every new commit: fetch new checkout, build, test, report failures. If however our SVN server goes down, or we lose connection, then CC.NET will flag this as a build failed, change the project traffic lights to red and email the last committer with a build failure error. However it wasn't his fault. Yes, I realise this is a serious error if we were using CI to build a once-a-day release for testing but for continuous per-commit testing it's not useful. – Rup Dec 10 '10 at 16:14
  • 1
    I'm pretty sure there's no way to configure CC.NET out of the box to ignore these SVN events, but "fortunately", for some definition of "fortunately", the CC.NET code is Open Source and not-too-difficult C# code. Could probably hack an option into the SVN provider. – Adam Vandenberg Dec 10 '10 at 16:31
  • @Rup this is precisely the same case I'm seeing -- people are being notified of failures when nothing changed. This is a big problem. – ashes999 Dec 10 '10 at 17:05
  • 1
    This might help: http://stackoverflow.com/questions/1156911/cruisecontrol-net-build-fails-when-svn-is-not-available – alexandrul Dec 14 '10 at 14:56

1 Answers1

1

One hard way of solving this problem would be to check for modifications with a batch file or a custom wrapper (instead of the source control facility of CruiseControl.NET) that calls the svn client and creates a file (or some other way of signaling changes) if the build is required. The batch or wrapper could treat the exceptions as needed. Of course, this solution might require altering the rest of the build process.

alexandrul
  • 12,856
  • 13
  • 72
  • 99
  • 1
    Thanks - neat idea. I'll give you the bounty but more for your comments that pointed me at some config options that already exist for that, as in these old questions http://stackoverflow.com/questions/2086957/can-we-tell-cruisecontrol-net-to-ignore-source-control-timeout-errors/2086994#2086994 http://stackoverflow.com/questions/1156911/cruisecontrol-net-build-fails-when-svn-is-not-available/1156955#1156955 that I'd somehow missed. Thanks - I'll play with those, and when I get time I'll dig into the CC.NET source and develop anything else I need. – Rup Dec 16 '10 at 11:48
  • Happy that you found it useful. – alexandrul Dec 16 '10 at 11:52