Proxy config after importing configuration (Jenkins) - jenkins

I have restored config in Jenkins using ThinBackup plugin (https://wiki.jenkins-ci.org/display/JENKINS/thinBackup)
Intermittently proxy stops working after restarts and I get this warning in logs:
Jul 23, 2014 11:02:04 AM hudson.diagnosis.ReverseProxySetupMonitor getTestForReverseProxySetup
WARNING: http://hostBB.com:8080/manage vs. http://hostAA.com:8080/manage
hostBB is where I imported the full backup made on hostAA.
How do I fix this?

Related

Build fails intermittently on Jenkins node machine

I created a build system on windows 2019 server where I installed Jenkins version 2.375.1 and which is running Java 17. I am completely new in this and doing it for first time.
Here is the issue: Whenever I run any job, sometime s(4-6 out of 10) it fails by throwing an exception. See below :
java.nio.channels.ClosedChannelException
at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:153)
at jenkins.websocket.WebSockets$1.onWebSocketClose(WebSockets.java:80)
at jenkins.websocket.Jetty10Provider$2.onWebSocketClose(Jetty10Provider.java:149)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.notifyOnClose(JettyWebSocketFrameHandler.java:308)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onClosed(JettyWebSocketFrameHandler.java:292)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$0(WebSocketCoreSession.java:272)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1450)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1487)
at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$1(WebSocketCoreSession.java:272)
at org.eclipse.jetty.util.Callback$4.completed(Callback.java:184)
at org.eclipse.jetty.util.Callback$Completing.succeeded(Callback.java:344)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onError(JettyWebSocketFrameHandler.java:268)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$2(WebSocketCoreSession.java:284)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1468)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1487)
............
............
............
And the log I got in node machine on console is :
INFO: Connected
Jan 15, 2023 8:05:02 AM hudson.remoting.UserRequest perform
WARNING: LinkageError while performing
UserRequest:hudson.node_monitors.SwapSpaceMonitor$MonitorTask#4c55cc1c
java.lang.UnsatisfiedLinkError: C:\Users\test*****\AppData\Local\Temp\jna--202642030\jna2121667260400486382.dll: A dynamic link library (DLL) initialization routine failed
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015)
at com.sun.jna.Native.<clinit>(Native.java:221)
at com.sun.jna.Structure.setAlignType(Structure.java:291)
at com.sun.jna.Structure.<init>(Structure.java:208)
at com.sun.jna.Structure.<init>(Structure.java:204)
at com.sun.jna.Structure.<init>(Structure.java:191)
at com.sun.jna.Structure.<init>(Structure.java:183)
at org.jvnet.hudson.Windows$MEMORYSTATUSEX.<init>(Windows.java:67)
Some more info about configuration :
Both controller and node machine is windows server 2019
Since in latest Jenkins the java web connect(Run Jenkins as service on node) is not available so directly running the agent command in node's CLI.
Both controller and node is running Java v17
I went through couple of links and tried all the possible suggestion provided like power management settings on salve machine, increasing Jenkins build timeout settings etc... but no luck.
Any help on this is highly appreciated.
Thanks.
Not sure if there is a bug in Jenkins itself or something. I could not find the answer of the exact issue but after making some changes in jenkins configuration, now i am able to run all the jobs without getting above exception.
Here it is : Earlier i checked jenkins to use websocket in slave configuration. If i just disable it and run then not getting any issue.
Just disbaling this worked for me.. Thanks.

Jenkins System configuration error when saving

An instance of Jenkins started not saving changes made under 'Manage Jenkins > System Configuration'.
In an attempt to solve it, I have recently upgraded to Jenkins 2.346.3 (including all the plugins).
Unfortunately, this behavior still persists and the System Log only shows:
Error while serving http://<jenkins_url>/configSubmit
java.lang.ClassCastException: java.lang.Integer cannot be cast to hudson.model.Describable
at hudson.util.DescribableList.get(DescribableList.java:128)
at hudson.util.DescribableList.rebuild(DescribableList.java:170)
at jenkins.model.GlobalNodePropertiesConfiguration.configure(GlobalNodePropertiesConfiguration.java:24)
at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:4017)
at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:3981)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
Caused: java.lang.reflect.InvocationTargetException
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:401)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
<snippet>
Any idea on the possible cause?
UPDATE
After 2 attempts on restarting Jenkins without the config.xml, I succeeded in having Jenkins 'Manage Jenkins > System Configuration' behaving as expected.
After the first attempt, I reverted to the old configuration file as all the security related configurations were missing and I ended up raising the ticket https://issues.jenkins.io/browse/JENKINS-69548
On the 2nd attempt, I did what I described in the ticket comment https://issues.jenkins.io/browse/JENKINS-69548?focusedCommentId=430091&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-430091 (i.e. re-introducing the security-related configurations)
You probably have a corrupted config.xml from your old installation. Try deleting the config.xml(Back it up) located at $JENKINS_HOME(if you have not changed the default JENKINS_HOME in most cases it will be at USER_HOME/.jenkins(~/.jenkins)) and restarting Jenkins. If it's successful you can start reconfiguring or moving the configs from there.

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.

Getting a Blank Page after putting Typo3 on a Docker Container

I'm trying to setup an existing Typo3-Projekt on a Docker container.
I get a blank site and the Errorlog says:
Mon, 20 Jan 2020 16:00:12 +0000 [CRITICAL] request="" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1203699034: A cache with identifier "assets" does not exist. | TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException thrown in file /var/www/html/typo3/sysext/core/Classes/Cache/CacheManager.php in line 131.
The cache is already deleted.
As usual:
get more information by enabling develop-mode in install-tool (Admin-Tools -> Settings) -> Configuration Preset. also enable a stacktrace by adding
config.contentObjectExceptionHandler = 0
to your typoscript.
Regarding assets:
if you copied an existing instance into docker, have you copied or cleared all temporary data?
In the Install-Tool (Admin-Tools -> Maintenance) : Remove Temporary Assets
The problem was the Docker Environment. Docker has a strange way setting the file permissions. Anyway, i recommend using ddev for Local ENV.
I had this Problem in ddev 1.13.0 and the only way to solve it for me, was upgrading ddev to 1.13.1
To upgrade ddev, you can simply execute:
brew upgrade ddev
Keep in mind that all projects have to be updated as well by simply running ddev config again for this projects.

Grails war command doesn't set the environment

I run an app using embedded container using grails run-app -Dgrails.env=myenv and it works fine. I then do grails war -Dgrails.env=myenv deploy it on a Tomcat 6 server and it doesn't work. I get a bunch of log4J errors that go away once I add log4j jars to Tomcat lib's directory. The lo4j errors now go away. I am left with:
INFO: Deploying web application archive qkr2.war
Sep 7, 2013 11:09:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Sep 7, 2013 11:09:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/mk2] startup failed due to previous errors
But there are no previous errors. So I haven't a clue what could be wrong.
Or what to do next. Any tips?
Thanks
According to http://grails.org/doc/latest/ref/Command%20Line/war.html, the environment comes BEFORE the "war" part of the command, so that could be it. i.e. the command should read:
grails -Dgrails.env=myenv war
Check the logging to see what environment grails thinks it's starting under. Otherwise, I'd try adding the environment variable at Tomcat startup, rather than building different wars for different environments.
This all presumes that the logging config is correct in this myenv environment. If not, then I can't tell you why it's not starting without more of the logging available.
When you see "SEVERE: Error listenerStart" deploying to Tomcat, look at the log files. In general you'll find that the error is in stacktrace.log or localhost.2013-09-07.log (the date part of the file name may be different of course).

Resources