[sonar-dev] Automated build with TFS Custom Template

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] Automated build with TFS Custom Template

Jono

Hi all! I am new to Sonar Qube, but loving the analytics we can get out of it.

 

I am having issues with running the sonar-runner as part of an automated TFS build. It starts, but then it fails due to an IOException. Nothing is written to the Sonar Qube log.

 

The telling line is the 4th to last in the below exception detail. Everything is running as NETWORK SERVICE, and in fact the .sonar and its cache folders are all being created just fine. Also the .tmp files created have the correct permissions, so should be movable/deleteable.

 

Any help greatly appreciated J

 

Cheers!

 

Jono

 

Error reported in the Sonar Process: 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)

at java.security.AccessController.doPrivileged(Native Method)

at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)

at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)

at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)

at org.sonar.runner.api.Runner.execute(Runner.java:100)

at org.sonar.runner.Main.executeTask(Main.java:70)

at org.sonar.runner.Main.execute(Main.java:59)

at org.sonar.runner.Main.main(Main.java:53)

Caused by: java.lang.IllegalStateException: Fail to move C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\_tmp\fileCache8582988126579606506.tmp to C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\d46bee27cf0e82928a8e31fa07eca5a6\sonar-scm-git-plugin-5.0.jar

at org.sonar.home.cache.FileCache.renameQuietly(FileCache.java:116)

at org.sonar.home.cache.FileCache.get(FileCache.java:94)

at org.sonar.batch.bootstrap.DefaultPluginsReferential.pluginFile(DefaultPluginsReferential.java:58)

at org.sonar.batch.bootstrap.BatchPluginRepository.doStart(BatchPluginRepository.java:89)

at org.sonar.batch.bootstrap.BatchPluginRepository.start(BatchPluginRepository.java:72)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)

at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)

at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)

at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)

at org.picocontainer.behaviors.Stored.start(Stored.java:110)

at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)

at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)

at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)

at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)

... 9 more

Caused by: java.io.IOException: Failed to delete original file 'C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\_tmp\fileCache8582988126579606506.tmp' after copy to 'C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\d46bee27cf0e82928a8e31fa07eca5a6\sonar-scm-git-plugin-5.0.jar'

at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2835)

at org.sonar.home.cache.FileCache.renameQuietly(FileCache.java:114)

... 35 more

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Automated build with TFS Custom Template

Simon Brandhof
Hi Jono,

I didn't check, but the cache algorithm seems to assume that operations are atomic. I created the JIRA ticket to fix this limitation : https://jira.codehaus.org/browse/SONARUNNER-128.

Regards 


Simon BRANDHOF | SonarSource
http://twitter.com/SimonBrandhof

On 29 January 2015 at 16:34, <[hidden email]> wrote:

Hi all! I am new to Sonar Qube, but loving the analytics we can get out of it.

 

I am having issues with running the sonar-runner as part of an automated TFS build. It starts, but then it fails due to an IOException. Nothing is written to the Sonar Qube log.

 

The telling line is the 4th to last in the below exception detail. Everything is running as NETWORK SERVICE, and in fact the .sonar and its cache folders are all being created just fine. Also the .tmp files created have the correct permissions, so should be movable/deleteable.

 

Any help greatly appreciated J

 

Cheers!

 

Jono

 

Error reported in the Sonar Process: 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)

at java.security.AccessController.doPrivileged(Native Method)

at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)

at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)

at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)

at org.sonar.runner.api.Runner.execute(Runner.java:100)

at org.sonar.runner.Main.executeTask(Main.java:70)

at org.sonar.runner.Main.execute(Main.java:59)

at org.sonar.runner.Main.main(Main.java:53)

Caused by: java.lang.IllegalStateException: Fail to move C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\_tmp\fileCache8582988126579606506.tmp to C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\d46bee27cf0e82928a8e31fa07eca5a6\sonar-scm-git-plugin-5.0.jar

at org.sonar.home.cache.FileCache.renameQuietly(FileCache.java:116)

at org.sonar.home.cache.FileCache.get(FileCache.java:94)

at org.sonar.batch.bootstrap.DefaultPluginsReferential.pluginFile(DefaultPluginsReferential.java:58)

at org.sonar.batch.bootstrap.BatchPluginRepository.doStart(BatchPluginRepository.java:89)

at org.sonar.batch.bootstrap.BatchPluginRepository.start(BatchPluginRepository.java:72)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)

at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)

at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)

at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)

at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)

at org.picocontainer.behaviors.Stored.start(Stored.java:110)

at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)

at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)

at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)

at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)

... 9 more

Caused by: java.io.IOException: Failed to delete original file 'C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\_tmp\fileCache8582988126579606506.tmp' after copy to 'C:\Windows\ServiceProfiles\NetworkService\.sonar\cache\d46bee27cf0e82928a8e31fa07eca5a6\sonar-scm-git-plugin-5.0.jar'

at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2835)

at org.sonar.home.cache.FileCache.renameQuietly(FileCache.java:114)

... 35 more