Exception while configuring sonarlint plugin with connected mode in eclipse - eclipse-plugin

I am trying to install sonar lint plugin in my eclipse and configure it in 'Connected Mode'. The connection to sonarqube server is successful, but when it tries to download plugins from sonarqube server and store it my local storage it throws an exception.
Eclipse version: 2021-03 (4.19.0)
Sonar lint version: 7.5.0.54140
SonarQuber Server version: Developer Edition 9.4
[SYNC] Downloading plugin 'sonar-abap-plugin-3.10.0.3628.jar'
GET 200 http://sonarserverip:9000/api/plugins/download?plugin=abap | response time=40ms
Unable to synchronize local storage for connection 'sonarserverip'
org.sonarsource.sonarlint.core.serverconnection.storage.StorageException: Cannot save plugin sonar-abap-plugin-3.10.0.3628.jar in C:\eclipse\.sonarlint\storage\31302e3134312e392e313333\plugins
at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:64)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.lambda$downloadPlugin$1(PluginsSynchronizer.java:70)
at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.lambda$getPlugin$4(PluginsApi.java:57)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$consumeTimed$6(ServerApiHelper.java:251)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:226)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:250)
at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.getPlugin(PluginsApi.java:55)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadPlugin(PluginsSynchronizer.java:70)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadAll(PluginsSynchronizer.java:64)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.synchronize(PluginsSynchronizer.java:56)
at org.sonarsource.sonarlint.core.serverconnection.LocalStorageSynchronizer.synchronize(LocalStorageSynchronizer.java:60)
at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.sync(ServerConnection.java:131)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.sync(ConnectedSonarLintEngineImpl.java:291)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.sync(ConnectedEngineFacade.java:599)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$39(ConnectedEngineFacade.java:627)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:208)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.autoSync(ConnectedEngineFacade.java:626)
at org.sonarlint.eclipse.ui.internal.job.PeriodicStoragesSynchronizerJob.run(PeriodicStoragesSynchronizerJob.java:60)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389)
at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:475)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at java.base/java.io.InputStream.read(InputStream.java:205)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1043)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:952)
at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:52)
... 18 more
Any help would be much appreciated. Thanks in advance!

Related

IntelliJ IDEA does not read user environment variables

I have a Spring Boot 2.x application that I run within IDEA using the usual Run/Debug Configuration for Spring Boot. This works fine, but now I have to use some environment variables, and I'm placing them in the Environment variables field (from the Configuration tab)...but so far it is not picking up those values:
04-15-2021 11:08:13,233 |- WARN in n.g.e.SimpleDataFetcherExceptionHandler:25 [http-nio-9580-exec-1] - Exception while fetching data (/endpoint) : Could not open JDBC Connection for transaction; nested exception is java.lang.RuntimeException: Driver oracle.jdbc.OracleDriver claims to not accept jdbcUrl, override_value_here
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.RuntimeException: Driver oracle.jdbc.OracleDriver claims to not accept jdbcUrl, override_value_here
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:309)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:595)
It's basically using the default (useless in purpose) values I have in application.yml:
spring:
...
datasource:
driver-class-name: oracle.jdbc.OracleDriver
password: ${DATASOURCE_PASSWORD:override_value_here}
url: ${DATASOURCE_URL:override_value_here}
username: ${DATASOURCE_USERNAME:override_value_here}
What am I missing in the IDE configuration to make this work? I'm using IntelliJ IDEA 2020.3.3 (Ultimate Edition) with Runtime version: 11.0.10+8-b1145.96 amd64 under Windows 10 10.0.
By the way, this is currently working if I run the application via Gradle because it's integrated with a .env file that holds the values. If there is a way to make IntelliJ IDEA read that file I would really like to know!

SonarLint "Connection refused" to SonarQube 6.7

Since upgrading SonarQube from 6.6 to 6.7 I'm facing the Problem, that I can't connect SonarLint for IntelliJ with the SonarQube Server.
I need to configure a corporate proxy but the configuration worked with SonarQube 6.6 and hitting "Test Connection" also returns an OK.
The Error Message when configuring the Server is:
Failed to connect to the server. Please check the configuration. Error: Fail to request https://mysonardomain/sonar/api/system/status
Browsing the mentioned Page returns a valid Json Object:
{
"id": "xxxxxxxxxxxxxxx",
"version": "6.7.0.33306",
"status": "UP"
}
The Error Log shows:
Connection test failed
java.lang.IllegalStateException: Fail to request https://mysonardomain.com/sonar/api/system/status
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:179)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.get(HttpConnector.java:111)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.call(HttpConnector.java:100)
at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.rawGet(SonarLintWsClient.java:114)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.fetchServerInfos(ServerVersionAndStatusChecker.java:97)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:61)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:51)
at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:60)
at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:53)
at org.sonarlint.intellij.tasks.ConnectionTestTask.run(ConnectionTestTask.java:53)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:713)
at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:397)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.application.impl.ApplicationImpl.a(ApplicationImpl.java:575)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Caused by: java.net.ConnectException: Failed to connect to mysonardomain.com/10.1.1.10:443
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:223)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:147)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:176)
... 23 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at okhttp3.internal.platform.Platform.connectSocket(Platform.java:124)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:221)
... 41 more
The SSL Certificate is self signed but added to the JVM so IntelliJ is aware of it (and there is no SSLHandshakeException)
I'm using:
IntelliJ IDEA 2017.3.2 (Ultimate Edition)
SonarQube 6.7
SonarLint 3.1.0.2244
Has anyone else the same problem? Any Ideas? Any Information missing?
Thanks in Advance
I updated to SonarQube 6.7.1 a few days ago - this did not solve the problem.
Today I upgraded to IntelliJ IDEA 2017.3.3 - This fixed the problem
I don't know what exactly caused the problem but it's solved.
SonarQube refuses requests if the load is high.
SonarQube has some configuration in the sonar.properties.
You can refine there the maxThreads:
It depends on your usage, the default values are very small, we use this:
sonar.web.http.maxThreads=500
sonar.web.http.minThreads=100
sonar.web.http.acceptCount=500
where the load is coming?
Jenkins build jobs for example via maven plugin
IDE plugins for Visual Studio, Eclipse or ItelliJ connect to Sonar for profiles
BitBucket searching for branch analyze report
I would also recommand to update the Java options:
sonar.web.javaOpts=-Xmx2024m -Xms512m -XX:+HeapDumpOnOutOfMemoryError -server
SonarQube system admin page helps you to refine the values, because you see there the current usage.
/admin/system
Note: restart SonarQube service instead of using the restart button on admin page. Otherwise the new settings will be not used.

How to make Sonar Scanner (Runner) find objc plugin

Currently, I'm setting up Sonarqube for objective-c project.
SonarQube : 5.4 (worked)
Sonar runner: 2.8
Sonar Plugin for Objective C : https://github.com/octo-technology/sonar-objective-c
but when I try to run sonar runner for the project then terminal said:
ERROR: Error during SonarQube Scanner execution
ERROR: You must install a plugin that supports the language 'objc'
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR - Command 'sonar-runner ' failed with error code: 1
Could you please give me some advice ?
I am not sure which version of SonarQube you are using but for SonarQube version 6.7(Latest), you can download Objective-C plugin from here and copy it to :
SONAR_HOME/extensions/plugins/
In my case it was /usr/local/Cellar/sonarqube/6.7.1/libexec/extensions/plugins/
Restart the SonarQube server and you're good to go.
It's an old issue but I hope this helps someone.

Hudson Apache SVN Checkout Exception - 500 internal Server Error

I'm hitting an error while trying to checkout an SVN Repo via Hudson.
With TortoiseSVN i can checkout this Repository without any Problems.
In Hudson I use the "Hudson Subversion Plug-in -2.3.8-h-1".
At the beginning I used this SVN Syntax: svn://url/repo
Now we changed our Repositories to VisualSVNManager and i hava following Syntax: http://url:81/svn/repo
My Hudson is running on an Apache Tomcat.
Error is:
Checking out http://url:81/svn/repo revision: 23.04.2013 11:25:59 depth:infinity ignoreExternals: false
ERROR: Failed to check out http://url:81/svn/repo
org.tmatesoft.svn.core.SVNException: svn: E175002: REPORT of '/svn/repo/!svn/vcc/default': 500 Internal Server Error (http://url:81)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getDatedRevision(DAVRepository.java:207)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:178)
at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:151)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:706)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:14)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:9)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:777)
at hudson.scm.subversion.CheckoutUpdater$UpdateTaskImpl.perform(CheckoutUpdater.java:111)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:152)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:160)
at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:114)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:152)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:812)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:795)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:776)
at hudson.FilePath.act(FilePath.java:791)
at hudson.FilePath.act(FilePath.java:773)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:768)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:711)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1515)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:521)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:428)
at hudson.model.Run.run(Run.java:1390)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
at hudson.model.ResourceController.execute(ResourceController.java:81)
at hudson.model.Executor.run(Executor.java:137)
Finished: FAILURE
As far as I remember wrong SVN version was that Problem had to change from 1.4 to 1.6.

Sonar for Eclipse: unable to run local analysis

I have successfully installed sonar plug-in for eclipse, however when I try to 'Run Local Analysis' for sonar, eclipse gives an error saying:
An internal error occurred during: "Sonar Analysis".
Unable to create markers
and console for Sonar has following info printed:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash: show splash screen with specified image
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Plz help with how to proceed for Local analysis in eclipse.
[Update: Version Details]
Eclipse: Indigo (3.7.1)
Sonar Plug-in: 3.0.0
Sonar(Server): 3.4.1
Sonar Web Service Client: 3.4.0
Java: 1.4.1 ('Java EE IDE' property in Eclipse Features)
Local Java Installation: 1.6