View Full Version : Automated build problem
07-06-2004, 11:05 AM
I am trying to set up an automated build of my software. I created a .bat file which is run by Task Scheduler. The .bat file creates a build directory, gets the VBP build file from SourceSafe into the build directory, and invokes VisBuildCmd.exe on the VBP build file.
Frequently the build fails and VisBuildCmd.exe gives a 'class not registered' error. If I run the .bat file manually the next morning, the build succeeds.
Any ideas what is going wrong?
07-06-2004, 11:53 AM
Not really. It sounds like some of the VBP COM registry entries are getting corrupted, but that wouldn't explain why it would work later unless you are re-registering VBP components or re-installing VBP in between. Does the user the scheduld task is running under have the same rights as the user you use to successfully build manually? Are you using the latest version of VBP? Can you send a complete log of the error information (may shed more light on exactly what it's trying to do when it fails)? Thanks.
07-07-2004, 08:50 AM
Below is the output from the batch file. I don't know what other logging information I can provide since the VBP builder component isn't even instantiated so the VBP log isn't even created yet.
C:\Documents and settings\wta>rem @echo off
C:\Documents and settings\wta>call ssenv.bat
C:\Documents and settings\wta>path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\ Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;c:\documents and settings\wta;c:\documents and settings\wta\My Documents\utils;C:\Program Files\Microsoft Visual Studio\VSS\win32
C:\Documents and settings\wta>SET SSDir=g:\xxx VSS
C:\Documents and settings\wta>SET BUILDDIR=O:\BuildDir
C:\Documents and settings\wta>rmdir /S /Q "O:\BuildDir"
C:\Documents and settings\wta>mkdir "O:\BuildDir"
C:\Documents and settings\wta>ss get -I- "$/xxx/Build" "-GLO:\BuildDir"
C:\Documents and settings\wta>"C:\Program Files\VisBuildPro\VisBuildCmd.exe" /b "O:\BuildDir\Build\xxx.bld"
VisBuildCmd, Version 22.214.171.124
Copyright (C) 1999-2003 Kinook Software, Inc. All rights reserved.
Error creating builder component: Class not registered
C:\Documents and settings\wta>xcopy /Y /S /I "O:\BuildDir\Installers" "O:\BuildDir\.."
0 File(s) copied
07-07-2004, 09:23 AM
Something is apparently removing the COM registry info for the builder component (not sure what). Try reinstalling VBP. You can also use the attached file and the following statement before the VisBuildCmd line in your batch file to ensure it is registered properly:
regedit /s C:\VisBuildBld.reg
07-07-2004, 09:30 AM
I just had a thought. I wonder if there is a backup job running at night on our build machine which locks the registry while its running. I'll have to investigate that theory with the admin.
Also, I should probably mention the build machine is a Windows 2000 Terminal Services server. I don't know if that makes a difference.
07-07-2004, 10:21 PM
What if another build were running as a different user (also invoked by task scheduler) at the same time on the same machine? Would that cause this error?
07-08-2004, 06:31 AM
The VBP components themselves only read the registration information, and I'm quite certain that Windows supports multiple simultaneous readers of the same registry values. The only thing in VBP that would remove the reg info is the uninstaller.
Your backup theory is a possibility: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=udu%23tYKfAHA.1260%40tkmsftngp04&rnum=4&prev=/groups%3Fq%3D%2522class%2520not%2520registered%252 2%2520backup%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DN%26tab%3Dwg
07-08-2004, 07:56 PM
I don't think its the backup program. I seem to be able to run my batch file from the command prompt anytime. It's only if it runs from the task scheduler that it fails.
Update: It is definitely an issue where another build is running as a different user at the same time as my build; both started by task manager. His build is hanging in a script step which keeps VisBuildCmd.exe running forever. When my build tries to run it fails with the 'class not registered' error.
However, as it has always done, it still runs if I run my batch file explicitly from the command line; even if his build is hung. Maybe because the cmd.exe is the parent proces s instead of mstask.exe?
Interestingly, if I run his build as me and then run my build, it works.
07-26-2004, 11:15 AM
Any thoughts on this? We are still having this problem.
07-27-2004, 07:15 AM
It sounds like an obscure bug in Windows Scheduled Tasks. Some things to try:
1) Configure both tasks to run under the same user account.
2) Use AT instead of Scheduled Tasks (discussed in the 'scheduled builds' help topic)
3) Use an alternate task scheduling application (http://www.google.com/search?hl=en&ie=UTF-8&q=task+scheduler+software).
4) Upgrade to the latest server software (Windows Server 2003) with all patches and hotfixes.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.