> git rev-list --no-walk 7756bc509c8ed181c19b8b725a3b395e13ee7539 # timeout=10
FATAL: Failed to install https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz to /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs16.4.2
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.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:168)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:993)
Caused: java.io.IOException: Failed to install https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz to /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs16.4.2
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1067)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:980)
at jenkins.plugins.nodejs.tools.NodeJSInstaller.performInstallation(NodeJSInstaller.java:145)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
at jenkins.plugins.nodejs.tools.NodeJSInstallation.forNode(NodeJSInstallation.java:95)
at jenkins.plugins.nodejs.NodeJSBuildWrapper.setUp(NodeJSBuildWrapper.java:158)
at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:294)
at hudson.model.Build$BuildExecution.doRun(Build.java:158)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
at hudson.model.Run.execute(Run.java:1900)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE
我的服务器环境是在docker中跑的jenkins,幸会我是把jenkins_home绑定到宿主机了。
jenkins:
image: jenkins/jenkins:${JENKINS_VERSION}
container_name: jenkins
volumes:
- ${JENKINS_HOME_DIR}:/var/jenkins_home
- ${JENKINS_CERTS_DIR}:/certs/client
- ${SOURCE_DIR}:/www/:rw
- ${TOMCAT_WEBAPPS_DIR}:/webapps/:rw
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7
ports:
- "${JENKINS_HTTP_PORT}:8080"
- 50000:50000
privileged: true
user: root
restart: always
environment:
TZ: "$TZ"
JAVA_OPTS: '-Djava.util.logging.config.file=/var/jenkins_home/log.properties'
JENKINS_OPTS: '--prefix=/jenkins'
networks:
- default
根据错误提示,我可以确定需要哪个文件,以及要放到什么地方。那我就从别的地方下载https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz,然后解压到/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs16.4.2这个目录,实际上这个目录对应的是我宿主机的某个文件夹,这样也方便操作。
没想到他们连nodejs都要封。