Getting File permissions error when exploding the cucumber-jvm.jar - gradle

I am trying to create an executable jar for functional tests by exploding the dependency jars, using gradle task of type Jar.
Cucumber-1.1.3 is one of the dependencies.
I am using gradle 1.1 with JVM 1.6 (company standards)
I get the following error :
org.gradle.api.GradleException: Could not expand ZIP '/dev/shm/263985/transformer/caches/artifacts-14/filestore/info.cukes/cucumber-java/1.1.3/jar/4b389fbe494942b319518d27ae38571f477967f6/cucumber-java-1.1.3.jar'.
at org.gradle.api.internal.file.archive.ZipFileTree.visit(ZipFileTree.java:97)
at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)
at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree.visit(AbstractFileTree.java:136)
at org.gradle.api.internal.file.AbstractFileTree.getFiles(AbstractFileTree.java:37)
at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:39)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60)
at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42)
at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule.create(InputFilesChangedUpToDateRule.java:35)
at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(CompositeUpToDateRule.java:35)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java:80)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:88)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:128)
at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$ShortCircuitArtifactState.isUpToDate(ShortCircuitTaskArtifactStateRepository.java:77)
at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java:37)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:129)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.api.GradleException: Could not copy zip entry /dev/shm/263985/transformer/caches/artifacts-14/filestore/info.cukes/cucumber-java/1.1.3/jar/4b389fbe494942b319518d27ae38571f477967f6/cucumber-java-1.1.3.jar!cucumber/api/java/ar/??.class to '/dev/shm/263985/transformer/target/tmp/expandedArchives/cucumber-java-1.1.3.jar_6mn6efsv2arssmg9fup79f3fm5/cucumber/api/java/ar/??.class'.
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:68)
at org.gradle.api.internal.file.archive.ZipFileTree$DetailsImpl.getFile(ZipFileTree.java:124)
at org.gradle.api.internal.file.AbstractFileTree$1.visitFile(AbstractFileTree.java:39)
at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree$1.visitFile(AbstractFileTree.java:145)
at org.gradle.api.internal.file.archive.ZipFileTree.visit(ZipFileTree.java:90)
... 61 more
Caused by: java.io.IOException: Failed to set file permissions 420 on file ??.class. errno: 84
at org.gradle.internal.nativeplatform.filesystem.LibcChmod.chmod(LibcChmod.java:39)
at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.chmod(GenericFileSystem.java:67)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:65)
... 65 more
Note: This works fine when you use gradle 1.1 with JVM 1.7.
Let me know if you guys know why this is happening and is there any fix or alternatives.
Thanks in advance!!

You may be encountering an issue we've run into. I'm not sure we 100% understand it, but it appears that when unzipping an archive that has read-only files in it gradle can struggle. Gradle attempts to check the zip against any files it has already unzipped in order to know if the unzipping task is up-to-date, and this process can blow up if the archive has read-only files.
Notice lines like this in your stacktrace:
org.gradle.api.internal.changedetection.CompositeUpToDateRule.create
Caused by: java.io.IOException: Failed to set file permissions 420 on file
Not quite a smoking gun, but a pretty strong implication. Our solution (hacky, I'll admit) was to use the following code:
def fixExpandedArchivesForLinux() {
// This interesting hackery fixes the expandedArchives directory
// to avoid the read-only extracted ZIP file contents issue.
def dir = new File(buildDir, "tmp/expandedArchives")
FilePermissions.chmodRecursively(dir, 0200)
}
You can put that in a do first to allow gradle to re-expand the archive while it checks the up-to-date status.

I got a similar issue when working with android libraries (aars). I got it working by deleting the directories where the aars are exploded.
def str = "rm -rf "+buildDir.absolutePath+"/exploded-aar"
str.execute()

I just had the same problem involving a file called "??.class" in cucumber.
The exception cause from a run of
./gradlew connectedCheck --debug --stacktrace
showed the following root cause
Caused by: net.rubygrapefruit.platform.NativeException:
Could not set UNIX mode on .../app/build/tmp/expandedArchives/cucumber-java-1.2.4.jar_bkzp93af0tagkjvsr5vkgywjd/cucumber/api/java/ar/??.class:
could not convert string to current locale
It turns out that I had a problem with my locale for which I had previously ignored all warnings from other command line tools.
I checked which locales are mentioned in /etc/locale.conf, uncommented the corresponding lines in /etc/locale.gen and ran
sudo locale-gen
to regenerate the locales.
After this, the file names showed up like ਅਤੇ.class and the unzipping worked flawlessly.

Related

Gradlew checkstyleMain command not using right directory

I'm trying to run ./gradlew checkstyleMain on my project, and I keep getting this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkstyleMain'.
> Unable to create Root Module
when I run it with --stacktrace, I get
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module SuppressionFilter - Unable to find: .checks/checkstyle_suppressions.xml
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createRootModule(CheckstyleAntTask.java:412)
... 140 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to find: .checks/checkstyle_suppressions.xml
at com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader.getSuppressionLoader(SuppressionsLoader.java:279)
at com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader.loadSuppressions(SuppressionsLoader.java:233)
at com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader.loadSuppressions(SuppressionsLoader.java:220)
at com.puppycrawl.tools.checkstyle.filters.SuppressionFilter.finishLocalSetup(SuppressionFilter.java:81)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:194)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472)
... 142 more
Caused by: java.io.FileNotFoundException: /Users/Matthew.Hall/.gradle/daemon/7.4.2/.checks/checkstyle_suppressions.xml (No such file or directory)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:150)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:861)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at com.puppycrawl.tools.checkstyle.XmlLoader.parseInputSource(XmlLoader.java:84)
at com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader.getSuppressionLoader(SuppressionsLoader.java:275)
... 147 more
I've checked, and the file is in the my in my .checks folder in my project, however that last "caused by" makes it look like its checking a folder it shouldn't be.
I'm able to work around it by copying my .checks folder from the project into /Users/Matthew.Hall/.gradle/daemon/7.4.2/ but I shouldn't have to do that.
How can I fix this? (Can't figure out how to get it to check in my project folder instead of .gradle/daemon/7.4.2).

Jenkins Build Failure, is this a Path variable issue?

I am new to Jenkins and currently doing a course on Udemy, I am working on Windows.
I am trying to build a sample project using the Maven plugin.
I am getting the following error in the console output after the build failure.
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program " C:\Program Files\Java\jdk1.8.0_291/bin/java" (in directory "C:\Users\Shashank\AppData\Local\Jenkins\.jenkins\workspace\Time Tracker"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:252)
at hudson.Proc$LocalProc.<init>(Proc.java:221)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:996)
at hudson.Launcher$ProcStarter.start(Launcher.java:508)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:280)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:802)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
at hudson.model.Run.execute(Run.java:1906)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:453)
at java.lang.ProcessImpl.start(ProcessImpl.java:140)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 12 more
Finished: FAILURE
I noticed a sudden change from \ to / in here
Cannot run program " C:\Program Files\Java\jdk1.8.0_291/bin/java"
is that the issue ? Any help will be appreciated.
Below is a screenshot of the configuration
It can be due to the space at the beginning of the command.
try "C:\Program Files\Java\jdk1.8.0_291/bin/java" instead of " C:\Program Files\Java\jdk1.8.0_291/bin/java"
even " C:\Windows\explorer.exe" won't work with the preceding space character when it is used with quotation marks...

Gradle build fail with Cannot run program No such file or directory

I have a gradle build file with the following task which need to run sphinx-build, I'm running it on Mac OS X with the gradle information bellow.
task makeDocs(type:Exec) {
workingDir 'sphinx'
commandLine 'sphinx-build'
args = ["-b", "html", "-d", "build/doctrees", "-t", "$platformDir", "build/ppsource", "build/html"]
}
When I run this task I get the following exception:
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'sphinx-build'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 1 more
Caused by: java.io.IOException: Cannot run program "sphinx-build" (in directory "/Users/idoran/Documents/Seebo/dev/SDK/seebosdk_docs/sphinx"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 3 more
Caused by: java.io.IOException: error=2, No such file or directory
When I run sphinx-build from the same terminal everything works fine.
$ gradle --version
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_65 (Oracle Corporation 25.65-b01)
OS: Mac OS X 10.10.5 x86_64
Try stopping the gradle daemon with ./gradlew --stop
I had the same problem with something as simple as:
commandLine = [ "node", "--version"]
It came down to the gradle daemon having a cached location of node which no longer existed (I had updated node sometime before).
You shouldn't use commandLine + args together in a Gradle Exec task. Either use commandLine with executable and all arguments as the value, or executable + args which is the better alternative usually.
I had similar issue.. With Vampire's solution, I was able to step up.. However the issue seems to be the sh file not able to point to the exact file location.
Meaning, even with workingDir (wherein actual sh file resides) set properly, still was getting the following exception.
Caused by: java.io.IOException: error=2, No such file or directory
Finally, this post resolved the issue..
Though the original issue of this post's question is already resolved, thought of sharing this solution of adding the absolute file path to actual sh file would resolve the "No such file or directory" issue to someone in the future..
I ran into similar issue and got it resolved with absolute path reference to sh file.
Mine was,
workingDir = "path_to_the_actual_sh_file_to_be_executed"
executable = new File(workingDir, 'actual.sh')
args = ['configure', 'manageRepo', '-tenant', 'etc...']
This error can occur for a couple different reasons. Unfortunately it is not always clear from the error message which one is the problem.
workingDir does not exist. Make sure the specified directory exists before your task runs, or create it in a doFirst block like this:
task makeDocs(type: Exec) {
workingDir 'sphinx'
executable 'sphinx-build'
args = ["-b", "html", /* other args... */]
doFirst {
workingDir.mkdirs()
}
}
The specified executable does not exist or is not on the path. As other answers mention, make sure you are either specifying only commandLine, or both executable and args. So either:
commandLine "sphinx-build", "-b", "html"
or equivalently,
executable = "sphinx-build"
args = ["-b", "html"]
My gradle file contained a snippet to get the aws auth token and I was getting the same failure - Caused by: java.io.IOException: error=2, No such file or directory
In my case, the issue was not caused due to caching.
It was due to gradle not being able to find the aws binary.
What worked for me - Use the which aws command to find the absolute path to aws binary and use it for the binary as shown below. Hope this helps someone with similar issue.

Error Installing ruby runtime in Jenkins

I try to install ruby runtime, rvm, cucumber plugins in Jenkins,
When I am installing ruby runtime plugin, I meet this error:
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 ruby-runtime plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:487)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1324)
... 5 more
Caused by: java.io.IOException: Failed to initialize
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:441)
at hudson.PluginManager.dynamicLoad(PluginManager.java:478)
... 6 more
Caused by: java.lang.ClassCircularityError: org/jruby/RubyClass
at java.lang.Class.forName0(Native Method)
...
How to fix it? Thanks in advance
It's a known bug.
There is a workaround:
in /etc/default/jenkins
-Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true
JAVA_ARGS="$JAVA_ARGS -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true"
At the moment there is no definitive solution as you can see.
On Windows,
Adding argument
-Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true
in jenkins.xml file worked for me as #lvthillo stated.
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true -jar "%BASE%\jenkins.war" --httpPort=8081 --webroot="%BASE%\war"</arguments>
On OSX I had to edit /Library/Application Support/Jenkins/jenkins-runner.sh
to add these lines at a point after javaArgs was defined
# workaround for ruby runtime install issue
# per http://stackoverflow.com/questions/33883551/error-installing-ruby-runtime-in-jenkins
javaArgs="$javaArgs -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true"
There is probably a more mac-ish way to do this.
Upon rebooting Jenkins, the ruby runtime plugin, which was already downloaded, started working, as did the also-downloaded rvm plugin, which is the one I was after.
I solved it by changing java version to 8th.
Maybe there is a problem with java 11 compatibility issues.
1- https://www.liquidweb.com/kb/install-java-8-on-centos-7/
2- On Centos delete all ruby plugin in /var/lib/jenkins/plugins
3- download ruby-runtime.hpi plugin from https://updates.jenkins-ci.org/download/plugins/ruby-runtime/
4- Upload Plugin in jenkins /pluginManager/advanced.
Adding -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true in jenkins.xml file doesn't work for me (Windows, Jenkins 2.277.1).
So I just deleted all files for ruby-runtime from Plugins folder (you need to shutdown Jenkins service) and start Jenkins again.
For me, installing java 8 solved the problem. After that I was able to install the ruby-runtime plugin.
Environment: Debian 10

ElasticSearch + Twitter river class not found

I am trying to install twitter river plugin on elastic search. I have done it before on my mac without any issues, but this time I am trying to install on a Linux server and I keep getting this class not found exception. The exception comes when I use curl -XPUT command as shown in https://github.com/elasticsearch/elasticsearch-river-twitter/blob/master/README.md
Here's the exception I get :-
[2013-11-25 15:12:00,116][WARN ][river ] [Fasaud] failed to create river [twitter][my_twitter_river2]
org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [twitter]
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87)
at org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58)
at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44)
at org.elasticsearch.river.RiversService.createRiver(RiversService.java:135)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:271)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:265)
at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:93)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: twitter
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73)
... 9 more
I have tried restarting, installing many many times and can't get it to work anyhow. I can also see that the jar files present in the plugin directories contain the class twitter but for some reason they're not available to elasticsearch execution.
This is a configuration and install issue.
Steps:
Check to see where elasticsearch is installed by running ps aux|grep elasticsearch (on linux) and that will tell which executable is running on that machine (look for a line that looks like this: (-Des.default.path.home=/usr/share/elasticsearch) or something similar.
If several elasticsearch instances running, kill them all and start the one you care about.
Ensure that only one instance of elasticsearch is running (if that is the intent) and, from step one above, go to the home path directory.
Ensure that the plugin is installed in this directory in elasticsearch/plugins dir.
Restart elasticsearch.
confirm your classpath contain a text file es-plugin.properties with content
plugin=your.package.YourRiverPlugin
missing of such a property file shows almost the same error.
for more info, please refer http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/

Resources