CruiseControl.NET Crypto exception

If you are having a problem using Fortress, post a message here.

Moderator: SourceGear

Post Reply
BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

CruiseControl.NET Crypto exception

Post by BigBrett » Fri May 30, 2008 5:23 am

I recently installed CruiseControl.NET 1.3 on a server (which also hosts the Fortress 1.1.1.18060 server) to do continuous builds.

The build process will function for a while then I see an exception being thrown as follows:

Code: Select all

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: 
Unhandled Exception: System.Security.Cryptography.CryptographicException: Keyset does not exist

   at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
   at System.Security.Cryptography.SafeProvHandle._FreeCSP(IntPtr pProvCtx)
   at System.Security.Cryptography.SafeProvHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
   at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
   at System.Runtime.InteropServices.SafeHandle.Finalize()
. Process command: C:\Program Files\SourceGear\Fortress Client\vault.exe versionhistory $/<repository path> -rowlimit 1 -host <hostname> -user <username> -password <pwd> -repository <repository>
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Vault3.ExecuteWithRetries(ProcessInfo processInfo)
Once this starts there is no way for the builds to happen as the exception is thrown continually.

Where should I be looking to solve this problem ?

I have stopped the build server for the time being as the exception causes the JIT debugger dialog to display, and having 300+ dialogs to close when I noticed this had happened was a major pain.

Cheers,
Brett

ian_sg
Posts: 787
Joined: Wed May 04, 2005 10:55 am
Location: SourceGear
Contact:

Post by ian_sg » Fri May 30, 2008 7:59 am

Do you have CruiseControl.NET running as a service, or as a console app? What Windows user is it running as? Is someone logging off the machine when the error starts?
Ian Olsen
SourceGear

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Fri May 30, 2008 8:06 am

Hi Ian,

CruiseControl.NET is running as a service with Administrator credentials. Administrator is logged on at the time.

This might have started when one of our IT guys rebooted the server to get a new KVM box to function with the server.

Cheers,
Brett

ian_sg
Posts: 787
Joined: Wed May 04, 2005 10:55 am
Location: SourceGear
Contact:

Post by ian_sg » Fri May 30, 2008 8:08 am

Do you always get this error now, or does restarting CC.NET get it working again for a while?
Ian Olsen
SourceGear

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Fri May 30, 2008 8:14 am

The error seems to occur continuously now, even stopping and starting CruiseControl.NET does not help.

Cheers,
Brett

ian_sg
Posts: 787
Joined: Wed May 04, 2005 10:55 am
Location: SourceGear
Contact:

Post by ian_sg » Fri May 30, 2008 8:35 am

Try re-installing the Vault client. If that doesn't work, I'd try re-installing the .NET framework.
Ian Olsen
SourceGear

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Fri May 30, 2008 8:57 am

Thanks, will try that first thing Monday morning.

Cheers,
Brett

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Mon Jun 02, 2008 5:59 am

After installing Fortress 1.1.2.18185 Server and Client, and reinstalling .Net Framework 2.0 SP1, CruiseControl.NET has started working again, with one new wrinkle.

I also installed the new CCNET plugin for Fortress, and updated the ccnet.config file to suit. CruiseControl.NET runs fine if I run the console app, but has a problem if I try to run the service.

The service will quit as soon as Fortess is accessed. The relevant portion of the log file is as follows:

Code: Select all

2008-06-02 11:50:08,656 [CCNet Server:INFO] Reading configuration file "C:\Program Files\CruiseControl.NET\server\ccnet.config"
2008-06-02 11:50:08,718 [CCNet Server:INFO] Registered channel: tcp
2008-06-02 11:50:08,718 [CCNet Server:INFO] CruiseManager: Listening on url: tcp://10.10.15.26:21234/CruiseManager.rem
2008-06-02 11:50:08,718 [CCNet Server:INFO] Starting CruiseControl.NET Server
2008-06-02 11:50:08,718 [AllyCAD 4:INFO] Starting integrator for project: AllyCAD 4
2008-06-02 11:50:08,718 [Civil Designer 7:INFO] Starting integrator for project: Civil Designer 7
2008-06-02 11:50:08,718 [AllyCAD 4 Lint and Documentation:INFO] Starting integrator for project: AllyCAD 4 Lint and Documentation
2008-06-02 11:51:08,765 [AllyCAD 4:INFO] Project: 'AllyCAD 4' is added to queue: 'Continuous' in position 0.
2008-06-02 11:51:08,765 [Civil Designer 7:INFO] Project: 'Civil Designer 7' is added to queue: 'Continuous' in position 1.
2008-06-02 11:51:08,875 [AllyCAD 4:INFO] Project: 'AllyCAD 4' is first in queue: 'Continuous' and shall start integration.
2008-06-02 11:51:09,171 [AllyCAD 4:DEBUG] In FortressVaultSourceControl.GetModifications()
2008-06-02 11:51:09,171 [AllyCAD 4:DEBUG] In FortressVaultSourceControl.LoadState()
2008-06-02 11:51:09,437 [AllyCAD 4:DEBUG] Successfully loaded state.  Last integrated folder version was 12007.  Last successfully integrated folder version was 12007.
Immediately after that last DEBUG line is generated the service stops. sgvault.log just shows a login at that time and nothing else. The only entry in the event log for that time says that the CruiseControl.NET Service terminated unexpectedly.

ian_sg
Posts: 787
Joined: Wed May 04, 2005 10:55 am
Location: SourceGear
Contact:

Post by ian_sg » Mon Jun 02, 2008 8:11 am

What Windows user is the service running as? Try running it as the same user you logged in as when running it from the console. If that works, you know the account is the issue.
Ian Olsen
SourceGear

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Mon Jun 02, 2008 8:19 am

The service runs as Administrator, as does the console app.

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Tue Jun 03, 2008 7:03 am

There is yet another wrinkle using the new CruiseControl.NET plugin for Fortress.

Previously, all users who had made changes that were incorporated into the latest successfull integration build were notified.

Now, the only user who is notified is the one who is set to always notify (i.e. the buildmaster).

shannon

Post by shannon » Tue Jun 03, 2008 1:34 pm

Can you email a copy of your ccnet.config file to shannon at sourcegear dot com and I'll take a look at it?

Also, what os are you using?

shannon

Post by shannon » Tue Jun 03, 2008 3:00 pm

Try this to make running as service work:

check the permissions on this folder:
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

Make sure the windows user you're using has full control.

BigBrett
Posts: 218
Joined: Wed Feb 01, 2006 8:45 am

Post by BigBrett » Tue Jun 03, 2008 11:18 pm

We are running Windows Server 2003 R2 32 bit.

The folder you mentioned had Administrator (the windows user we are using) permissions, but none of the files in the folder had that. I updated permissions for the files, and that seems to have fixed the original problem with the Crypto "Keyset missing" message.

I will try later today to get the new plugin running as a service.

The config file has been emailed as requested.

shannon

Post by shannon » Wed Jun 04, 2008 9:25 am

The following issue with notifications has been logged as a bug and will be fixed shortly.

Previously, all users who had made changes that were incorporated into the latest successfull integration build were notified.

Now, the only user who is notified is the one who is set to always notify (i.e. the buildmaster).
There is a workaround: in the email section of your ccnet.config, replace user="userlogin" with user="User Name" for each user.

Post Reply