CruiseControl.net Project Fails with no errors, how to identify error? - cruisecontrol.net

Had cruise control.net (v1.8.5.0) up and running for about 6 months on 4 projects, no issues.
In the past week or so, one project reports a failure... even though it compiles correctly and no unit test errors are reported as they were previously on failures. None of similiar reports on SO or elsewhere describe or correct this problem.
Here is dashboard status:
BluePrint Failure Breakers : support2 Failing Tasks : NUnitTask
In the build report log where it would normally show which tests failed, it shows no failures just the unit startup message:
ProcessModel: Default DomainUsage: Single Execution
Runtime: net-3.5
Normally here for an nunit error the erroring test #s and names that failed and the nunit assert failure message. In a passing situation it would display xml for each test.
Can someone point me somewhere else what might be causing this or where else I might look to find out why?
When I run nunit manually on the same tests the cruise control service has checked out the build server, everything works fine.
I've tried restarting both the cruise control service and IIS, same result.
When I look in the ccnet.log file on the server, it doesn't report anything more specific than whats already in the build log above:
Done Building Project
"C:\Users\j\Documents\CIWork\BluePrint\BluePrint.sln" (Build
target(s)).
Build succeeded.
0 Error(s)
Time Elapsed 00:00:13.99
2017-01-20 18:50:36,869 [BluePrint:DEBUG] Running unit tests:
C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe
/xml=C:\Users\j\Documents\CIWork\BluePrint\logs\LatestTests.BluePrint.xml
/nologo
C:\Users\j\Documents\CIWork\BluePrint\Tests\bin\x64\Release\TestBluePrint.exe
2017-01-20 18:50:36,869 [BluePrint:DEBUG] Starting process [C:\Program
Files (x86)\NUnit 2.6.3\bin\nunit-console.exe] in working directory
[C:\Program Files
(x86)\CruiseControl.NET\server\BluePrint\WorkingDirectory] with
arguments
[/xml=C:\Users\j\Documents\CIWork\BluePrint\logs\LatestTests.BluePrint.xml
/nologo
C:\Users\j\Documents\CIWork\BluePrint\Tests\bin\x64\Release\TestBluePrint.exe]
2017-01-20 18:50:36,953 [BluePrint:DEBUG] Not setting PriorityClass on
[C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe] to default
Normal 2017-01-20 18:50:37,686 [20:DEBUG] [BluePrint C:\Program Files
(x86)\NUnit 2.6.3\bin\nunit-console.exe] ProcessModel: Default
DomainUsage: Single 2017-01-20 18:50:37,686 [20:DEBUG] [BluePrint
C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe] Execution
Runtime: net-3.5
My configuration has not changed in 6months, here's the relevant task from ccnet.config:
<nunit>
<path>C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe</path>
<outputfile>C:\Users\j\Documents\CIWork\BluePrint\logs\LatestTests.BluePrint.xml</outputfile>
<assemblies>
<assembly>C:\Users\j\Documents\CIWork\BluePrint\Tests\bin\x64\Release\TestBluePrint.exe</assembly>
</assemblies>
</nunit>

As I was posting this I recalled that one of these tests downloaded a fair amount of data from internet and cached it. Running it from the console worked, but running it from system account as service must've been slower to exceeded default cruisecontrol timeout.
Weird that no timeout error was in the log. However copying the cached files from the admin account to systemprofile account fixed it. Will also see if the nunit test can be modified to automatically time itself out.

Related

GenerateEFSQLScripts fails when trying to publish to IIS using Web Deploy from TeamCity

Running into a total dead-end here.
I've created a Publish Profile for a .net6 application that we want to publish to IIS with Web Deploy. In the Entity Framework Migration section, the option to "Apply this migration on publish" is selected.
When manually clicking publish, everything works. However, we want to automate this in TeamCity using the .NET build runner. The publish step fails at:
Generating Entity Framework SQL Scripts...
Executing command: dotnet ef migrations script --no-build --idempotent --configuration Release --output "C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api\obj\Release\net6.0\PubTmp\EFSQLScripts\MySolution.Data.MyContext.sql" --context MySolution.Data.MyContext
C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk.Publish\targets\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(221,5): error : Entity Framework SQL Script generation failed
Internal error message details: BuildMessage1 0 Text DefaultMessage ERROR 400682522803500 tags:'tc:parseServiceMessagesInside'
Error message is logged
Build FAILED.
I cannot find any specific error messages anywhere in any log. Looking in the Microsoft.NET.Sdk.Publish.TransformFiles.targets file shows that it's failing on GenerateEFSQLScripts - an MSBuild command that executes dotnet ef under the covers.
I thought this might be a case of dotnet ef not being installed on the build agent. But when I manually run the command myself from C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api, it succeeds, and the SQL scripts are successfully created.
I also thought it might just be a case of the command being run in the wrong directory (i.e. in the root MySolution folder rather than the MySolution.Api folder), but explicitly setting the working directly fails at the same point, with the same error.
Has anyone seen this before? Or could point me to where an actual error might be located?

Unable to publish node.js app from VS2015 using VS publish

I’ve got a node.js project which I’m using to publish to Azure. This worked fine the first couple of times I’ve published, but now when I try and publish it just fails with no error message. The output in the Azure Service Activity window in VS2015 is simply:
Auto ConnectionString Transformed Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
And the output from the ouput/build window is:
------ Publish started: Project: node, Configuration: Release Any CPU ------
Auto ConnectionString Transformed Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I don’t really know where to start diagnosing this as there is no error message per se.
Things I’ve tried thus far:
Full Clean and/or rebuild
Deleted all folders from the BIN directory
Deleted all folders from the obj directory
Tried both debug and release configurations
Deleting the publish profile from VS and re-adding it from scratch
None of the above has made any difference
Has anyone seen this issue before or could suggest where to start diagnosing the cause?
Thanks
Do you happen to have GhostDoc installed?
Uninstalling it fixed it for me after seeing this issue.
I had the same issue, and it was due to file paths getting long more than the allowed number of characters. use this module to make your file paths shorter, and it will fix this issue
https://www.npmjs.com/package/flatten-packages

TeamCity ".Net Process Runner" hangs

We have started migrating our one of several projects to team city as part of CI. Below is how we have setup teamcity build. We are trying to deploy WebSite.
1) Build Step 1 (Package installation)
Using "command line " runner type install required package.
2) Build Step 2 (Build)
Using Runner type "Visual Studio (sln)" (Visual Studio 2010) build website.
3) Build Step 3 (Deploy Web Site)
Using ".Net Process Runner", deployer.exe (x86 built with .Net Framework 4) deploy site.
Deployer.exe reads config file. Config file contains "BuildId", "Environment" and "Servers" where we want build to be pushed.
<buildType id="bt52">
<env name="Debug">
<server path="SERVER1" />
</env>
<env name="QA">
<server path="SERVER2" />
<server path="SERVER3" />
</env>
<env name="UAT">
<server path="SERVER4" />
<server path="SERVER5" />
</env>
</buildType>
Deployer.exe is called with required parameters as below. Which reads config and deploys site to Server2 and Server3.
Deployer.exe "bt52" "QA" "siteQA" "E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" msdeploy.exe
Problem area is step #3.
When we run deployer.exe using .Net process runner as part of team city we see its hanging and not responsind sometime even for 45 minutes. When we try to execute same deployer.exe from build server using command line script executes within couple of seconds.
E:\TeamCity_custom_applications\deployer>Deployer.exe farm1-1 QA siteQA E:\BuildAgent\work\2483052e33e5e1e8\src\diy\ msdeploy.exe
Info
: Processing batch run ... Info : Processing command ...msdeploy.exe
-verb:sync -source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER2",userName="*****",password="******",authType="Basic"-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0 Info :
Processing command ...msdeploy.exe -verb:sync
-source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER3",userName="******",password="******",authType="Basic"
-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters ch anged, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0
Info: Deploy Script Complete.
One more thing we observed is running deployer.exe through teamcity I see that site content gets copied but only for 1 server and teamcity build status stays in "Running" mode. I am wondering if someone can please put little bit of insight on how can I look into this issue.
Update 1:
Thanks for your time looking into it !! What we ended up doing is, Instead of running command "msdeploy.exe" from "cmd.exe" we added "msdeploy.exe" location as Environment variable and executed "msdeploy.exe" in loop for # of servers. This has resolved issue of hanging. Now I am just curious to know why would it behave in such manner where if you execute "msdeploy.exe" from "cmd.exe" it would hang while running directly "msdeploy.exe" it would execute successfully. Any insight into same would be greatly appreciated.
Update 2:
I have added image which explains behavior using process explorer. If we kill msdeploy.exe from process explorer than for next all deployments to that server will not have the issue of build hanging. Please see below image
To be honest, it sounds like you're running into issues with redirecting input/output streams. TeamCity is running your application in a totally headless environment and then you, in turn, are attempting to redirect and parse the output of msdeploy.exe
If that's the case, I'd recommend looking into using the MSDeploy API instead of msdeploy.exe. The latter is just a command line wrapper for the former, so all the functionality is available to you. There's a sample deployment application available on the IIS blog if you need help getting started.
It seems you have NUnit build step configured in TeamCity and invoke cmd.exe from your test. This looks like an issue with the test code then. Most probably it will reproduce without TeamCity if you run the test in question with NUnit directly.
As Richard noted, most probably the issue root cause is related to stdin/stdout processing.
If you want to fix it in your code, you can try to experiment by explicitly closing stdin or the other way around, try writing something into it, etc.
Work around we did is, we observed msdeploy doesn't take more than 3-5 seconds to execute and deploy (Even for our biggest project which is almost 300mb website). So we set timeout of 20 seconds. So far since last 1 weeks we have not seen any issue with it and hopefully it will not cause more trouble but still we are not sure why such behavior.

Can't get azure web role to run locally using the emulator

I have a web role that I'm trying to run locally using the emulator. I have it working on another computer, but I cannot get it working on a different one, and have gone as far as to reformat it and start from scratch.
When I launch the site from Visual Studio, Chrome shows the following message:
This webpage is not available
The connection to 127.0.0.1 was interrupted.
There is also an error code listed at the bottom:
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.
One interesting thing from the build output are these lines:
Starting process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' with arguments '"C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web"'...
Process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' exited with exit code 0.
If I run C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web" from the command line, I get the following message:
The system cannot find the file specified.
Unable to start IIS Express in background.
I have no idea what file it cannot find, but I've verified that the config file I'm passing does in fact exist. Anyone have a clue what's going on here??
While I can not tell you what could be the actual root cause of your problem I can suggest a few ways to troubleshoot it:
Try changing IIS Express to Full IIS and see if it changes the behavior. You can do it by going to your Windows Azure Application project properties and look at "Web" option.
Try running application without debugging it
Launch CSrun at command prompt with /launchDebugger parameter of the /run option to verify that debugger does run without any issue
Try using IE as default browser
Clean your dftemp folder completely for any residual configuration and then launch Azure Emulator separately to verify there are no issues
Procmon "http://technet.microsoft.com/en-us/sysinternals/bb896645" may help you find the file that is missing...
Hopefully someone stumbles upon this answer with similar symptoms. When removing in role caching the <dataCacheClients> section was removed from . Somehow there was a left over <dataCacheClients> section left in the web.config. Everything and compiled and deployed to the emulator successfully. However, the role would fail to start since applicationHost.config was missing.
The fix was simply remove the unnecessary <dataCacheClients> section from the web.config file.

CruiseControl.net and cronTrigger

So, I'm having this odd issue with my CruiseControl.net project. I have a ccnet.config file that goes and pulls from my bitbucket repo, runs a basic build, then runs some unit tests, and then finally copies the tested files out to the webroot. Seems pretty basic, even for being my first time using CC.Net.
I, of course, would like this to run when I do commits. Failing writing some sort of web page that bitbucket can invoke through it's services framework, I settled for having CC run a scheduled build, and only run the full build if there's source control changes.
After some googling, I found out that in 1.6, it has a cronTrigger. Excactly what I need. So, I add the following chunk to my config:
<cronTrigger>
<cronExpression>*/5 * * * *</cronExpression>
</cronTrigger>
Then it triggers fine, but then I get a loop of this in the console:
[HMS:INFO] Calling hg log -r tip --template {rev} --noninteractive
[HMS:DEBUG] Starting process [C:\Program Files (x86)\TortoiseHg\hg.exe] in working directory [C:\build\hms\src] with arguments [log -r tip --template {rev} --noninteractive]
[HMS:DEBUG] Not setting PriorityClass on [C:\Program Files (x86)\TortoiseHg\hg.exe] to default Normal
[8:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] standard-error stream closed -- null received in event
[7:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] 60
[7:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] standard-output streamclosed -- null received in event
[3:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] process exited event received
[HMS:INFO] No modifications detected.
This loop continues until I go in and remove the cronTrigger block. I don't really want this thing busy-waiting on my server for a change, and I'm sure BitBucket doesn't smile upon several requests per second.
So, in short, how do I stop this thing from molesting bitbucket? Stop using CC.Net? Resign myself to hitting the "Build" button?
Also: my ccnet.config file for reference: http://pastebin.com/6jSPxVTk
I said screw it, I moved to Hudson instead. A bit heavier on my server, but it supports a URL to post to, so I can drop that into BitBucket's "Services" option, so no polling.
I also get a free Jabber bot, and Chuck Norris.

Resources