I'm trying to setup a fairly simple CruiseControl.NET build server and I'm seeing strange behavior with a project using MSBuild. Everytime the project's build is run and it executes msbuild (either through forcing or through a change in source control), the build completes successfully but CCNet also restarts. I notice this because the 'Next Build Time' of all the projects are moved ahead to the current time + initialSeconds.
This behavior appears whether I'm running CCNet as a serivce or through the command line executable.
When running on the command line, the debug output doesn't give me anything useful - it just immediately jumps from the last line of the project's build to the 'startup' output.
Additional information:
TFS is the source control server
My build is only hitting the working directory
My publish is just copying from the working directory to the artifact directory
If I comment out the msbuild task, running the project build does not restart CruiseControl
Not hitting or updating the Server or State directories of CruiseControl during build
Nothing useful in Event Viewer when this happens and I'm running as a service. CCService doesn't report stopping/starting - it's like cruise control is internally restarting.
And here is the msbuild configuration:
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>$[$CCNetWorkingDirectory]\$(PathToSolution)</workingDirectory>
<projectFile>$(SolutionFile)</projectFile>
<buildArgs>/p:Configuration=Release /v:d</buildArgs>
<timeout>900</timeout>
</msbuild>
</tasks>
Finally, here is the trace log at the end of the msbuild process / restart of server.
Done building target "Build" in project "MYAPP.sln".
Done Building Project "C:\CCNet\WD\NET\Main\MYAPP\MYAPP.sln" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:05.35
2014-08-26 20:11:41,881 [NET.App.MYAPP] [INFO] - Delete merged file 'C:\CCNet\BuildArtifacts\NET.App.MYAPP\msbuild-results-dcf002da-d0d0-4d0a-8b86-fb25adaf1ac3.xml'.
2014-08-26 20:11:46,478 [NET.App.MYAPP] [INFO] - Integration complete: Success - 8/26/2014 8:11:41 PM
2014-08-26 20:11:46,579 [NET.App.MYAPP] [INFO] - Integrator for project: NET.App.MYAPP is now stopped.
2014-08-26 20:11:57,444 [257] [INFO] - CruiseControl.NET Server 1.8.5.0 -- .NET Continuous Integration Server
2014-08-26 20:11:57,465 [257] [INFO] - Copyright © 2003 - 2014 ThoughtWorks Inc. All Rights Reserved.
2014-08-26 20:11:57,466 [257] [INFO] - .NET Runtime Version: 2.0.50727.5477 Image Runtime Version: v2.0.50727
2014-08-26 20:11:57,467 [257] [INFO] - OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 Server locale: English (United States)
2014-08-26 20:11:57,467 [257] [INFO] - Reason: File change delay finished
2014-08-26 20:11:57,944 [CCNet Server] [INFO] - Reading configuration file "C:\CCNet\Server\ccnet.config"
2014-08-26 20:11:58,347 [CCNet Server] [WARN] - Configuration does not have any version information - assuming the configuration is for version 1.8
2014-08-26 20:11:58,800 [CCNet Server] [INFO] - Log cache time set to 5 minutes
2014-08-26 20:11:58,990 [CCNet Server] [INFO] - Registered channel: tcp
2014-08-26 20:11:58,991 [CCNet Server] [INFO] - CruiseManager: Listening on url: tcp://32.32.29.129:21234/CruiseManager.rem
2014-08-26 20:11:58,992 [CCNet Server] [INFO] - Registered channel: tcp
2014-08-26 20:11:58,993 [CCNet Server] [INFO] - CruiseServerClient: Listening on url: tcp://32.32.29.129:21234/CruiseServerClient.rem
2014-08-26 20:11:58,994 [CCNet Server] [INFO] - Starting CruiseControl.NET Server
It looks like ccnet is noticing a change to a .dll file within the application directory and restarting to assimilate the changes.
Ccnet is looking for changes to any .dll file so if your build outputs at least one to this directory it would cause a restart.
Related
I try to run Play project in IntelliJ IDEA. i follow this document.
this is my config. api is my sub project
But when I hit run icon, my service start successful and immediately AkkaHttpServer - Stopping server. then I type api/run in sbt shell, my service start successful and work normally. this issue only happen when I check User sbt shell in config
this is my log in sbt shell
"C:\Program Files\Java\jdk1.8.0_251\bin\java.exe" -server -Xmx1536M -Dsbt.supershell=false -Didea.managed=true -Dfile.encoding=UTF-8 -Dsbt.version=1.3.8 -Dsbt.log.noformat=true -jar C:\Users\LAP13556-local\AppData\Roaming\JetBrains\IntelliJIdea2020.1\plugins\Scala\launcher\sbt-launch.jar early(addPluginSbtFile=\"\"\"C:\Users\LAP13556-local\AppData\Local\Temp\idea979.sbt\"\"\") "; set ideaPort in Global := 51722 ; idea-shell"
[info] Loading global plugins from C:\Users\LAP13556-local\.sbt\1.0\plugins
[info] Loading settings for project crm-server-build from plugins.sbt,idea979.sbt ...
[info] Loading project definition from C:\Users\...\crm-server\project
[info] Loading settings for project crm-server from build.sbt ...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[info] Defining Global / ideaPort
[info] The new value will be used by Compile / compile, Test / compile and 3 others.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[IJ]sbt:crm-server> api/run
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
[info] p.c.s.AkkaHttpServer - Stopping server...
[success] Total time: 26 s, completed Jul 31, 2020 9:26:28 AM
[IJ]sbt:crm-server> api/run // I type this command
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
Can anyone tell me the reason. Thank you.
I'm new to Intellij IDEA for Play/Scala and apparently need to do something to start NettyServer when I Run a project. My run configuration ran once OK. Then I killed the server, made some changes and tried to run again:
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java -Dfile.encoding=UTF8 -Djline.terminal=none -Dsbt.log.noformat=true -Dsbt.global.base=/private/var/folders/97/16yb2phd7sz78q0sf5wl7z200000gn/T/sbt-global-pluginstub -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -classpath "/Users/j/Library/Application Support/IntelliJIdea2016.1/Scala/launcher/sbt-launch.jar" xsbt.boot.Boot run
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Loading project definition from /Users/jch/IdeaProjects/editor/project
[info] Set current project to ...
--- (Running the application, auto-reloading is enabled) ---
[error] p.c.s.NettyServer - Failed to listen for HTTP on /0.0.0.0:9000!
[error] (compile:run) play.runsupport.ServerStartException
[error] Total time: 3 s, completed Apr 4, 2016 11:24:31 AM
Process finished with exit code 1
What am I missing?
My Mistake. - Apparently NettyServer could not start because it was already running. When I browse to localhost:9000 it's up. A better error message would have helped, and IDEA apparently did not autoload into my browser because of the NettyServer exit code.
I am trying to follow the instructions here to try SonarQube for MSBuild:
http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner+for+MSBuild, but I got the following errors for C# and VB samples. I can't find any message in the sonar.log so don't know how to proceed.
C:\Tools\SonarQube\sonar-examples-master\projects\languages\csharp>where msbuild
C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
C:\Tools\SonarQube\sonar-examples-master\projects\languages\csharp>MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Loading analysis properties from C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 1.1
WARNING: Duplicate project GUID: "12add147-fbaf-46aa-b8a4-f708d4d0f295". Check that the project is only being built for a single platform/co
nfiguration and that that the project guid is unique. The project will not be analyzed by SonarQube. Project file: C:\Tools\SonarQube\sonar-
examples-master\projects\languages\csharp\ConsoleApplication1\ConsoleApplication1.csproj
C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet>MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Loading analysis properties from C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 1.1
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\huj\AppData\Local\Temp\.NETFr
amework,Version=v4.5.AssemblyAttributes.vb, project: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\ConsoleApplication1\C
onsoleApplication1.vbproj
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_60 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\bin\sonar-runner\bin\..\conf\s
onar-runner.properties
INFO: Project configuration file: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\.sonar
INFO: SonarQube Server 5.2
15:43:49.634 INFO - Load global repositories
15:43:49.815 INFO - Load global repositories (done) | time=180ms
15:43:49.830 INFO - User cache: C:\Users\huj\.sonar\cache
15:43:50.224 INFO - Load plugins index
15:43:50.227 INFO - Load plugins index (done) | time=3ms
15:43:50.458 INFO - Process project properties
15:43:50.728 INFO - Load project repositories
15:43:50.741 INFO - Load project repositories (done) | time=13ms
15:43:50.747 INFO - Apply project exclusions
15:43:50.871 INFO - Load quality profiles
15:43:50.919 INFO - Load quality profiles (done) | time=48ms
15:43:50.924 INFO - Load active rules
15:43:51.344 INFO - Load active rules (done) | time=420ms
15:43:51.362 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to def
ine SCM of your project.
15:43:51.362 INFO - Publish mode
15:43:51.363 INFO - ------------- Scan ConsoleApplication1
15:43:51.459 INFO - Load server rules
15:43:51.629 INFO - Load server rules (done) | time=170ms
15:43:51.684 INFO - Base dir: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\ConsoleApplication1
15:43:51.684 INFO - Working dir: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\.sonar\vbnet_vbnet_65E63A
B4-1055-4104-B233-A9F7CF2233DA
15:43:51.685 INFO - Source paths: Module1.vb, My Project/AssemblyInfo.vb, My Project/Resources.resx, My Project/Application.myapp, My Proje
ct/Settings.settings, App.config
15:43:51.685 INFO - Source encoding: UTF-8, default locale: en_US
15:43:51.686 INFO - Index files
15:43:51.709 INFO - 2 files indexed
15:43:51.711 INFO - Quality profile for vbnet: Sonar way
15:43:51.885 INFO - All FxCop rules are disabled, skipping its execution.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3.142s
Final Memory: 11M/308M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
Your C# project isn't being analysed because of the WARNING: Duplicate project GUID.... Check that your project guids are unique. You will also get this error if you run the begin step then call MSBuild multiple times for the same project before calling end. Try running begin, MSBuild .... end to see if that fixes the C# project issue. For the VB issue, please include more of the call stack from the Java error.
I have been using SonarQube for code analyzing at a basic level however now I would like to measure the code against FX-COP rules. Hence I am attempting to use MSBuild SonarQube scanner. I read the documentation thoroughly and have setup my project likewise however when I execute it gives me error.
Below is the extract from the log:
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
Checking for updates...
MSBuild SonarQube Runner Pre-processor 1.0.2.0
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Updating build integration targets...
Fetching analysis configuration settings...
Generating rulesets...
Pre-processing succeeded.
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 11/20/2015 1:46:41 PM.
Project "C:\Project1.sln" on node 1 (rebuild target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Build succeeded.
9 Warning(s)
0 Error(s)
Time Elapsed 00:01:07.86
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0 gives several warnings similar to one below:
WARNING: File is not under the project directory and cannot currently be analysed
by SonarQube.
File: C:\Users\...\AppData\Local\Temp\2\.NETFramework,Version=v4.0.AssemblyAttributes.cs,
project: C:\...\1c36691bf5270463\SOURCE\x\y.csproj**
Calling the sonar-runner:
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_51 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: C:\TeamCity\buildAgent\work\1c36691bf5270463\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\...\1c36691bf5270463\.sonarqube\out\.sonar
INFO: SonarQube Server 5.1.1
13:47:51.150 INFO - Load global repositories
13:47:51.743 INFO - Load global repositories (done) | time=593ms
13:47:51.758 INFO - Server id: 20151120125423
13:47:51.758 INFO - User cache: C:\...\cache
13:47:51.758 INFO - Install plugins
13:47:51.836 INFO - Install JDBC driver
.
.
.
13:47:55.518 INFO - ------------- Scan file1
13:47:55.534 INFO - Load module settings
13:47:55.658 INFO - Load rules
13:47:56.017 INFO - Base dir: C:\...\1c36691bf5270463\SOURCE\xxx
13:47:56.017 INFO - Working dir: C:\...\1c36691bf5270463\.sonarqube\out\.sonar\AC1_AC1_497EBFF2-C710-4843-8263-F534AF803D3E
13:47:56.017 INFO - Source encoding: UTF-8, default locale: en_US
13:47:56.532 INFO - Quality profile for cs: Sonar way
13:48:00.635 INFO - Sensor org.sonar.plugins.csharp.CSharpFxCopProvider$CSharpFxCopSensor#73c82ec1
INFO: -----------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: -----------------------------------------------------------------
Total time: 10.156s
Final Memory: 16M/306M
INFO: -----------------------------------------------------------------
13:48:00.791 Creating a summary markdown file...
Press any key to continue . . .
You need to run all your commands in a Developer Command Prompt for Visual Studio 2013 or higher and:
use at least MSBuild 12.0
have .NET 4.5.2+ installed
You have this error because the FxCop Results are not generated.
Do you see in the MSBuild's logs, execution of FxCop? This is visible inside the RunCodeAnalysis section of MSBuild's logs.
You need to run this from command line and use the "-X" flag on your command, this will give you verbose debugging, I would highly reccomend doing the following for troubleshooting.
sonar-runner.exe <arg> <arg> -X > sonar-runnerLog.txt
Then read or dump that log back here. either way you'll know a lot more about what the actual problem is.
You can get Visual Studio Express 2013 (or 15) for free and both of those come with their respective developer command prompts.
When executing JUnit test with tycho-surefire-plugin, tycho forks an equinox runtime.
In rare cases it may happen that some bundles in the OSGi test runtime cannot be resolved/started (e.g. package uses conflicts).
If you read the debug log (maven CLI option -X), you will find something like
!ENTRY org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
An error has occurred. See the log file
C:\mytestproject.tests\target\work\configuration\1349705136008.log.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:03.181s
[INFO] Finished at: Mon Oct 08 16:17:16 CEST 2012
[INFO] Final Memory: 20M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.15.0:test (default-test) on project mytestproject.tests: An unexpected error occured (return c
ode 13). See log for details. -> [Help 1]
The eclipse console log does not provide enough information in case of package uses conflicts.
How can I analyze the bundles in the OSGi test runtime forked by tycho?
start tests in remote debug mode (simply specify -DdebugPort=8000 on the CLI) and start the OSGi console on a local port, e.g. 1234:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<systemProperties>
<osgi.console>1234</osgi.console>
</systemProperties>
</configuration>
</plugin>
Set a breakpoint in one of your test classes or in org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter if tests are not even started. Then,
telnet localhost 1234
and you can use the usual OSGi console commands like ss, diag, bundle etc. to analyze the problem "in vivo".
Alternatively you can run with -consolelog or set the eclipse.consoleLog property to true property. If you're running with Tycho, you can use <argLine>-Declipse.consoleLog=true</argLine>.