Thank you for your response. I turned on my computer this morning and now reports are going up but I am getting an error on the server:
Error Details
java.lang.IllegalArgumentException: Multiple entries with same key: swift=Swift and swift=Swift at
com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) at
com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) at
com.google.common.collect.RegularImmutableMap.(RegularImmutableMap.java:70) at
com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) at
com.google.common.collect.Maps.uniqueIndex(Maps.java:1166) at
com.google.common.collect.Maps.uniqueIndex(Maps.java:1140) at
org.sonar.server.computation.task.projectanalysis.language.LanguageRepositoryImpl.(LanguageRepositoryImpl.java:46) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
java.lang.reflect.Constructor.newInstance(Constructor.java:423) at
org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145) at
org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342) at
org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) at
org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) at
org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) at
org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) at
org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) at
org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) at
org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) at
org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632) at
org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118) at
org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136) at
org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78) at
org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309) at
org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335) at
org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) at
org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) at
org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) at
org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) at
org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) at
org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) at
org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) at
org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678) at
org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281) at
org.sonar.server.computation.task.projectanalysis.step.AbstractComputationSteps.lambda$instances$0(AbstractComputationSteps.java:43) at
com.google.common.collect.Iterators$8.transform(Iterators.java:799) at
com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) at
org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:62) at
org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) at
org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73) at
org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134) at
org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97) at
org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81) at
org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73) at
org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43) at
java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at
java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at
java.lang.Thread.run(Thread.java:745)
I found it in the error log for my background task on the server. I am very new to this so I apologies if I am using the wrong terms. I do also see it in the ce.log file ce.txt (34.6 KB)
I think that my problems boils down to me having the homebrew version of sonar-scanner and sonar on my computer but I am trying to run my project from a local developer instance of the server. I tried to get the homebrew developer version of sonar but it isn’t working. I tried to put the swift plugin in the homebrew sonar extension but that was a failed long shot. Also, I ran the sonar-scanner command and the run-sonar-swift.sh script in my project.
I am making a couple assumptions in my theory.
I asked whether multiple projects were failing in an attempt to diagnose whether we’re looking at a project-level or instance-level issue.
Multiple entries with same key: swift=Swift and swift=Swift
Is very odd, and makes me wonder whether you’ve installed two plugins that declare the language.
So, could you clarify which Swift analyzer(s) you’re running?
I only have one project set up with sonar so it’s the only one failing, I have installed sonar and sonar-scanner from homebrew but I am actively using an instance of sonar developer and sonar scanner on my desktop. I am analyzing the project by the backlight swift script in my project.
When I run sonar from terminal, it complains about not having swift available.
Do you mean that you’re using the SonarQube Developer Edition ? If so then be aware that this Edition includes a built-in Swift analyzer (SonarSwift). Which in turns means:
You cannot run two analyzers for the same language on a SonarQube instance. For the moment I would recommend uninstalling Backelite/sonar-swift , and keeping SonarSwift only (the one built-in the Developer Edition).
I tried that and I get: You must install a plugin that supports the language ‘swift’
To get to this point, I uninstalled sonar and sonar-scanner in homebrew, restarted my computer and didn’t load any local instances of sonar, reinstalled sonar and sonar-scanner with homebrew, started a server via sonar console and sonar start, went to my project folder and ran sonar-scanner -X
By sonar developer I mean that I am running the developer version of the server 7.2.1. What am I suppose to be downloading at the corresponding edition link?
Simply make sure you get the Developer Edition, which you can then verify by looking at the footer in the SonarQube UI. The reason I ask is that I noticed this in the logs you shared:
SonarSwift is nowhere to be found, whereas it’s present by default in the Developer Edition (I’ve just checked it’s there in the Developer Edition offered to download).
I removed the homebrew version of sonar and sonar-scanner I get the following error when processing my code:
run-sonar-swift.sh: line 123: sonar-scanner: command not found
ERROR - Command 'sonar-scanner ’ failed with error code: 127
I installed the brew version of sonar-scanner back and I got
java.lang.IllegalArgumentException: Multiple entries with same key: swift=Swift and swift=Swift
Alright. At this stage can I ask you to share the full debug logs of the scanner-side analysis (sonar.verbose=true), together with the full debug logs of the related Background Task ? That will give the end-to-end view, with a better chance at narrowing down the choking point.
I hope that I did what you wanted:
I added sonar.verbose=true to the sonar-project.properties file in my project.
Then I ran run-sonar-swift.sh that is in my project and I got the logs found in the runsonar file. I have put my server logs in the serverlogs fileserverlogs.txt (5.6 KB) runsonar.txt (20.5 KB)