title: Sonar Qube - Unexpected exit code received from batch file : 1
body: <p>I am using VS2013. My code is in git. I have push that code in TFS server 2015 and ran the build.Build failed with <code>Unexpected exit code received from batch file : 1</code> with some issues. Please help.</p>
  
  <pre><code>&gt; Error                                                     
    -09T12:55:49.7287222Z INFO: Load quality profiles (done) | time=141ms
  
  2017-06-09T12:55:49.7287222Z INFO: Load active rules
  
  2017-06-09T12:55:50.3849589Z INFO: ------------------------------------------------------------------------
  
  2017-06-09T12:55:50.3849589Z INFO: EXECUTION FAILURE
  
  2017-06-09T12:55:50.3849589Z INFO: ------------------------------------------------------------------------
  
  2017-06-09T12:55:50.3849589Z INFO: Total time: 6.016s
  
  2017-06-09T12:55:50.3849589Z INFO: Final Memory: 42M/101M
  
  2017-06-09T12:55:50.3849589Z INFO: ------------------------------------------------------------------------
  
  2017-06-09T12:55:50.3849589Z ##[error]ERROR: Error during SonarQube Scanner execution
  
  2017-06-09T12:55:50.3849589Z ##[error]java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.report.ActiveRulesPublisher
  
  2017-06-09T12:55:50.3849589Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
  
  2017-06-09T12:55:50.3849589Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
  
  2017-06-09T12:55:50.3849589Z ##[error]at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
  
  2017-06-09T12:55:50.4005855Z ##[error]at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
  
  2017-06-09T12:55:50.4162159Z ##[error]at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
  
  2017-06-09T12:55:50.4318395Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  
  2017-06-09T12:55:50.4318395Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  
  2017-06-09T12:55:50.4318395Z ##[error]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  
  2017-06-09T12:55:50.4318395Z ##[error]at java.lang.reflect.Method.invoke(Method.java:498)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
  
  2017-06-09T12:55:50.4318395Z ##[error]at com.sun.proxy.$Proxy0.execute(Unknown Source)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonarsource.scanner.cli.Main.main(Main.java:61)
  
  2017-06-09T12:55:50.4318395Z ##[error]Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.api.batch.rule.ActiveRules
  
  2017-06-09T12:55:50.4318395Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
  
  2017-06-09T12:55:50.4474834Z ##[error]at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:67)
  
  2017-06-09T12:55:50.4630855Z ##[error]... 37 more
  
  2017-06-09T12:55:50.4630855Z ##[error]Caused by: java.lang.NullPointerException
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.scanner.rule.DefaultActiveRulesLoader.readPage(DefaultActiveRulesLoader.java:99)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:59)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:102)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:63)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.sonar.scanner.rule.ActiveRulesProvider.provide(ActiveRulesProvider.java:49)
  
  2017-06-09T12:55:50.4630855Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  
  2017-06-09T12:55:50.4630855Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  
  2017-06-09T12:55:50.4630855Z ##[error]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  
  2017-06-09T12:55:50.4630855Z ##[error]at java.lang.reflect.Method.invoke(Method.java:498)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
  
  2017-06-09T12:55:50.4630855Z ##[error]at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
  
  2017-06-09T12:55:50.4787165Z ##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:67)
  
  2017-06-09T12:55:50.4787165Z ##[error]... 51 more
  
  2017-06-09T12:55:50.4787165Z ##[error]ERROR:
  
  2017-06-09T12:55:50.4787165Z ##[error]ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
  
  2017-06-09T12:55:50.6037153Z ##[error]The SonarQube Scanner did not complete successfully
  
  2017-06-09T12:55:50.6037153Z 18:25:50.463  Creating a summary markdown file...
  
  2017-06-09T12:55:50.6037153Z ##[error]Post-processing failed. Exit code: 1
  
  2017-06-09T12:55:50.6193618Z ##[error]Unexpected exit code received from batch file: 1
  
  2017-06-09T12:55:50.6505888Z The build was not set to fail if the associated quality gate fails.         
  </code></pre>
  
  <hr>
  
  <hr>
  
  <ul>
  <li>Now it is giving following error- *                                                                                                                C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets (513, 5)
  The "SqlBuildTask" task failed unexpectedly.
  System.MethodAccessException: Attempt by method 'Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(System.String, System.Collections.Generic.Dictionary<code>2&lt;System.String,System.String&gt;)' to access method 'Microsoft.Data.Tools.Components.Diagnostics.SqlTracer.ShouldTrace(System.Diagnostics.TraceEventType)' failed.
  at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(String filePath, Dictionary</code>2 referenceMetadata)
  at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.CreateCustomSchemaData(String filePath, Dictionary<code>2 referenceMetadata)
  at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors)
  at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger)
  at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger)
  at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep()
  at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func</code>1 step)
  at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute()
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()
  Process 'msbuild.exe' exited with code '1'.                                                                                                           </li>
  </ul>