Frequently Asked Questions

Contents

This FAQ is not meant to be a complete reference to CruiseControl.NET, but does provide some quick ideas about how to get various things done.

If you want to add questions, answers, or both, please use the ccnet-user [mailing list | Mailing Lists]

CruiseControl.NET Server

Operation flow of CCNet

The exact sequence of operations is:

 1) Wait for the triggers to awaken.
 2) Ask the source control system for a list of the modifications since the last build.
 3) If any modifications were found or if the triggers said "force the build":
    3.1) Generate a label for the build.
    3.2) Run the prebuild tasks in the order specified, failing the build in case of error.
    3.3) Get the source code from the source control system.
    3.4) Run the build tasks in the order specified, failing the build in case of error.
    3.5) If the repository should be labeled:
         3.5.1) Let the source control system apply the label.
    3.6) Run the publisher tasks.
 4) Go to 1.

Installation

When I run the installers, McAfee VirusScan 8.0 is popping up a dialog reporting problems with 'nsScm.dll'.

The 'nsScm.dll' is a library supplied by the [NullSoft installer for installing services|http://nsis.sourceforge.net/Service_Control_Manager_plugin_(install_services_and_drivers_on_NT/2K/XP)]. There is no virus in this dll.

Connection Issues

CCtray can not connect to the buildserver using remoting

  • First check that the used port is correct, standard it is 21234. If you never changed this, or it's the first time you see this number, this setting will probably be correct.
    You can find the value in the exe.config files (CCNet.exe.config, CCService.exe.config) in the system.runtime.remoting/application/channels part.
  • Next, check the firewall on the server. You can do this by running the following command in a prompt : netsh firewall show portopening
    If you get an empty list, no firewall is on, if you see a list, check that there is a line containing the correct port : standard it is 21234
    To open the port, run the following command : netsh firewall add portopening TCP 21234 CCNET

Dashboard works on the server itself, but not from another machine

  • check that you can ping the server
  • use the telnet client to check if the webserver service/daemon works :
    telnet <servername> <port>
        get
    
        Example
         telnet buildserver 80
         get
    
         Result :
    
             <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
             <HTML><HEAD><TITLE>501 Method Not Implemented</TITLE></HEAD><BODY>
             <H1>Method Not Implemented</H1>
             get to /index.html not supported.<P>
             Invalid method in request get<P>
             </BODY></HTML>
    
             Connection to host lost.
    
             The above error is normal, the webservice shows it to you
    

Result files

Why are my test results showing up when the build succeeds, but not when the build fails?

In the ccnet.config file, you need to move your [File_Merge_Task|File Merge Task] section from the Tasks Block to the Publishers Block. The reason is that the first task to fail in the tasks section will prevent any further tasks from being run. If this task is your Merge Task then your test result files will not be included in the build. All tasks in the publishers section will run regardless of whether previous tasks succeed or fail.

CCNet sometimes throws an exception during a task, but there's no information in the log about where the task triggered the exception?

This can happen, for example, if a task times out. A good practice that helps in these situations is to specify an explicit task-level log file for each task, different for each task. If CCNet fails to merge in that log file, then at least you can check the actual log file before it's been merged. (Also, see the preceding FAQ about merging output from failed tasks.)

For example, with a NAnt task you could use:

<nant>
<buildFile>ProjectA.build</buildFile>
<targetList>TargetX</buildFile>
<buildargs>-l:projecta.targetx.log.xml ...</buildargs>
...
</nant>

Then if the task crashes and CCNet doesn't merge in the NAnt log file, you can go to projecta.targetx.log.xml in the working directory, to see the original output from NAnt.

Debugging the server

My build is failing, and I'm not sure why

CCNet integrates with external applications via the command-line, hence it is essential that the command executed by CCNet is correct for everything to work:
  1. As a first step, verify that you can run your build script or connect to your sourcecontrol system from the command-line.
  2. If this works or if you're not too sure what command to execute, you can get CCNet to tell you what command it is using. To do this, go into your ccnet.exe.config file (or ccservice.exe.config file if you are running ccservice) and increase the trace level of the CruiseControlSwitch to the debug level of 4. When you restart the CCNet server, it will write out the commands the it is using to the console window (and to the ccnet.log file). Try copying and pasting this command into a new console window and running it directly.
  3. If you are still unsure of what the problem is or if you think that the command that CCNet is creating is incorrect, please send an email to the CCNet user mailing list above including :
    1) a copy of the command you are executing,
    2) the output it produces and
    3) a copy of your ccnet.config file.

According to the documentation, I need file xxxxxxxx.yyy. That file isn't in the distribution, where do I find it?

It's likely that you have fallen into the classic mistake of overlooking that the documentation on the web site relates to the most recently built version, not the most recently released one. If the file in question is referenced in the /doc folder of your CCNet installation then ask on the CCNet user mailing list - you have probably found a documentation problem. If the file is not referenced in that folder, but is referenced in the online documentation you may want to try a more recent build from [http://build.nauck-it.de/ViewFarmReport.aspx]. If you choose to do so, please be aware that builds from CCNetLive may contain more bugs than officially released versions of CCNet.

CruiseControl.NET is reporting that the build succeeded when it failed. Why?

When triggering external tools like NAnt, MSBuild and even Devenv CruiseControl.Net uses the "ErrorLevel" exit value returned by the tool to determine if the process was successful. In most such tools, zero is returned if the task succeeded. A non-zero value is typically used to indicate a failure, and when it sees a non-zero value CCNet will report that the task failed.

If the tool you are using does not respect these conventions (like, for example, Microsoft's FXCop utility), then CruiseControl may report failure (or success) incorrectly.

The easiest way to find out what ErrorLevel is returned by the tool is to use a small batch file like this:

C:\Path\To\Your\Tool.exe -Command -Line -Parameters "As triggered by CruiseControl.Net" 
Echo %ErrorLevel%

Run the batch file from a command prompt and check the response. This should confirm if the problem is that the tool is returning the wrong value (most likely) or you have found a bug in CruiseControl.Net.

Some users have reported that occasionally even though the return value can be confirmed as non-zero using the command prompt it is not recognized as a failure by CruiseControl.Net. It may be possible to work-around this is as follows:
  1. Create a batch file which simply executes the command, then does a exit errorlevel
  2. Change the CC.Net project to invoke the batch file as "CMD /C batch-file".

New configuration in ccnet.config is not used

If you have introduced errors to your config file CruiseControl.NET will fail to load, and keep using the already loaded old configuration. So check the log, or stop the service and run the commandline tool to fix the configuration problem.
From version 1.4.3 onwards there is a visual validator program, that parses the config file like CCNet does, so this makes it easy to spot configuration issues.

The ccnet.config file

Why do I get an Unused node detected error when I start up the CCNet server?

You will get these warnings if your ccnet.config file contains invalid elements or attributes. Please double check the documentation that came with your installation (in the /doc folder). Please be aware that the documentation on the web site may reflect a more recent version of ccnet than what you have installed. If you are attempting to use a task or a property that has not been implemented in your server's version of ccnet then you will get this error.
There is also the Validator Tool , which helps a lot, this can be found in the same folder as CCNet.exe

Are there project properties available to reduce duplication in the configuration ?

Properties as in Nant or MSBuild (e.g., "$(workingDirectory)") are supported from CCNet version 1.4RC1 and upwards. See the [Configuration_Preprocessor] documentation for more details.
Previous versions can reduce some duplication in the configuration with the use of XML DTD entities (e.g., "&workingDirectory;").

Using the CCNet Service

My build can't find environment variables when run from the service, but it works fine manually or from the ccnet command line server

You may be running the CCNet Service under the account, or some different account other than your own. Many environment variables under MS Windows are set on a per-user basis, which means that the account won't have the same variables as you. Depending on the circumstances, you might want to move those environment variable definitions to be system-wide. Another alternative is to run the service under your account, or create a separate account for use by CC.Net. Finally, some tasks such as NAnt can explictly create environment variables for themselves (but these won't be passed on to other CruiseControl.Net tasks).

Remarks :
  • It turns out the path (and all environment variables) are read only once, at system start-up. So if the path is changed while the system is running the services will not detect any changes to it (at least in Win2003 see [http://support.microsoft.com/kb/887693]).
  • Sometimes you may get errors even if you do not use the system account. For example : if you use 'DevEnv.exe' via the exec task, you CAN{_} get '_the application data folder for visual studio could not be created_'.
    It is always advisable to not use IDE's on a build server. The above problem is easily solved by using msbuild. just point to to the sln file.
    so iso of     devenv c:\source\myFunkyStuff.sln{_}    use    msbuild c:\source\myFunkyStuff.sln{_}

My build is failing and I'm not sure why

  1. If you are having trouble running your build through CCService, start by making sure that everything works via the CCNet console application. The console application is typically easier to configure and debug.
  2. If the console build works but fails when running through the service, please consult the [CCService|The Server Service Application] page for a suggestions on solving the common problems that users face.

The ccnet.exe command line works but ccservice.exe doesn't

Problems with ccservice.exe that don't happen with ccnet.exe almost always come back to one of two things:
  1. First is the fact that they each use a different app.config file, ccservice.exe.config and ccnet.exe.config respectively, and you should usually make changes to them in tandem. This isn't often the problem, but it's always worth investigating.
  1. Second, and most common, is that ccnet.exe runs under the account of the logged in Windows user, and ccservice.exe runs under the local system account. This often shows up as the cause of problems with source control systems misbehaving, especially if it maintains user credentials someplace (e.g., under USERPROFILE).

Source Control Integration

Visual Source Safe

Why is the vss source control block throwing errors when CCNet is running as a service but works when running CCNet from the command line?

In order to access VSS, you must be able to access the shared folder on your VSS server from your CCNet server. The CCNet service is set to use a local system user account by default which doesn't have access to other machines. In order for CCNet to access VSS, you must change the log account for the service to a user that has network access to the VSS machine. More details can be found in the [SourceSafe_(vss)] section.

All Source Control Packages

My build process updates one or more files under source code control.

CruiseControl.NET then thinks my code has changed and rebuilds again. How do I stop this cycle?

This problem is most commonly associated with updating AssemblyInfo.cs (or similar) files containing build-specific information.

The simplest solution is to ensure that these files are not placed under source control, but are always generated at build time. Unfortunately, this may not always be an appropriate way to resolve the problem. In such circumstances, you may want to use a [Filtered Source Control Block] to exclude the files modified during the build process.

Web Dashboard

The Web Dashboard fails to render, what could be the problem?

If you installed IIS after the .Net framework was installed, you need to register ASP.Net with IIS. You can do this by running the aspnet_regiis.exe tool found under \Windows\Microsoft.NET\Framework\v2.0.50727\

How do I change the look and feel of the Web Dashboard?

The look and feel of the Dashboard is defined by the velocity templates and xsl files in the and sub-folders of your Web Dashboard folder (which by default is at .)
From version 1.4.3 and onwards CCNet supports theming take a look at [Dashboard Plugins|CCNET:Plugins Configuration Block]for more information.

How can I get the output of Tool X / my custom program in the dashboard ?

If the tool creates an result file, use the [merge file|CCNET:File Merge Task]task to get it into the build result. (mostly done in the publisher section). If the result file is XML, the handling goes a lot easier.
Next you must create a xsl file that will parse the resultfile that is now part of the buildlog to visualise the outcome. See the section above.

How do I prevent all these unwanted messages from showing up in the warning/error sections of the WebDashboard?

When executing external processes, CCNet will identify any output written to the standard error stream in the error or warnings section of the WebDashboard. To supress these messages, you can redirect the stderr stream to stdout as shown in the example below. '2' refers to stderr and '>&1' redirects it to stdout ('&1').

dir /f 2>&1
<pre>

h4. Handler "CCNetHttpHandler" has a bad module "ManagedPipelineHandler" in its module list

add the following element to the httpHandlers in web.config
preCondition="integratedMode" 
<pre><code class="xml">
<httpHandlers>
    <!-- Yes, we are overriding .aspx - don't delete this! We are using .aspx since we know it is already bound to ASP.NET. In future we might use a
        different extension so that people can add their own ASP.NET pages if they want to, but we should make sure in that case to change how
        URLs are created -->
    <add verb="*" path="*.aspx" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard" preCondition="integratedMode"/>
    <add verb="*" path="*.xml" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard" preCondition="integratedMode" />
</httpHandlers>
</code></pre>

h4. Displaying build progress in the Dashboard

Standard CCNet will show basic information in which stage of the build it is :

getting Source
Executing task X

This can be extendended, for Nant and MSBuild look at [Viewing build progress with Nant and MSBuild|CCNETCOMM:Viewing build progress with Nant and MSBuild] in the Contribution section.

h1. CCTray

h4. Displaying build progress in CCTray

Standard CCNet will show basic information in which stage of the build it is :

getting Source
Executing task X

This can be extendended, for Nant and MSBuild look at [Viewing build progress with Nant and MSBuild|CCNETCOMM:Viewing build progress with Nant and MSBuild]in the Contribution section.

h4. Error ThoughtWorks.CruiseControl.CCTrayLib.Speech.SpeakingProjectMonitor..ctor

You need to install the Speech software SDK from Microsoft
[http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&displaylang=en]

WinXP SP1 has it by default, earlier windows versions must install it separately