Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64497

Cannot start agent service on Windows Server 2019 (is .net framework 3.5 required?)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Incomplete
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Windows server 2019 agent
      Jenkins 2.235
    • Similar Issues:

      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...

       

        Attachments

          Activity

          Hide
          jthompson Jeff Thompson added a comment -

          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.

          Show
          jthompson Jeff Thompson added a comment - 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.
          Hide
          jthompson Jeff Thompson added a comment -

          [As much as possible, with increasing improvements over time, the Jenkins project has deprecated some terms in favor of others. I've updated the title here to the accepted term "agent".]

          Show
          jthompson Jeff Thompson added a comment - [As much as possible, with increasing improvements over time, the Jenkins project has deprecated some terms in favor of others. I've updated the title here to the accepted term "agent".]
          Hide
          jthompson Jeff Thompson added a comment -

          I'm unable to reproduce this problem so recommend we close as Cannot Reproduce, though we can leave it open for a little while to see if others have similar experiences.

          Show
          jthompson Jeff Thompson added a comment - I'm unable to reproduce this problem so recommend we close as Cannot Reproduce, though we can leave it open for a little while to see if others have similar experiences.
          Hide
          jthompson Jeff Thompson added a comment -

          There's also some documentation on installing as a Windows service at https://github.com/jenkinsci/remoting/blob/master/docs/inbound-agent.md , though it's brief.

          Show
          jthompson Jeff Thompson added a comment - There's also some documentation on installing as a Windows service at https://github.com/jenkinsci/remoting/blob/master/docs/inbound-agent.md , though it's brief.
          Hide
          geoffbache Geoff Bache added a comment -

          Thanks for prompt replies.

          My Corporate IT have now installed .Net Framework 3.5 for me on the server, and now it works correctly.

          So there does seem to be a dependency there, at least in my environment (I have also not seen this in earlier Windows versions, though many probably had 3.5 installed anyway for other reasons).

           

          Show
          geoffbache Geoff Bache added a comment - Thanks for prompt replies. My Corporate IT have now installed .Net Framework 3.5 for me on the server, and now it works correctly. So there does seem to be a dependency there, at least in my environment (I have also not seen this in earlier Windows versions, though many probably had 3.5 installed anyway for other reasons).  
          Hide
          jthompson Jeff Thompson added a comment -

          Interesting. I don't have a lot of access to Windows machines to test, but it worked fine on a couple that I tried.

          Since you've got this working, I'm going to go ahead and close it. If anyone else sees similar behavior they can still report that and we can better understand.

          Show
          jthompson Jeff Thompson added a comment - Interesting. I don't have a lot of access to Windows machines to test, but it worked fine on a couple that I tried. Since you've got this working, I'm going to go ahead and close it. If anyone else sees similar behavior they can still report that and we can better understand.
          Hide
          jthompson Jeff Thompson added a comment -

          Not sure what to close this as so I'll mark it Incomplete, pending any further information anyone is able to provide.

          Show
          jthompson Jeff Thompson added a comment - Not sure what to close this as so I'll mark it Incomplete, pending any further information anyone is able to provide.

            People

            Assignee:
            jthompson Jeff Thompson
            Reporter:
            geoffbache Geoff Bache
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: