美文网首页
jenkins更新报错解决方案

jenkins更新报错解决方案

作者: 夜空最亮的9星 | 来源:发表于2023-02-27 09:42 被阅读0次

    jenkins 更新报错

    There were errors checking the update sites: UnknownHostException: updates.jenkins.io

    
    java.net.UnknownHostException: updates.jenkins.io
            at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
            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:299)
            at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
            at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
            at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
            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:203)
            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:189)
            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.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3099)
            at java.base/java.net.URLConnection.getHeaderFieldLong(URLConnection.java:636)
            at java.base/java.net.URLConnection.getContentLengthLong(URLConnection.java:508)
            at java.base/java.net.URLConnection.getContentLength(URLConnection.java:492)
            at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:394)
            at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1261)
    Caused: java.net.UnknownHostException: updates.jenkins.io
            at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
            at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
            at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
            at java.base/java.security.AccessController.doPrivileged(Native Method)
            at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
            at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
            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.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1277)
    Caused: java.io.IOException: Failed to load https://updates.jenkins.io/download/plugins/nodejs/1.5.1/nodejs.hpi to /var/jenkins_home/plugins/nodejs.jpi.tmp
            at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1284)
    Caused: java.io.IOException: Failed to download from https://updates.jenkins.io/download/plugins/nodejs/1.5.1/nodejs.hpi
            at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1318)
            at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1872)
            at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2167)
            at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1846)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:121)
            at java.base/java.lang.Thread.run(Thread.java:829)
            
    
    1.安装好jenkins后,输完页面密码,这时候jenkins需要的文件目录已经生成完毕了, 切换到updates目录
    
    docker exec -it b13e815bf589 /bin/bash
    
    
    
    cd /var/jenkins_home/updates
    
    2.使用sed命令替换为国内地址
    
    sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
    
    3.重启jenkins
    systemctl restart jenkins
    //docker 安装:
    docker restart jenkins
    
    docker restart b13e815bf589
    
    

    相关文章

      网友评论

          本文标题:jenkins更新报错解决方案

          本文链接:https://www.haomeiwen.com/subject/vhshldtx.html