We have a TFS 2010 build server. After running a Queue Build upon a build definition of a VS sln or msbuild file, randomly (around 30%) the build process won't run. The build log window showed only 3 tabs: Activity Log, Next Error, and Next Warning. After a few minutes, say 10 minutes, I had to press the Stop Build. The build server is not busy at all.
Have you seen/heard similar things? Could you help?
Cheers
Could you give it a try to let him run until the timeout is reached. From your comments it looks like he is doing the Get Workspace when you stop the build. Please check the workspace that is defined for your build definition. I had one a project team that created there own build and wondered why it takes so long to build, unfortunately the included the whole TeamProject (about 6GB), which were getted every time the build was queued.
While it randomly works, does it depend on the build agent that is used or do you just have one build agent?
Related
SUMMARIZE THE PROBLEM:
I'm using Visual Studio 2015 for some project and what I'm trying to do is to run a batch file which is going to open an app(whatever app). The problem is that the VS2015 is going to get stuck in the build process until my app is going to be close.
The batch is working perfectly fine. You could try this just with a batch something like:
start notepad.exe
Or whatever you want, it doesn't really matter what's the application you are going to open here.
WHAT I'VE TRIED:
I've tried already some alternatives like...
Run the bat from the post-build event with "call", "start" or with none of them.
I've added "exit 0" on the end of the file(batch)
Also, I've tried to create 2 batch files. One was the original one and the second one was calling the first one. So I've added the second one at the post-build event. Nothing changes, of course.
WHAT I AM TRYING TO OBTAIN:
On the end, all that I'm trying to obtain is just a batch with is going to open an application after the build/rebuild of the project is done without getting stuck somewhere there.
It's going to stay in this "Build" process even though the build is "Build Succeed"
Unfortunately I believe all processes spun off by the build have to be joined and returned successfully for VS to consider the build a success. Instead, is it possible in your use-case to attach the batch file to the execution step of your project? In the project settings you can modify the command line arguments to spin off your batch file before executing your project executable. Is there any issues with this approach?
I found this too, would this help: Visual Studio post build events stuck waiting for executable to finish before running app in debug mode
I've seen a bunch of other questions that are similar to this one regarding VS, but none in regards to the command line.
Using VS Command line (i.e. BuildConsole "SOLUTIONNAME" /BUILD /cfg="CONFIG_SETTINGS" /prf="PROJECTNAME"), I get the highly reproducable (although not 100%) error shown in the question: "The process cannot access the file because it is being used by another process". However, I only get this error the first 1-5 times I run BuildConsole. It seems to be a timing-related thing. If I run BuildConsole once, then wait a while, then run again, it will work. If I run it 5 times consecutively, it will fail all 5 times or sometimes work on the 5th, depending on how fast the previous runs failed. Also, I can get it to work 100% of the time by opening the solution in VS IDE and then closing the IDE and re-running.
This build command is part of a tool that will report failure if the command fails (which it does, most of the time, although it shouldn't fail). So my question is this: how can I get the BuildConsole command to work the 1st time, 100% of the time? Obviously I don't expect it to work if the solution/project is actually being used by another process, but it should be able to take control from whatever is hanging onto the files.
I had the same problem on windows 7, have moved Visual Studio folder from Documents folder to the root of C:\, changed the location in Tools/Options/Help/Import and Export settings to point to the new location, same with Projects and Solutions all pointing to the new location.
No problems with building at all, unless there is an error with the code.
The problem was not running in administrator mode. When I set my C# program that is running BuildConsole to force admin rights, BuildConsole works every time.
Sometimes, builds done by Jenkins (1.461) will stop at a random spot somewhere in the middle. These builds are manually scripted calls to Visual Studio 2008 SP1's devenv.com for primarily C++ code. Visual Studio emits no error messages; the last message in devenv's log is some random file being built. The Jenkins build fails because of a post-build Windows batch command that relies on some of the build outputs. This happens fairly rarely (roughly 1 in 15 builds). Jenkins's error log shows nothing out of the ordinary around the time the build fails. Surprisingly, it says the build succeeded, even though it shows it as failed everywhere else.
The problem is isolated to Jenkins. The same build script run at a developer's desk has never failed in this way.
The Jenkins nodes are 32-bit Windows XP machines. They all have ample available disk space. Jenkins is configured to only run one job at a time per node. The event logs show no obviously bad things (e.g., Visual Studio crashes) happening at the times when the builds stop.
Does anyone have any ideas of things to look into to troubleshoot this?
I don't recall ever having this problem with jenkins myself, but I have regular linker crashes in MSVC 2008. This happens almost everyday for me. If it is the linker crashing then that could be an explanation.(perhaps a linker crash is not logged?)
Edit:
We use MSVC2008 SP1 on 32-bit Win7.
We use MSBuild 3.5 when building the c++ solutions.
We ended up correlating the random build failures with logoff events on the Jenkins nodes. This lead to this JVM bug/feature (Oracle Java bug ID 6871190), where a logoff event in Windows causes the signal handlers to terminate the JVM. You can disable this behavior (perhaps with other downsides) by passing the -Xrs option to the JVM, but that option will not automatically propagate to child Java processes.
We are passing -Xrs to kick off Jenkins itself, and the Jenkins service itself lives through a logoff. The current hypothesis is that some part of Jenkins's build process is kicked off through another Java child process who is not invoked with -Xrs.
As part of my war on long build times (our C++ solution takes about an hour to build using Incredibuild!) I'm trying to find the build time hotspots.
I've enabled Build Times logging (Tools -> Options -> Projects and Solutions -> VC++ Project Settings -> Build Timing) on my machine and that does what I want (I've then written a script to pull those out for each project and dump them somewhere more useful).
The trouble is I can't make out CI builds do the same thing.
We're using CruiseControl.Net (although I'm in the process of trying to persuade the team to move to TeamCity). The overnight build does not use Incredibuild, so this is ideal for my logging purposes.
CC.Net runs as a service using a dedicated system account.
I've logged into the server and launched Visual Studio using the system account and applied the "Build Timing" setting.
But the builds don't show the Build Time.
so:
(a) Is there anything special about running VS from a service that may have an impact?
(b) Is there anything special about running it from CC.Net (we're using the DevEnv task to build the whole solution - default install location - matches the one I set the option in)?
(c) Is there any other way I can coerce it into logging the build times (other than using MSBuild, which would be a big job right now)?
This might not give the amount of detail you need, but you could add the statistics plugin to the dashboard. It contains a graph of project build duration.
VS2005 stucks on "Build Started ..." %first project name here% step for 5-10 mins. Only happens when I change a build configuration. Only happens to one solution.
Deleting a %first project% in a solution didn't help - i would just stuck on any first compilable project.
I have disabled the intellisense, installed every possible hotfix and still no luck.
Any ideas how to track down the cause of that initial delay please.
Thank you.
It could be a very good idea to take a minidump and/or check what visual studio is doing by using Process monitor -> threads -> stack/ This is most likely to provide the exact and fast answer.