How do I add Grails to my cloudbees Jenkins installation? - grails

I'm trying to follow the instructions here to run my Grails build on the Cloudbees' Jenkins service:
http://wiki.cloudbees.com/bin/view/DEV/Build+and+Deploy+Grails+application
However, when I try to select a Grails installation for my build job from the "Grails Installation", the drop-down list is empty except for the "Default" option:
When I run my build I get the following error message as though there are no Grials instances installed:
java.io.IOException: Cannot run program "grails" (in directory "/scratch/jenkins/workspace/liza"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
at hudson.Launcher$ProcStarter.start(Launcher.java:338)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:934)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:901)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 15 more
Am I doing something wrong? Do I need to install Grails myself somehow?
I've tried checking the "Use Grails wrapper" checkbox but I still get a similar issue:
[liza] $ /scratch/jenkins/workspace/liza/grailsw upgrade --non-interactive
FATAL: command execution failed
java.io.IOException: Cannot run program "/scratch/jenkins/workspace/liza/grailsw" (in directory "/scratch/jenkins/workspace/liza"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)

"Use Grails wrapper" will help you here (assuming you're using Grails 2.1 or later). In your app run
grails wrapper
This will create a grailsw shell script and a few other bits and pieces in your app which you need to check in. This wrapper script can be used in place of an installed grails and it will download its own copy of Grails the first time it is run. If you tell Jenkins to "use grails wrapper" then it will not require a separate installation of Grails on the build server.

If you go to /configure on your Jenkins server you should see a list of Grails installations. If it is empty, you can add one; select Use Pre-Installed Grails on DEV#Cloud and pick one of the offered versions if they suit your needs; or you can select Install automatically and get a recent build downloaded from a public mirror.
If these things do not work out, you can always open a support ticket; reference this SO question in case there is a resolution that can help others.

Related

Sonarqube 7 unable to start due to elastic search binary not found

I have setup sonarqube 7, problem is i am getting below error while starting it -
2018.03.27 08:02:15 ERROR app[][o.s.a.p.SQProcess] Fail to launch process [es]
java.lang.IllegalStateException: Cannot find elasticsearch binary
at org.sonar.application.command.CommandFactoryImpl.createEsInstallation(CommandFactoryImpl.java:111)
at org.sonar.application.command.CommandFactoryImpl.createEsCommandForUnix(CommandFactoryImpl.java:80)
at org.sonar.application.command.CommandFactoryImpl.createEsCommand(CommandFactoryImpl.java:76)
at org.sonar.application.SchedulerImpl$$Lambda$12/1128486197.get(Unknown Source)
at org.sonar.application.SchedulerImpl.lambda$tryToStartProcess$2(SchedulerImpl.java:153)
at org.sonar.application.SchedulerImpl$$Lambda$13/1288526896.get(Unknown Source)
at org.sonar.application.process.SQProcess.start(SQProcess.java:68)
at org.sonar.application.SchedulerImpl.tryToStart(SchedulerImpl.java:160)
at org.sonar.application.SchedulerImpl.tryToStartProcess(SchedulerImpl.java:152)
at org.sonar.application.SchedulerImpl.tryToStartEs(SchedulerImpl.java:110)
at org.sonar.application.SchedulerImpl.tryToStartAll(SchedulerImpl.java:102)
at org.sonar.application.SchedulerImpl.schedule(SchedulerImpl.java:98)
at org.sonar.application.App.start(App.java:64)
Don't know why its unable to find elasticsearch binary file, as its already located inside its installation directory.
Anywhere i have to mention its path inside any config file of sonarqube 7?
This is a new installation & i am not finding any solution anywhere around.
Thanks for your help.
I had the same error at my Gentoo Linux system. All 6.7.x versions didn't work with identical error (Cannot find elasticsearch binary).
I downloaded a fresh zip file from the sonarqube website (https://www.sonarqube.org/downloads/). The zipfile contains a elasticsearch subdirectory, but this folder was missing in my original installation (installed by Gentoo emerge using the Godin overlay: https://data.gpo.zugaina.org/godin/dev-util/sonarqube-bin/).
By copying the elasticsearch folder into my original installation my problem was solved.
I found this pull request fixing the ebuild for sonarqube-bin:
https://github.com/Godin/gentoo-overlay/commit/d52d7491e10d3589832bf4785edb29caf9dd4012

Jenkins Plugins Update & Delete at same time

During my Jenkins maintenance time, I tried to "Update" some Plugins & "Uninstall" \"Unpin" some plugins at the same attempt, from "Jenkins -> Plugin Manager -> Updates \ Installed" Tabs and restarted my Jenkins Instance.
Jenkins failed to Load\parse my Config.xml saying below Errors in diff Attempts.
WARNING jenkins.diagnosis.HsErrPidList
Failed to list up hs_err_pid files
java.lang.UnsatisfiedLinkError: com.sun.jna.Native.open(Ljava/lang/String;)J
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
Unable to read c:\jenkins\config.xml
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246)
at hudson.model.Hudson.executeReactor(Hudson.java:753)
at hudson.model.Hudson.<init>(Hudson.java:667)
at hudson.model.Hudson.<init>(Hudson.java:607)
at hudson.WebAppMain$2.run(WebAppMain.java:215)
Caused by: hudson.util.IOException2: Unable to read c:\jenkins\config.xml
at hudson.XmlFile.unmarshal(XmlFile.java:152)
at hudson.model.Hudson$12.run(Hudson.java:2340)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
at hudson.model.Hudson$4.runTask(Hudson.java:735)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
My Jenkins Instance is Back Online :-)
Solution that worked for me:
I deleted the "DISABLED" files in my "C:\Jenkins->Plugins" (sort by TYPE, look for DISABLED) and Restarted my Jenkins Instance.
It loaded like a Charm. However, Configuration page Didnt load Correctly due to Some Plugins didnt get Updated good. So Identified each Job and re-loaded the Required Plugins.
Finally, used "Jenkins -> Manage Jenkins -> Reload Configuration from Disk" to get back all my Jobs back Online functioning normal.

Grails: GGTS not running on Amazon AWS EC2 anyone else successful?

I'm just curious if anyone has had success trying to run the Groovy Grails tool suite on an Amazon AWS EC2 instance with its display exported into your windows machine. If so, I wanted to know which flavor of linux was used on the EC2. I am not having much success with it on the Amazon Linux but haven't tried their Ubuntu instances yet. I got all the way to getting GGTS installed and getting the display exported but when I launch GGTS I get log errors about libraries missing. This is most likely because I didn't use yum to install it so I am probably missing dependencies but I didn't have a choice its not offered as a yum package. Here are my log file errors when I try to launch GGTS:
!SESSION 2014-06-08 03:08:04.873 -----------------------------------------------
eclipse.buildId=3.5.1.201405030657-RELEASE-e43
java.version=1.7.0_55
java.vendor=Oracle Corporation
Framework arguments: -product org.springsource.ggts.ide
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.springsourc
e.ggts.ide
!ENTRY org.eclipse.osgi 4 0 2014-06-08 03:08:12.116
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/home/ec2-user/ggts_sh/ggts-3.5.1.RELEASE/configuration/org.eclipse.osgi
/bundles/704/1/.cp/libswt-pi-gtk-4335.so: libgtk-x11-2.0.so.0: cannot open share
d object file: No such file or directory
no swt-pi-gtk in java.library.path
/home/ec2-user/.swt/lib/linux/x86_64/libswt-pi-gtk-4335.so: libgtk-x11-2
.0.so.0: cannot open shared object file: No such file or directory
Can't load library: /home/ec2-user/.swt/lib/linux/x86_64/libswt-pi-gtk.s
o
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:45)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:133)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:679)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:162)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(
IDEApplication.java:154)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEAppli
cation.java:96)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
e.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Run GGTS using Ec2 Ubuntu instead. All needed packages are there without the dependency headache. I have been successful in getting GGTS running in Ec2 Ubuntu with display exported onto my Windows environment.
The issue here is similar to : facing trouble launching spoon.sh on amazon ec2 linux
You are missing the following libraries: libswt-gtk-3-jni libswt-gtk-3-java. Either you have to recompile them (and all transitive dependencies like GTK), or use another image like Ubuntu from which you can simply do a apt-get install libswt-gtk-3-jni libswt-gtk-3-java.

Exception thrown when connecting to website during Portfolio Manager demo

I have followed the documentation to install DataStax Enterprise and run the Portfolio Manager demo for both Ubuntu Server and MacOSX. For both operating systems, when i run dse-demos/portfolio-manager/website/start and then navigate to the given url in a browser, in my terminal window I can see the exception listed at the bottom of my message. No data shows up in the browser.
nodetool status and opscenter both show that my node is working. I am using
jdk1.7.0_51.jdk from Oracle, DS 4.0.1 and cassandra 2.0.5.24.
I assume I am missing something from my classpath or a necessary .jar is not installed. I cannot find other instances of this on your support forums, and I am unsure what I need to do to fix the issue. Do you know what is causing this exception?
Error for /portfolio/service
java.lang.NoClassDefFoundError: com/thinkaurelius/thrift/util/TBinaryProtocol$Factory
at com.datastax.bdp.util.CassandraProxyClient.getConnection(CassandraProxyClient.java:668)
at com.datastax.bdp.util.CassandraProxyClient.createConnection(CassandraProxyClient.java:319)
at com.datastax.bdp.util.CassandraProxyClient.initialize(CassandraProxyClient.java:396)
at com.datastax.bdp.util.CassandraProxyClient.(CassandraProxyClient.java:376)
at com.datastax.bdp.util.CassandraProxyClient.newProxyConnection(CassandraProxyClient.java:259)
at com.datastax.bdp.util.CassandraProxyClient.newProxyConnection(CassandraProxyClient.java:306)
at com.datastax.demo.portfolio.controller.PortfolioMgrHandler.getClient(PortfolioMgrHandler.java:204)
at com.datastax.demo.portfolio.controller.PortfolioMgrHandler.get_portfolios(PortfolioMgrHandler.java:73)
at com.datastax.demo.portfolio.PortfolioMgr$Processor$get_portfolios.getResult(PortfolioMgr.java:177)
at com.datastax.demo.portfolio.PortfolioMgr$Processor$get_portfolios.getResult(PortfolioMgr.java:162)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TServlet.doPost(TServlet.java:83)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:835)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:641)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.ClassNotFoundException: com.thinkaurelius.thrift.util.TBinaryProtocol$Factory
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:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:375)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
Unfortunately this is a bug with the packaging of the Portfolio demo war file. The good news is that it will be fixed in the 4.0.2 DSE release and that there is a workaround. That workaround is to add a missing jar to the demo war, which you can do with a couple of shell commands.
First, you need to locate the jar that should be included but isn't. This file is named thrift-server-0.3.3.jar and is included along with the other Cassandra libraries in a DSE installation. If you're running DSE from a tarball, you can find it in the resources/cassandra/lib directory. If you installed DSE from the .deb or.rpm packages, it's located in /usr/share/dse/cassandra/lib. Next, you need to create the correct directory structure so that when you added to the war file the jar has has the right path.
mkdir -p /tmp/WEB-INF/lib
cp thrift-server-0.3.3.jar /tmp/WEB-INF/lib/
Finally, you need to add the jar to the Portfolio demo war. In a tarball installation this is demos/portfolio_manager/website/webapps/portfolio.war and in package installs it is found in /usr/share/dse-demos/portfolio_manager/website/webapps/portfolio.war. The command to run to update the war is (using the tarball location here):
jar uf demos/portfolio_manager/website/webapps/portfolio.war -C /tmp WEB-INF/lib
(note the space between /tmp & WEB-INF)
You'll need to have the jar executable on your path, or use its full path.
After updating the war file and restarting the webserver, you should find that the errors disappear and you can open the page in a browser.

java.io.IOException when running grails project

I got a grails Project from my friend, i imported that project in GGTS and after i refreshed dependence, i have no error.
When i trying to run I got
Error Error executing script RunApp: java.io.IOException: Cannot run program "grails": java.io.IOException: error=2, No such file or directory (Use --stacktrace to see the full trace)
I am using Ubuntu 12.4.
But, i imported same project in my another system which runs in windows 7, i didn't get any error or exception in windows.
What is the reason for this Exception ?
echo $PATH output
/home/ard006/Documents/senchaCmd/Sencha/Cmd/3.0.0.250:/home/ard006/Viswa/scala/sbt/bin:/home/ard006/Documents/senchaCmd/Sencha/Cmd/3.0.0.250:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ard006/Viswa/springsource/grails-2.1.2/bin:/home/ard006/groovy-2.0.0/bin
It looks to me like GGTS can't find the grails executable.
Is it on your PATH ? I suspect you need to set the PATH variable thus:
$ PATH=$GRAILSHOME/bin:$PATH
and then invoke GGTS from that shell, such that it inherits the PATH setting (I've assumed PATH is exported)
Just run into the same problem.
I had the Grails bin folder on the path using this notation in the .bash.rc file
export PATH="${PATH}:~/grails/bin"
The tilde broke it and I changed it to:
export PATH="${PATH}:/home/myuser/grails/bin"
Now it's working, the IOException is gone.

Resources