Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/Jenkins] Help needed Install jenkins offline #22174

Closed
longfei-zhang opened this issue Apr 29, 2020 · 7 comments
Closed

[stable/Jenkins] Help needed Install jenkins offline #22174

longfei-zhang opened this issue Apr 29, 2020 · 7 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@longfei-zhang
Copy link

Is your feature request related to a problem? Please describe.
My K8S cluster can not access internet, so I pre-installed all the plugins that needed.
But when I install Jenkins chart, the master will try to download metadata from jenkins update center, it will failed because the K8S can not access internet

Describe the solution you'd like
Provide install jenkins offline

the log file
Running from: /usr/share/jenkins/jenkins.war webroot: EnvVars.masterEnvVars.get("JENKINS_HOME") 2020-04-20 08:54:09.809+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @410ms to org.eclipse.jetty.util.log.JavaUtilLog 2020-04-20 08:54:09.951+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file 2020-04-20 08:54:09.991+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath 2020-04-20 08:54:10.082+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T00:04:53.875Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_242-b08 2020-04-20 08:54:10.419+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet 2020-04-20 08:54:10.492+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0 2020-04-20 08:54:10.492+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults 2020-04-20 08:54:10.501+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms 2020-04-20 08:54:10.934+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME") 2020-04-20 08:54:11.084+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@798162bc{Jenkins v2.204.5,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war} 2020-04-20 08:54:11.111+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStart: Started ServerConnector@64616ca2{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} 2020-04-20 08:54:11.111+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: Started @1713ms 2020-04-20 08:54:11.114+0000 [id=20] INFO winstone.Logger#logInternal: Winstone Servlet Engine v4.0 running: controlPort=disabled 2020-04-20 08:54:12.965+0000 [id=25] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization 2020-04-20 08:54:13.361+0000 [id=26] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins 2020-04-20 08:54:20.971+0000 [id=26] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins 2020-04-20 08:54:21.197+0000 [id=25] INFO jenkins.InitReactorRunner$1#onAttained: Started all plugins 2020-04-20 08:54:22.568+0000 [id=25] INFO h.ExtensionFinder$GuiceFinder$FaultTolerantScope$1#error: Failed to instantiate optional component hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl; skipping 2020-04-20 08:54:23.134+0000 [id=25] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions 2020-04-20 08:54:23.240+0000 [id=25] INFO jenkins.model.Jenkins#setBuildsAndWorkspacesDir: Using non default workspaces directories: ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}. 2020-04-20 08:54:23.250+0000 [id=25] INFO jenkins.InitReactorRunner$1#onAttained: Loaded all jobs 2020-04-20 08:54:23.283+0000 [id=37] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata 2020-04-20 08:54:23.307+0000 [id=37] INFO hudson.util.Retrier#start: Attempt #1 to do the action check updates server 2020-04-20 08:54:23.924+0000 [id=26] INFO o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@13f7cd22: display name [Root WebApplicationContext]; startup date [Mon Apr 20 16:54:23 CST 2020]; root of context hierarchy 2020-04-20 08:54:23.924+0000 [id=26] INFO o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@13f7cd22]: org.springframework.beans.factory.support.DefaultListableBeanFactory@701fcb3b 2020-04-20 08:54:23.939+0000 [id=26] INFO o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@701fcb3b: defining beans [filter,legacy]; root of factory hierarchy 2020-04-20 08:54:24.125+0000 [id=26] INFO o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null 2020-04-20 08:56:26.025+0000 [id=21] INFO winstone.Logger#logInternal: JVM is terminating. Shutting down Jetty 2020-04-20 08:56:26.034+0000 [id=21] INFO o.e.j.server.AbstractConnector#doStop: Stopped ServerConnector@64616ca2{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} 2020-04-20 08:56:26.036+0000 [id=21] INFO o.e.j.server.session.HouseKeeper#stopScavenging: node0 Stopped scavenging 2020-04-20 08:56:26.039+0000 [id=21] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins

@longfei-zhang
Copy link
Author

I found the same issue here
#5626

@longfei-zhang
Copy link
Author

Another cluster that can access internet we can see the metadata been downloaded:

`2020-04-20 09:40:44.439+0000 [id=37] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata
2020-04-20 09:40:44.454+0000 [id=37] INFO hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2020-04-20 09:40:44.890+0000 [id=26] INFO o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@24288298: display name [Root WebApplicationContext]; startup date [Mon Apr 20 17:40:44 CST 2020]; root of context hierarchy
2020-04-20 09:40:44.890+0000 [id=26] INFO o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@24288298]: org.springframework.beans.factory.support.DefaultListableBeanFactory@7b55b001
2020-04-20 09:40:44.908+0000 [id=26] INFO o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7b55b001: defining beans [filter,legacy]; root of factory hierarchy
2020-04-20 09:40:45.052+0000 [id=26] INFO o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null

2020-04-20 09:43:31.956+0000 [id=37] INFO hudson.model.UpdateSite#updateData: Obtained the latest update center data file for UpdateSource default
2020-04-20 09:43:37.858+0000 [id=37] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2020-04-20 09:43:39.693+0000 [id=37] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Ant.AntInstaller
2020-04-20 09:43:43.332+0000 [id=26] INFO hudson.model.UpdateSite#updateData: Obtained the latest update center data file for UpdateSource default
2020-04-20 09:43:43.717+0000 [id=26] INFO o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null
2020-04-20 09:43:43.825+0000 [id=26] INFO o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null
2020-04-20 09:43:43.826+0000 [id=26] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
2020-04-20 09:43:43.881+0000 [id=19] INFO o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null
2020-04-20 09:43:43.941+0000 [id=19] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
2020-04-20 09:43:45.451+0000 [id=37] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.plugins.gradle.GradleInstaller
2020-04-20 09:44:28.317+0000 [id=37] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tools.JDKInstaller
2020-04-20 09:44:28.317+0000 [id=37] INFO hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2020-04-20 09:44:28.320+0000 [id=37] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Download metadata. 223,880 ms`

@longfei-zhang
Copy link
Author

I found some jenkins core properties here:
https://www.jenkins.io/doc/book/managing/system-properties/
and tried to add following two properties, but no luck.
-Dhudson.model.UpdateCenter.never=true -Dhudson.PluginManager.CHECK_UPDATE_ATTEMPTS=0

@wmcdona89
Copy link
Collaborator

Please provide more details to assist with replicating the issue.

I can successfully deploy chart v1.18.0 to a local kind (kubernetes in docker) cluster with no internet connectivity. I get a SEVERE error but it doesn't prevent Jenkins from starting.

Initial setup with internet connectivity

sudo docker pull jenkins/jenkins:lts
sudo kind load docker-image jenkins/jenkins:lts
helm fetch stable/jenkins

helm install after disabling internet connectivity

helm install jenkins ./jenkins-1.18.0.tgz --set master.installPlugins= --set master.imagePullPolicy=IfNotPresent

Partial log

2020-04-30 05:01:11.161+0000 [id=39]	INFO	hudson.util.Retrier#start: The attempt #1 to do the action check updates server failed with an allowed exception:
java.net.UnknownHostException: updates.jenkins.io
2020-04-30 05:01:11.165+0000 [id=39]	INFO	hudson.util.Retrier#start: Calling the listener of the allowed exception 'updates.jenkins.io' at the attempt #1 to do the action check updates server
2020-04-30 05:01:11.254+0000 [id=39]	INFO	hudson.util.Retrier#start: Attempted the action check updates server for 1 time(s) with no success
2020-04-30 05:01:11.277+0000 [id=39]	SEVERE	hudson.PluginManager#doCheckUpdatesServer: Error checking update sites for 1 attempt(s). Last exception was: UnknownHostException: updates.jenkins.io
2020-04-30 05:01:11.321+0000 [id=39]	INFO	hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Download metadata. 10,738 ms
2020-04-30 05:01:11.598+0000 [id=25]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2020-04-30 05:01:12.037+0000 [id=19]	INFO	hudson.WebAppMain$3#run: Jenkins is fully up and running

@gaoyanyu
Copy link

@wmcdona89 Now that have no access to the Internet, How does it completes downloading metadata? If you know it , pls show me.

@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 30, 2020
@stale
Copy link

stale bot commented Jun 13, 2020

This issue is being automatically closed due to inactivity.

@stale stale bot closed this as completed Jun 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

3 participants