Error trying to run sonarqube scanner using Jenkins - sonar-runner

We have sonarqube scanner 2.6.1 installed on our Jenkins host. When trying to run sonarqube scanner from the Jenkins job we see the below
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString([B)Ljava/lang/String;
at org.sonar.core.util.UuidFactoryImpl.create(UuidFactoryImpl.java:78)
at org.sonar.core.util.Uuids.create(Uuids.java:45)
at org.sonar.core.platform.ComponentKeys.of(ComponentKeys.java:47)
at org.sonar.core.platform.ComponentKeys.of(ComponentKeys.java:35)
at org.sonar.core.platform.ComponentContainer.addComponent(ComponentContainer.java:229)
at org.sonar.core.platform.ComponentContainer.addSingleton(ComponentContainer.java:221)
at org.sonar.core.platform.ComponentContainer.<init>(ComponentContainer.java:104)
at org.sonar.core.platform.ComponentContainer.<init>(ComponentContainer.java:95)
at org.sonar.core.platform.ComponentContainer.<init>(ComponentContainer.java:91)
at org.sonar.batch.bootstrap.GlobalContainer.<init>(GlobalContainer.java:47)
at org.sonar.batch.bootstrap.GlobalContainer.create(GlobalContainer.java:52)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:102)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:92)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.start(BatchIsolatedLauncher.java:52)
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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.start(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:220)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarsource.scanner.cli.Main.execute(Main.java:70)
at org.sonarsource.scanner.cli.Main.main(Main.java:60)
Build step 'Invoke Standalone SonarQube Analysis' marked build as failure
As part of the Jenkins job we are copying code workspace for a build that is JDK 1.7 and running sonarqube scanner using JDK 1.8. This is just how it was setup in our environment

We resolved it by upgrading to sonar-scanner-3.0.3.778. Not sure why we saw this issue suddenly

Related

Unable to subscribe to change data capture event due to timeout error

I am trying to consume Salesforce Change data capture events. I am following this article :https://trailhead.salesforce.com/content/learn/modules/change-data-capture/subscribe-to-events
I have followed following steps:
To get a local copy of the EMP-Connector GitHub repository:
$ git clone https://github.com/forcedotcom/EMP-Connector.git
To build the EMP-Connector tool:
$ cd EMP-Connector
$ mvn clean package
The mvn command generates JAR files in the target folder in the EMP-Connector project directory.
The generated JAR file, target/emp-connector-0.0.1-SNAPSHOT-phat.jar, includes the connector and the LoginExample functionality. The JAR contains all the dependencies for the connector, so you don’t have to download them separately.
To run EMP Connector against your Developer Edition or Trailhead Playground org,
type this command and supply your Trailhead Playground org or Salesforce org login credentials and the channel to subscribe to. In this example, the channel is /data/Employee__ChangeEvent.
$ java -jar target/emp-connector-0.0.1-SNAPSHOT-phat.jar <username> <password> /data/Employee__ChangeEvent
After last step, I am getting following error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: Connect Timeout
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:683)
at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:124)
at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:100)
at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:92)
at com.salesforce.emp.connector.example.LoginExample.lambda$main$0(LoginExample.java:48)
at com.salesforce.emp.connector.example.BearerTokenProvider.login(BearerTokenProvider.java:24)
at com.salesforce.emp.connector.example.LoginExample.main(LoginExample.java:56)
Caused by: java.net.SocketTimeoutException: Connect Timeout
at org.eclipse.jetty.io.ManagedSelector$Connect.run(ManagedSelector.java:801)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I see a similar issue is opened on github page https://github.com/forcedotcom/EMP-Connector/issues/99
Please provide suggestion to fix this issue

Beam on EMR throws a java.util.ServiceConfigurationError

I have an Apache Beam application(using beam version 2.23.0) that I am trying to deploy on AWS EMR(emr-5.30.1) with Flink(1.10.0) preinstalled.
The application is running with no issues when I deploy it on my local docker flink cluster. But when I do
flink run -m yarn-cluster -c my_class my_jar.jar
on the master node of the EMR cluster
I get
java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:1054)
at org.apache.beam.sdk.options.PipelineOptionsFactory.<clinit>(PipelineOptionsFactory.java:471)
at org.myapp.main(MainApp.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:321)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:205)
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:138)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:664)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:213)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:895)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:968)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1844)
at org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:968)
Seems like the issue is with
org.apache.beam.sdk.options.PipelineOptionsFactory.<clinit>(PipelineOptionsFactory.java:471) but I am not clear on what is causing this behaviour.
Can someone please advise what may cause this?
Thank you in advance!
That is probably a classloading issue.
On EMR Flink EC2 instance, there are already some jars, and these libraries are loaded before your own dependencies. So, the version that is used at runtime is the one provided by EMR, not the one you have as a dependency in your own pom.xml.
There are multiple solutions:
in your pom.xml, use the same version than the one provided by EMR
in EC2 instance, replace the EMR version by yours
change the order of library loading
whatever the solution, you need to send to Flink all the required dependencies, no only the jar that contains your own code

[Zeppelin]Cannot call methods on a stopped SparkContext

When we use spark through zeppelin spark interpreter in share per note model, sometimes we get the following error info:
WARN [2019-11-11 13:37:29,610] ({pool-2-thread-16} NotebookServer.java[afterStatusChange]:2302) - Job 20191028-172705_1731645157 is finished, status: ERROR, exception: null, result: %text java.lang.IllegalStateException: Cannot call methods on a stopped SparkContext.
This stopped SparkContext was created at:
org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:925)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.apache.zeppelin.spark.BaseSparkScalaInterpreter.spark2CreateContext(BaseSparkScalaInterpreter.scala:233)
org.apache.zeppelin.spark.BaseSparkScalaInterpreter.createSparkContext(BaseSparkScalaInterpreter.scala:165)
org.apache.zeppelin.spark.SparkScala211Interpreter.open(SparkScala211Interpreter.scala:87)
org.apache.zeppelin.spark.NewSparkInterpreter.open(NewSparkInterpreter.java:102)
org.apache.zeppelin.spark.SparkInterpreter.open(SparkInterpreter.java:62)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:69)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:617)
org.apache.zeppelin.scheduler.Job.run(Job.java:188)
org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:140)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
The currently active SparkContext was created at:
(No active SparkContext.
we have reproduce this error info by the following steps:
create two notes, one is note A, the other is note B
for note A and B, run some paragraghs and see all succeeded
now, delete note A and then we run next paragragh in B, then the error happened
How can we solve this problem? is this a issue of zeppelin spark interpreter itself?
I have run into the same error message. From your description above I realized that I was running two Zeppelin instances with the same interpreter which were pointing to the same data sources (but different notebooks). On my side, I solved the issue by closing the second Zeppelin instance, and restarting my interpret.
I would suggest that you investigate the configs of your interpreter, being global or per user, to see if that may not be the cause of the problem.

jenkins htmlpublisher plugin install error

i wanted to install the HTML Publisher plugin in jenkins but when i try that, getting below error, any suggestion how to get the plugin installed.
jenkins version: 1.630.
Exception:
java.io.IOException: Failed to dynamically deploy this plugin
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1328)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1126)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Failed to install htmlpublisher plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:485)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1324)
... 5 more
Caused by: java.io.IOException: Dependency workflow-step-api (1.4) doesn't exist
at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:480)
at hudson.PluginManager.dynamicLoad(PluginManager.java:475)
... 6 more
There may be 2 ways to install a plugin.
Download the hpi plugin file and place it in the plugin directory and restart the jenkins.
Install the plugin using the plugin section in the jenkins gui.
Looks like you are trying the first method. If so you need to first install the dependency plugins
workflow-step-api (version:1.4)
matrix-project (version:1.0)
Check this link for the same: https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
If you are trying with second method, jenkins will take care of dependency installation.

Use Infinite Graph without installing the Product

I am currently writing a Infinite Graph Database Scanner where user can connect to remote InfiniteGraph by providing *.boot file. I am using Blueprint implementation of the InfiniteGraph
i.e. com.tinkerpop.blueprints.impls.ig.IGGraph.
Now the code works perfectly when the machine already has installed version of InfiniteGraph, but fails in other cases. I tried to bundle the bin folder from the installation directory with in my project, but it still fails.
The code I am using :
IGGraph graph = new IGGraph("D:\\PROPERTY_GRAPH_TEST.boot");
for (Vertex vertex : graph.getVertices()) {
System.out.println("vertex.toString() = " + vertex.toString());
}
The exception I am gettings :
Exception in thread "main" java.lang.RuntimeException: com.objy.db.ObjyRuntimeException: Query setup error: Configuration Error: Unable to find the objectivity.crg file.
at com.tinkerpop.blueprints.impls.ig.IGGraph.<init>(IGGraph.java:67)
at com.globalids.test.TestIGGraph.main(TestIGGraph.java:13)
Caused by: com.objy.db.ObjyRuntimeException: Query setup error: Configuration Error: Unable to find the objectivity.crg file.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.objy.pm.ErrorManager.exceptionToThrow(Unknown Source)
at com.objy.pm.ErrorManager.interpretKernelErrors(Unknown Source)
at com.objy.pm.ErrorManager.checkRegisteredErrors(Unknown Source)
at com.objy.pm.ExternalInterface.localErrorCheck(Unknown Source)
at com.objy.pm.ExternalInterface.checkedLong(Unknown Source)
at com.objy.pm.ExternalInterface.QueryScanItr(Unknown Source)
at com.objy.pm.QueryScanItr.<init>(Unknown Source)
at com.objy.db.internal.Query.execute(Unknown Source)
at com.infinitegraph.impl.ConnectionManager.verifyCompatability(ConnectionManager.java:211)
at com.infinitegraph.impl.ConnectionManager.connect(ConnectionManager.java:98)
at com.infinitegraph.GraphFactory.openGraph(GraphFactory.java:227)
at com.infinitegraph.GraphFactory.open(GraphFactory.java:86)
at com.tinkerpop.blueprints.impls.ig.IGGraph.<init>(IGGraph.java:62)
... 1 more
Can anyone help regarding this problem ??
Thank you in advance.
Thanks for your question. In fact the distribution requires more than just the "bin" copied over to run successfully. Can you make sure that the "etc" and "plugins" directory are each copied into the same directory as your "bin" directory? This is due to the fact that InfiniteGraph uses the location of the "bin" directory to find the other configuration files in the "etc" and "plugins" directories (where the file, objectivity.crg, and other required files are located). You can email support#objectivity.com if you have any further questions. Thanks!

Resources