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

Fail to start the windows service when trying to launch agent node

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.248

      Description

      We used to be able to launch the slave node successfully, but it did not work since we upgraded the jenkins to latest version (1.449)

      It doesn't dump any exception to the console, but I captured the output:

      Connecting to 192.168.160.62
      Checking if Java exists
      java full version "1.7.0-b147"
      Installing the Jenkins slave service
      Copying jenkins-slave.exe
      Copying slave.jar
      Copying jenkins-slave.xml
      Registering the service
      ERROR: Failed to create a service: Status Invalid Service Account
      ...
      

        Attachments

          Activity

          Hide
          rpovelik Rostislav Povelikin added a comment -

          Still actual!!!

          [2017-03-07 21:49:25] [windows-slaves] Starting the service ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins

          java.lang.reflect.UndeclaredThrowableException

          at com.sun.proxy.$Proxy56.start(Unknown Source) at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:340) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:261) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140) ... 8 more Caused by: org.jinterop.dcom.common.JIException: Service Logon Failure at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149) ... 13 more

          Show
          rpovelik Rostislav Povelikin added a comment - Still actual!!! [2017-03-07 21:49:25] [windows-slaves] Starting the service ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy56.start(Unknown Source) at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:340) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:261) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140) ... 8 more Caused by: org.jinterop.dcom.common.JIException: Service Logon Failure at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149) ... 13 more
          Hide
          phopkins101 Peter Hopkins added a comment -

           
          Managed to make this occur, not sure if this helps debug / resolve the issue. On a windows 10 slave that was working, I turned on auto logon so my admin user would logon automatically at boot time. Once I did this the same issue above started happening. To which .\username and hostname\username could not rectify the issue. I also disabled auto login and the problem still persists. I will likely build the slave up from scratch again.

          Server: Jenkins:lts docker image, ver 2.73.2, jdk8+

          Client Windows 10, jdk8+ 

          [ts-syd-01] Starting Virtual Machine...
          [ts-syd-01] VM already powered on
          [ts-syd-01] Waiting for VMTools
          [ts-syd-01] VM Tools are running
          [ts-syd-01] Finished wait for VMTools
          [ts-syd-01] Waiting for 10 seconds before asking hudson.os.windows.ManagedWindowsServiceLauncher@6b5f20e to launch slave.
          [ts-syd-01] Asking ManagedWindowsServiceLauncher to launch slave.
          [2018-01-31 07:34:34] [windows-slaves] Connecting to 10.7.65.217
          Checking if Java exists
          java -version returned 1.8.0.
          [2018-01-31 07:34:42] [windows-slaves] Copying jenkins-slave.xml
          [2018-01-31 07:34:42] [windows-slaves] Copying slave.jar
          [2018-01-31 07:34:42] [windows-slaves] Starting the service
          [ts-syd-01] EXCEPTION while starting VM
          java.lang.reflect.UndeclaredThrowableException
          java.lang.reflect.UndeclaredThrowableException
          at com.sun.proxy.$Proxy94.start(Unknown Source)
          at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:342)
          at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64)
          at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:248)
          at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:262)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140)
          ... 10 more
          Caused by: org.jinterop.dcom.common.JIException: Service Logon Failure
          at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149)
          ... 15 more
          ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
          org.jinterop.dcom.common.JIException: Service Logon Failure
          at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149)
          Caused: java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140)
          Caused: java.lang.reflect.UndeclaredThrowableException
          at com.sun.proxy.$Proxy94.start(Unknown Source)
          at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:342)
          at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64)
          at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:248)
          Caused: java.lang.RuntimeException
          at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:268)
          at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:262)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          
          

           

          Show
          phopkins101 Peter Hopkins added a comment -   Managed to make this occur, not sure if this helps debug / resolve the issue. On a windows 10 slave that was working, I turned on auto logon so my admin user would logon automatically at boot time. Once I did this the same issue above started happening. To which .\username and hostname\username could not rectify the issue. I also disabled auto login and the problem still persists. I will likely build the slave up from scratch again. Server: Jenkins:lts docker image, ver 2.73.2, jdk8+ Client Windows 10, jdk8+  [ts-syd-01] Starting Virtual Machine... [ts-syd-01] VM already powered on [ts-syd-01] Waiting for VMTools [ts-syd-01] VM Tools are running [ts-syd-01] Finished wait for VMTools [ts-syd-01] Waiting for 10 seconds before asking hudson.os.windows.ManagedWindowsServiceLauncher@6b5f20e to launch slave. [ts-syd-01] Asking ManagedWindowsServiceLauncher to launch slave. [2018-01-31 07:34:34] [windows-slaves] Connecting to 10.7.65.217 Checking if Java exists java -version returned 1.8.0. [2018-01-31 07:34:42] [windows-slaves] Copying jenkins-slave.xml [2018-01-31 07:34:42] [windows-slaves] Copying slave.jar [2018-01-31 07:34:42] [windows-slaves] Starting the service [ts-syd-01] EXCEPTION while starting VM java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy94.start(Unknown Source) at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:342) at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64) at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:248) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:262) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140) ... 10 more Caused by: org.jinterop.dcom.common.JIException: Service Logon Failure at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149) ... 15 more ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins org.jinterop.dcom.common.JIException: Service Logon Failure at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149) Caused: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140) Caused: java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy94.start(Unknown Source) at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:342) at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64) at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:248) Caused: java.lang.RuntimeException at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:268) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:262) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748)  
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Peter Hopkins not sure they are the same. You one looks like a bug in vSphere Cloud Plugin

          Show
          oleg_nenashev Oleg Nenashev added a comment - Peter Hopkins not sure they are the same. You one looks like a bug in vSphere Cloud Plugin
          Hide
          1digerati Justin Corbett added a comment -

          Manually setting the log on credentials within the service itself directly on the Win 7 box fixed it for me.  Used the same creds, but when doing it manually Windows grants the Service Logon right to the user.

          Show
          1digerati Justin Corbett added a comment - Manually setting the log on credentials within the service itself directly on the Win 7 box fixed it for me.  Used the same creds, but when doing it manually Windows grants the Service Logon right to the user.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          This issue was resolved by Next Turn in Windows Service Wrapper 2.7.0: https://github.com/winsw/winsw/releases/tag/v2.7.0 . This version was integrated into Jenkins 2.248.

           

           

          Show
          oleg_nenashev Oleg Nenashev added a comment - This issue was resolved by Next Turn in Windows Service Wrapper 2.7.0:  https://github.com/winsw/winsw/releases/tag/v2.7.0  . This version was integrated into Jenkins 2.248.    

            People

            • Assignee:
              Unassigned
              Reporter:
              rico_bee Rico ZHANG
            • Votes:
              5 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: