Details
-
Bug
-
Status: Fixed but Unreleased (View Workflow)
-
Minor
-
Resolution: Incomplete
-
None
-
Windows server 2019 agent
Jenkins 2.235
Description
I follow the instructions to start the agent on my Windows Server 2019 machine. This works correctly, but I am then unable to install it as a service (File / install as a service from the agent window). When I select this from the agent window I get a dialog:
It also prints a stacktrace:
dec 21, 2020 2:17:11 EM hudson.Util getWin32ErrorMessage
WARNING: Failed to find resource bundle
java.util.MissingResourceException: Can't find bundle for base name /hudson/win32errors, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
at hudson.Util.getWin32ErrorMessage(Util.java:461)
at hudson.util.jna.JnaException.<init>(JnaException.java:37)
at hudson.util.jna.RegistryKey.check(RegistryKey.java:120)
at hudson.util.jna.RegistryKey.open(RegistryKey.java:215)
at hudson.util.jna.RegistryKey.openReadonly(RegistryKey.java:210)
at hudson.util.jna.DotNet.isV35Installed(DotNet.java:95)
at hudson.util.jna.DotNet.isInstalled(DotNet.java:65)
at org.jenkinsci.modules.windows_slave_installer.WindowsSlaveInstaller.install(WindowsSlaveInstaller.java:114)
at org.jenkinsci.modules.windows_slave_installer.WindowsSlaveInstaller.install(WindowsSlaveInstaller.java:109)
at org.jenkinsci.modules.slave_installer.impl.InstallerGui$1$1$1.run(InstallerGui.java:111)
So my questions:
1) Do I interpret the stack correctly that it's looking for .net Framework 3.5? That doesn't exist by default on Windows Server 2019 (which has 4.7). If so, the dialog message is misleading.
2) This is a bit inconvenient if so, as I'm in a corporate environment and don't have the rights to install this feature myself. Might be good if this dependency was documented and preferably removed...
Because of security enhancements in various platforms and components it has become increasingly harder to successfully use the "Install as a service" mechanism for Windows agents. However, I've been able to successfully install it on Windows Server 2016, with .NET version 4.x. I haven't heard any other reports of problems with more recent .NET versions so I suspect that isn't the problem you're encountering.
In a corporate environment you may be running into various permissions issues.
This feature is little supported and tested. The "official" Jenkins documentation on it is old and outdated, though it still kind of works. I notice that some people have found this external blog post useful, https://hayato-iriumi.net/2019/05/23/how-to-install-jenkins-slave-as-windows-service/ , but I don't know anything more about it than that.