jenkinsci / helm-charts

Jenkins helm charts
https://artifacthub.io/packages/helm/jenkinsci/jenkins
Apache License 2.0
562 stars 888 forks source link

Attempt to check updates server even if plugins are baked in jenkins image #863

Open ravbaba opened 1 year ago

ravbaba commented 1 year ago

Describe the bug

I deployed the helm chart and everything seems to work but I can see the following warning in the logs:

 2023-05-02 13:28:48.770+0000 [id=58]    INFO    hudson.util.Retrier#start: Attempted the action check updates server for 1 time(s) with no success                                                                        
 2023-05-02 13:28:48.771+0000 [id=58]    SEVERE    hudson.PluginManager#doCheckUpdatesServer: Error checking update sites for 1 attempt(s). Last exception was: SocketTimeoutException: connect timed out                  
 2023-05-02 13:28:48.805+0000 [id=38]    WARNING    hudson.model.UpdateCenter#updateAllSitesNow: Failed to update the update site 'default'. Plugin upgrades may fail.                                                     
 java.net.SocketTimeoutException: connect timed out                                                                                                                                                                        
     at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)                                                                                                                                                    
     at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)                                                                                                                             
     at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)                                                                                                                      
     at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)                                                                                                                               
     at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)                                                                                                                                               
     at java.base/java.net.Socket.connect(Socket.java:609)                                                                                                                                                                 
     at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)                                                                                                                                           
     at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)                                                                                                                                                  
     at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:507)                                                                                                                                              
     at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:602)                                                                                                                                              
     at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)                                                                                                                                      
     at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)                                                                                                                                         
     at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:207)                                                                              
     at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)                                                                                                                   
     at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)                                                                                                                    
     at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:193)                                                                                       
     at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)                                                                                                                 
     at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)                                                                                                                  
     at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)                                                                                                        
     at hudson.model.DownloadService.loadJSON(DownloadService.java:122)                                                                                                                                                    
     at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:218)                                                                                                                                                     
     at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:213)                                                                                                                                                     
     at hudson.model.UpdateCenter.updateAllSitesNow(UpdateCenter.java:2631)                                                                                                                                                
     at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)                                                                                                        
     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)                                                                                                                                  
     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)                                                                                                                                                 
     at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)                                                                                           
     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)                                                                                                                          
     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)                                                                                                                          
     at java.base/java.lang.Thread.run(Thread.java:829) 

In Jenkins master image I installed the following plugins:

Dockerfile

FROM jenkins/jenkins:2.387.1-jdk11

USER root

RUN jenkins-plugin-cli --plugins \
    ldap \
    workflow-job \
    workflow-aggregator \
    credentials-binding \
    git \
    configuration-as-code \
    kubernetes \
    kubernetes-credentials-provider \
    role-strategy \
    generic-webhook-trigger \
    job-dsl \
    startup-trigger-plugin \
    timestamper \
    ansicolor \
    blueocean\
    pipeline-utility-steps\
    uno-choice \
    email-ext \
    matrix-auth

And in my values file I set the following variables:

values.yaml

installPlugins: false
installLatestPlugins: true
additionalPlugins: []
initializeOnce: false
overwritePluginsFromImage: true

Version of Helm and Kubernetes

- Helm: v3.1.2
- Kubernetes: v1.21.8-mirantis-1

Chart version

4.3.10

What happened?

1. Use helm chart: 4.3.10
2. Create custom image from jenkins/jenkins:2.387.1-jdk11 and install some plugins in it, look into above description
3. Set all the plugins variables as mentioned in above description.
4. Deploy helm chart and check the logs.

What you expected to happen?

I would expect jenkins not checking for the plugins updates when plugins were installed in the image directly and installPlugins variable set to false.

How to reproduce it

installPlugins: false
installLatestPlugins: true
additionalPlugins: []
initializeOnce: false
overwritePluginsFromImage: true

Anything else we need to know?

No response

MarkEWaite commented 1 year ago

I disagree. I think that Jenkins is correctly checking for plugin updates. The plugin installation manager tool can install specific versions of plugins and is commonly used to install versions that are not the most recent released version. Disabling checks of the update center should not be implied by the use of the plugin installation manager tool.

It might be reasonable to have some additional configuration that specifically disables checking for updates. I don't think that it should be inferred from some other condition. If we need that additional capability, it should be intentionally configured by the user.

ravbaba commented 1 year ago

Hi @MarkEWaite, thank you for your answer, I am not sure if it is a bug or a missing feature. We don't have connectivity to the internet so all our plugins are installed in our custom image which we use in this helm chart. My only concern is why would you like to check for the plugins updates if you have a scenario where you are not allowed to connect outside of your local network.

I think I should be more clear, I supposed to ask the following question:

Is it possible to disable the plugins updates check during the start?

MarkEWaite commented 1 year ago

Is it possible to disable the plugins updates check during the start?

Unfortunately, I don't know if there is a way to disable the plugin updates check. Here are some links that you could use as you investigate further:

ravbaba commented 1 year ago

I think I tried the mentioned links a week ago but I didn't get any different result, I will try it again to make sure, thanks @MarkEWaite