英文:
How to trowbleshoot an issue with Jenkins master, which cannot restart?
问题
Jenkins 在从URL重新启动后不会回来。但是当您登录到机器并查看jenkins服务时,它正在运行。这是jenkins.wrapper.log中可见的内容:
2023-05-23 08:21:04,574 调试 - 以CLI模式启动WinSW
2023-05-23 08:21:05,293 信息 - 使用id 'jenkins' 重新启动服务
2023-05-23 08:21:05,465 严重 - 未处理的异常
System.Exception: 无法调用重新启动: 193
在 winsw.WrapperService.<Run>g__RestartSelf|33_6(<>c__DisplayClass33_0& )
在 winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
在 winsw.WrapperService.Main(String[] args)*
只有在手动重新启动jenkins服务后,它才会恢复正常。
Jenkins用户也是我登录的Windows用户。
英文:
Jenkins doesn't come back after restart from the URL. But when you go on the machine and look at the jenkins service it is running. This is what can be seen in the jenkins.wrapper.log:
2023-05-23 08:21:04,574 DEBUG - Starting WinSW in the CLI mode
2023-05-23 08:21:05,293 INFO - Restarting the service with id 'jenkins'
2023-05-23 08:21:05,465 FATAL - Unhandled exception
System.Exception: Failed to invoke restart: 193
at winsw.WrapperService.<Run>g__RestartSelf|33_6(<>c__DisplayClass33_0& )
at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
at winsw.WrapperService.Main(String[] args)*
It comes back only after manual restart of the jenkins service.
The Jenkins user is also the Windows user with who I'm logged in.
答案1
得分: 1
您需要仔细检查 Jenkins 控制器的 XML 配置,该配置使用了 Windows Service Wrapper,如 这篇文章 中所示。
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>此服务运行 Jenkins 自动化服务器。</description>
<env name="JENKINS_HOME" value="%LocalAppData%\Jenkins.jenkins"/>
<executable>C:\Program Files\Java\jdk1.8.0_201\bin\java.exe</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle
-jar "C:\Program Files\Jenkins\jenkins.war" --httpPort=8081 --webroot="%LocalAppData%\Jenkinswar"</arguments>
<logmode>rotate</logmode>
<onfailure action="restart"/>
<extensions>
<extension enabled="true" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" id="killOnStartup">
<pidfile>%LocalAppData%\Jenkinsjenkins.pid</pidfile>
<stopTimeout>10000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
</service>
如 2020 年指出的:
理论上,Jenkins 可以在支持 Java 8 或 Java 11 的任何地方运行,但实际上存在一些限制。
Jenkins 核心和一些插件包含本机代码,因此它们依赖于操作系统和平台。我们使用 Java Native Access 和 Java Native Runtime 库,这些库为低级操作提供广泛的平台支持,但某些通用库不涵盖的特定平台情况。
在 Windows 平台的情况下,我们使用 Windows Service Wrapper (WinSW) 和 Windows Process Management Library (WinP)。这些库依赖于特定的 Windows API 版本,以及在 Windows 服务的情况下,依赖于 .NET Framework。
因此,请仔细检查它们的版本(至少要使用 WinSW 2.9.0)。
您还可以访问 WinSW gitter 渠道 寻求帮助。
英文:
You would need to double check your XML configuration of the Jenkins controller Windows Service Wrapper, as illustrated in this article
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins automation server.</description>
<env name="JENKINS_HOME" value="%LocalAppData%\Jenkins.jenkins"/>
<executable>C:\Program Files\Java\jdk1.8.0_201\bin\java.exe</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle
-jar "C:\Program Files\Jenkins\jenkins.war" --httpPort=8081 --webroot="%LocalAppData%\Jenkinswar"</arguments>
<logmode>rotate</logmode>
<onfailure action="restart"/>
<extensions>
<extension enabled="true" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" id="killOnStartup">
<pidfile>%LocalAppData%\Jenkinsjenkins.pid</pidfile>
<stopTimeout>10000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
</service>
As noted in 2020
> In theory, Jenkins can run everywhere where you can run Java 8 or Java 11, but, in practice, there are some limitations.
>
> The Jenkins core and some plugins contain native code, and hence they rely on operating systems and platforms. We use Java Native Access and Java Native Runtime libraries which provide wide platform support for low-level operations, but there are platform-specific cases not covered by such generic libraries.
>
> In the case of Windows platforms we use Windows Service Wrapper (WinSW) and Windows Process Management Library (WinP). These libraries depend on particular Windows API versions and, in the case of Windows services, on .NET Framework.
So double-check their version. (2.9.0 at least for WinSW).
The WinSW gitter channel can also help.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论