Jenkins startup process: how delete or fix warning messages - jenkins

When I execute:
java -jar jenkins.war --httpPort=9090
For 2.25 version, the app starts up and works fine but I did realize in the terminal/console always appears these two warnings:
Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /var/folders/nf/ql69b5zd7w54jw6nb5zmvck80000gn/T/winstone/jenkins.war
and
org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
How I can fix them? Even when they are warnings, I want remove them.
For the first, yes, I've confirmed the path only exists until /var/folders/nf/ql69b5zd7w54jw6nb5zmvck80000gn/T/, the rest winstone/jenkins.war does not exist.
Why does the second appear?

I have faced the same issue.But i fixed it.Please download apache-tomcat-8.5.16 or the latest one.Run the startup.bat file and type http://localhost:8080/ and you will see Apache Tomcat up & running on your local host.
Now run java -jar jenkins.war and type http://localhost:8080/jenkins/ and jenkins will be up and running on your local host.
Hope it will solve your issue.

Corrected Command:
java -jar jenkins.war -httpPort-9090

Related

Jenkins service not starting anymore after system update

I have updated my redhat server where jenkins was installed. After reboot, the jenkins service is not starting up.
getting the below error
java.io.FileNotFoundException:
"/opt/data/jenkins/war/"META-INF/MANIFEST.MF (No such file or
directory)
MANIFEST.MF file is present under /opt/data/jenkins/war/META-INF . Any idea what this could be? Also the " in /opt/data/jenkins/war/ looks a bit strange to me.
We fixed this by looking at systemctl parameters which were wrong. Restart jenkins after correcting that solved the problem

Jenkins Windows Service Not Starting

Jenkins was up and running for months without issue, as a windows service.
I did some Jenkins updates (copied a newer/later .war file to the .jenkins folder) and some windows updates also occurred. The version that I have is Jenkins 2.263.3.
I did a lot of trolling through the documentation and other StackOverflow tickets and found out that the JENKINS_HOME environmental variable was missing. I added this.
Here is what my investigation reveals.
The Java environment variable is set - see below:
C:\>java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
JENKINS_HOME environmental variable is set - see below:
C:\>echo %JENKINS_HOME%
C:\Users\XXXXX\.jenkins
The Installation was under user XXXXX and the service account Log On was configured accordingly
I do not have another application using port 8080 - I checked this with sys internals.
My jenkins.xml looks like this:
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins automation server.</description>
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<executable>java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
<!--
interactive flag causes the empty black Java window to be displayed.
I'm still debugging this.
<interactive />
-->
<logmode>rotate</logmode>
<onfailure action="restart" />
<!--
In the case WinSW gets terminated and leaks the process, we want to abort
these runaway JAR processes on startup to prevent corruption of JENKINS_HOME.
So this extension is enabled by default.
-->
<extensions>
<!-- This is a sample configuration for the RunawayProcessKiller extension. -->
<extension enabled="true"
className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension"
id="killOnStartup">
<pidfile>%BASE%\jenkins.pid</pidfile>
<stopTimeout>10000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
<!-- See the referenced examples for more options -->
</service>
I can start Jenkins from the command line as follows:
java -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Users\XXXXX\.jenkins\jenkins.war" --httpPort=8080 --webroot="C:\Users\XXXXX\.jenkins\war
If I try start it from the Serice Manager I get this error - System.BadImageFormatException
One last thing, once I start Jenkins from the command line, and login to the the application, I note the following Jenkins System log:
Feb 17, 2021 10:29:31 AM INFO hudson.WebAppMain$3 run
Jenkins is fully up and running
Feb 17, 2021 10:29:57 AM WARNING hudson.lifecycle.WindowsServiceLifecycle getBaseDir
Could not find environment variable 'BASE' for Jenkins base directory. Falling back to JENKINS_HOME
Any suggestions how to get the service to start via the Service Manager?
The service is starting and stopping without issue.
The problem I suspect was that the original install of Jenkins was very old, and I presume that it may have been a 32-bit application at the time. The current updates seem to 64-bit apps. Since the original install, Jenkins was updated - with changes spanning several major releases from the original install (.war file updates). The jenkins.exe file - that starts the service was never updated.
The error message 'System.BadImageFormatException' after much research indicated that the issue was related to compatibility difference between 32/64 bit executable. I presume it was expecting a 64-bit executable but was getting a 32-bit exe.
To solve this problem I installed the latest version of Jenkins on my local PC.
On the Server I backed up the files:
jenkins.exe
jenkins.exe.config
I then stopped Jenkins on the Server, where the Service was not Starting (from the terminal window with Ctrl+D).
I then replaced these 2 files on the server with the latest files from my local installation.
Service started the first time.

Jenkins service start error on red hat linux

The jenkins service does not start when ever i run jenkins service start . It says
Starting Jenkins bash: /usr/bin/java: No such file or directory
[FAILED]
I have java installed at /usr/lib/jvm/jdk1.7.0_51. The JAVA_HOME variable is also set. Also tried adding this java to /etc/init.d/jenkins file. I need to use the sun jdk, not open jdk.
Tried some of the alternatives from stackoverflow as well but did not work out.
Any suggestions will be of great help.
Thanks,
Bhargav
Thanks Paul. The script inside /etc/sysconfig/jenkins needs to be edited. Else it uses the default java.
JENKINS_JAVA_CMD="path of java installation"
Along with the above script, one can make changes to /etc/init.d/jenkins file if needed to add the path of java installation in your system.
I'd guess that there's a script that has /usr/bin/java hardcoded. When you find the culprit, remove the /usr/bin so that it uses the default. Or you can change it to use the JAVA_HOME path, something like this:
JAVA_EXECUTABLE=$JAVA_HOME/bin/java
$JAVA_EXECUTABLE $JAVA_OPTS etc.. etc..

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.
Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.
After Erlang install using default install location to C:\Program Files\erl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:
Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.
Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?
1- Set environment variable:
Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4
note: don't include bin on above step.
2- Add %ERLANG_HOME%\bin to the PATH environmental variable:
Variable name : PATH
Variable value: %ERLANG_HOME%\bin
This works well.
There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.
editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:
if not exist "!ERLANG_HOME!\bin\erl.exe" (
that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:
"!ERLANG_HOME!\bin\erl.exe"
I simply hardcoded the path to my erl.exe:
"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"
With the pathing correct, the rabbitmq .bat files will run.
I had the similar issue, modifying ERLANG_HOME in .bat files did not work. Then I tried echo %ERLANG_HOME% in command prompt, that did not print the environment variable value(I could see that ERLANG_HOME environment variable has been created under advance system settings), that lead me to believe that I need to restart server for 64 bit installation of Erlang. After rebooting server, It worked like a charm. I hope this helps someone.
Just to share an up-to-date answer as of 2019: On Windows Server 2019, after setting up the environment variable, a restart is required to solve the problem.
I got into same kind of problem.
I solved it by doing three changes as given below.
Update Path variable "ERLANG_HOME" : "C:\Program Files\erl8.0" in Environment Variables.
Upadte "Path" variable "Path" : ";%ERLANG_HOME%\bin;"
Give urself FULL CONTROL permissions over "Program Files" in C drive.
It worked for me in this way.
This problem still occurs in Erlang 18.3 (erl7.3) and RabbitMQ 3.6.9 on Windows when upgrading from any older version of RabbitMQ to version 3.6.9. The solution as already stated here is to manually set ERLANG_HOME with 'setx -m ERLANG_HOME "C:\Program Files\erl7.3"' before starting the service.
What happens is that the RabbitMQ 3.6.9 installer removes the environment variable ERLANG_HOME from the system while removing the older version of RabbitMQ. Then, when it proceeds to the installation step, it does not put back the ERLANG_HOME variable. Then, the batch files that start up RabbitMQ cannot find Erlang. They try to find Erlang's home directory using "where.exe" but it always fails after an upgrade.
RabbitMQ's installer also does not kill all of the Erlang background processes, causing many of its files to be undeletable due to the Windows "file in use" problem. This leaves behind "files in use" in %APPDATA%\RabbitMQ and "C:\Program Files\RabbitMQ." These processes are "erl.exe," "erlsrv.exe," and "epmd.exe." The RabbitMQ installer should taskkill these processes after shutting down the RabbitMQ Windows service.
RabbitMQ is rather clunky on Windows.
Download Erlang or OTP - Only one Version of OTP should be installed
Download RabbitMQ installer
Install both exe file as Administrator
Set class path for Erlang. (Setting classpath is a bit troublesome, so follow these steps)
Set a new path with name ERLANG_HOME and value C:\Program Files\erl-23.1 (do not copy bin folder here)
Edit System "path" and add %ERLANG_HOME%\bin
Go to Start - Open rabbitmq command promt and run
rabbitmq-plugins enable rabbitmq_management
Navigate to localhost:15672
Use guest/guest to login
Interesting that this worked for you. There is record of a two bugs in Erl5.9.2 that cause an incomplete installation where %ERLANG_HOME%\bin is not installed.
Either of
* Installed 64bit erlang on 32bit machine
* "The program can't start because MSVCR100.dll is missing from your computer."
https://groups.google.com/d/topic/erlang-programming/wGtFLzapiQ0/discussion
Try 5.9.1 or any other version. They also mention making the future versions of the installer alert you if it fails.
I just had the same problem mentioned here. I installed otp_win64_R15B02 on a Windows 7 machine and everything worked perfectly, but I used the same installer on a Windows 2008 server and the bin directory was not created. I then uninstalled otp_win64_R15B02 and downloaded the otp_win64_R15B02_with_MSVCR100_installer_fix and the bin directory was created.
I suspect the reason it worked on my Windows 7 system is that I have Visual Studio installed and the required libraries were already available which allowed the otp_win64_R15B02 installer to work correctly.
Oh, and if you're installing Erlang to run RabbitMQ the RabbitMQ install will succeed with the broken installer but installing otp_win64_R15B02_with_MSVCR100_installer_fix after RabbitMQ will not work, just un-install and re-install RabbitMQ to resolve this.
Just give C:\Program Files\erl10.6\ not C:\Program Files\erl10.6\bin\erl.exe in the environment variable. If you open the server.bat file I came to know the issueenter image description here
I think this is encoding issue on windows.I see a correct value but I write echo %ERLANG_HOME% on console the value come with question mark. These steps fix it.
1.go environment variable window
2.edit ERLANG_HOME item
3.copy the value, open notepad and paste there
4.copy again on notepad and paste to edit window
5.apply and exit window
6.close command line tools and reopen
7.run rabbitmq bat file.
I solved it in a quick and dirty way,without naming path variables
I've opened the bat file and replaced every occurrence of
!ERLANG_HOME!\bin\erl.exe
with hard coded path for example might be diffrent path for you because of diffrent version
C:\Program Files\erl10.3\erts-10.3\bin\erl.exe
and replaced
%RABBITMQ_HOME%\escript\rabbitmq-plugins
with
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.14\escript\rabbitmq-plugins
Even I was this problem. The issue was the environment variable ERLANG_HOME=c:\Program Files\erl9.0 which was never existed.
I cross checked the path. The correct path was c:\Program Files\erl9.3.
After correcting the
ERLANG_HOME=c:\Program Files\erl9.3
the problem solved. So, definitely it is a path issue.
In my case, it should be installed erlang using admin role running
If above solutions doesn't work for you then you can try following
Find another compatible version of erlang for your rabbit mq e.g. for rabbit 3.7.x erlang version 20.3.x to 22.0.x all are compatible .
Right click newly downloaded erlang version and from properties select the option to unblock the file .
Run the erlang with admin persssion .
Re run rabbit mq exe

Grails: Native2ascii error when I add a new property to message.properties

I get a strange error when I add a new property to message.properties file in my grails application during runtime. When I restart the application via the command line, or restart STS, this error disappears. I am on version 2.0.1 and until a week ago, I was able to add new properties to message.properties file during runtime. Here is the stacktrace of the error
| Error 2012-06-18 16:54:58,702 [Thread-38] ERROR plugins.AbstractGrailsPluginManager - Plugin [i18n:2.0.1] could not reload changes to file [/home/project/grails-app/i18n/messages.properties]: Error starting Sun's native2ascii:
Message: Error starting Sun's native2ascii:
Any ideas?
cd to jdk path
cp lib/tools.jar jre/lib/ext/tools.jar
It solves the issue.
Note: to get correct jdk path,
check GGTS --> Windows --> Preferences --> Java --> Installed JREs --> JREs Home Path
You should be using JDK rather than JRE.
Also, if you don't need the native2ascii (which you probably don't), in BuildConfig.groovy use: grails.enable.native2ascii = false
Very frustrating bug.
After I executed all the steps suggested above in this thread, grails app was STILL not seeing tools.jar...
GRRR!
For anyone experiencing this problem in GGTS when pointing to the 1.7 jdk (when setting the jre) persisting afterwards, you MUST do the following:
Pick the correct jdk (1.7) in the "JRE Definition" panel within "Installed JRE's" in the GGTS Preferences panels.
Watch the jars from that jdk populate in the JRE definition window panel at the bottom "JRE System Libraries".
Check for tools.jar (mine DID NOT show up as recognized within the jdk lib or, after i tried 'zawmn83's post above) in /lib/ext.
If tools.jar does not show up as recognized in the jdk, click the "Add External JARs..." button, find it, add it.
That completely solve my problem - THANK GOD!!!!
p.s. i also had to set my JAVA_HOME to my 1.7 jdk correctly, in my .bash_profile but, that's already called out here as part of the solution.
Thanks everyone for contributing on this one - this bug has been causing me brain damage whilst tinkering with it today, and the above suggestions got me 99% of the way there!
I had a similar problem, in the end I
Removed the Debug Config for the Project
Deleted the project (but NOT the files)
Removed the .settings directory
Removed the .classpath and .project files from the project
Created a New General Project with the same name in the workspace
Recreated the Debug -> Run as Run-App
Hope this helps
This happened to me when I installed java 8 in parallel with java 7 on Ubuntu but didn't properly configure it with update-alternatives. Specifically, JAVA_HOME was not set properly.
I had a similar error when compiling Grails 2 from the command line under linux.
Error packaging application: Error occurred processing message bundles: Error starting Sun's native2ascii:
...
Caused by: : Error starting Sun's native2ascii:
...
Caused by: java.lang.ClassNotFoundException: sun.tools.native2ascii.Main`
I solved it by setting JAVA_HOME to JDK as mentioned above, something like
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161.x86_64
and not:
JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
also include $JAVA_HOME/bin in the PATH variable
On linux, running grails war command, it solves the issue
cp /usr/lib/jvm/java-1.8.0-openjdk/lib/tools.jar /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext/

Resources