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

Jenkins slave agent cannot be run as a service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core, remoting
    • Labels:
    • Environment:
      Jenkins v2.77 on Windows 7 with Oracle Java jre 1.8.0_144
    • Similar Issues:

      Description

      I just upgraded to Jenkins 2.77 on our Windows 7 VM. I have a Jenkins slave agent installed on another windows 7 VM. When I upgraded, the Jenkins web config UI also prompted me to disable 2 deprecated jnlp-2 protocols.However, now it is not possible to start the slave agent from a Windows service. I have to start it by clicking the Launch button in the Jenkins web UI.

      After I launched the slave from the web UI, I selected the option in the Java window to install the slave agent as a service. However, when I try to start the slave agent from the service, it says it's started but the Jenkins web UI indicates that it is not started.

      I've tried running the slave agent launch command from the command line, by using the command given in the Jenkins UI, and I got the errors indicated in the attached screenshot, relating to jnlp-2 protocol connect errors.  So there's a mismatch somewhere, if that command is still looking for the jnlp-2 protocol.

      I've also attached the slave.exe file.

       

        Attachments

          Issue Links

            Activity

            annetteso Annette Sohor created issue -
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Labels winsw
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Have you upgraded your Remoting (slave.jar) version as it suggested in the Remoting upgrade notice?

            https://jenkins.io/blog/2017/08/11/remoting-update/

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - Have you upgraded your Remoting (slave.jar) version as it suggested in the Remoting upgrade notice? https://jenkins.io/blog/2017/08/11/remoting-update/  
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ]
            oleg_nenashev Oleg Nenashev made changes -
            Component/s remoting [ 15489 ]
            Hide
            danielbeck Daniel Beck added a comment -

            The nature of this bug is unclear. The message says:

            If newer protocol versions are supported by all system components (agents, CLI and other clients), it is highly recommended to disable the deprecated protocols.

            This implies that agents may not support newer protocol versions.

            Show
            danielbeck Daniel Beck added a comment - The nature of this bug is unclear. The message says: If newer protocol versions are supported by all system components (agents, CLI and other clients), it is highly recommended to disable the deprecated protocols. This implies that agents may not support newer protocol versions.
            Hide
            danielbeck Daniel Beck added a comment -

            As to the followup problems, probably caused by long outdated slave.jar on the agent. VersionColumn Plugin would help understand whether that's the case.

            Show
            danielbeck Daniel Beck added a comment - As to the followup problems, probably caused by long outdated slave.jar on the agent. VersionColumn Plugin would help understand whether that's the case.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Daniel Beck It still needs some better UX. I am about pulling in Version Column plugin as Recommended plugin or integrating its features to the new detached Remoting Support plugin after 1.x.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck It still needs some better UX. I am about pulling in Version Column plugin as Recommended plugin or integrating its features to the new detached Remoting Support plugin after 1.x.
            Hide
            annetteso Annette Sohor added a comment -

            Thanks for your replies, Oleg and Daniel.

            I read the Remoting upgrade notice, but it's not clear to me exactly how I upgrade the slave.jar. Please can you advise how I should do it?

            Show
            annetteso Annette Sohor added a comment - Thanks for your replies, Oleg and Daniel. I read the Remoting upgrade notice, but it's not clear to me exactly how I upgrade the slave.jar. Please can you advise how I should do it?
            Hide
            annetteso Annette Sohor added a comment -

            I just upgraded to V2.78. Now the Jenkins web UI displays the following command to launch the slave agent from the command line, where it's now looking for a java file named agent.jar instead of slave.jar:

            java -jar agent.jar -jnlpUrl http://dslvm006.mul.ie.ibm.com:8080/computer/Curam_DOC_Production_Slave/slave-agent.jnlp -secret fedfd4cae9303a1afbd458f70b511b85bb0968e478a9d63d100ad7c4f2e10a61

            But I can't run the command because I cannot find the agent.jar file anywhere. Where can I get it from, please?

            Show
            annetteso Annette Sohor added a comment - I just upgraded to V2.78. Now the Jenkins web UI displays the following command to launch the slave agent from the command line, where it's now looking for a java file named agent.jar instead of slave.jar: java -jar agent.jar -jnlpUrl http://dslvm006.mul.ie.ibm.com:8080/computer/Curam_DOC_Production_Slave/slave-agent.jnlp -secret fedfd4cae9303a1afbd458f70b511b85bb0968e478a9d63d100ad7c4f2e10a61 But I can't run the command because I cannot find the agent.jar file anywhere. Where can I get it from, please?
            Hide
            danielbeck Daniel Beck added a comment -

            But I can't run the command because I cannot find the agent.jar file anywhere. Where can I get it from, please?

            Click on "agent.jar" on that line.

            Show
            danielbeck Daniel Beck added a comment - But I can't run the command because I cannot find the agent.jar file anywhere. Where can I get it from, please? Click on "agent.jar" on that line.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            There is an Windows Service Agent Upgrade Guide here: https://github.com/jenkinsci/windows-slave-installer-module#upgrading-old-agents . I will make sure it is posted on Jenkins.io or at least referenced from the blogpost and the upgrade guide

            Show
            oleg_nenashev Oleg Nenashev added a comment - There is an Windows Service Agent Upgrade Guide here: https://github.com/jenkinsci/windows-slave-installer-module#upgrading-old-agents . I will make sure it is posted on Jenkins.io or at least referenced from the blogpost and the upgrade guide
            Hide
            annetteso Annette Sohor added a comment - - edited

            Thanks Oleg.

            I upgraded to Jenkins 2.78 on the master while the slave was connected.

            I can see from the timestamp that jenkins-slave.exe was updated, but the slave.jar has not been updated since 2015. It probably needs to be updated?

            I can't see far back enough in the system log in the Jenkins web UI at this stage to see info about the upgrade.

            So, it looks like the slave update is not complete - do I need to do it manually?

            The slave agent runs fine if I start it by clicking the launch button in the UI, so I'm puzzled as to why I can't run it as a service. Installing it as a service from the Java slave agent window does not work. It installs the service, but starting the service does not start the slave agent.

            Show
            annetteso Annette Sohor added a comment - - edited Thanks Oleg. I upgraded to Jenkins 2.78 on the master while the slave was connected. I can see from the timestamp that jenkins-slave.exe was updated, but the slave.jar has not been updated since 2015. It probably needs to be updated? I can't see far back enough in the system log in the Jenkins web UI at this stage to see info about the upgrade. So, it looks like the slave update is not complete - do I need to do it manually? The slave agent runs fine if I start it by clicking the launch button in the UI, so I'm puzzled as to why I can't run it as a service. Installing it as a service from the Java slave agent window does not work. It installs the service, but starting the service does not start the slave agent.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            > So, it looks like the slave update is not complete - do I need to do it manually?

            Please see the upgrade guide referenced above. Yes, you need to do it manually

            > The slave agent runs fine if I start it by clicking the launch button in the UI, so I'm puzzled as to why I can't run it as a service. Installing it as a service from the Java slave agent window does not work. It installs the service, but starting the service does not start the slave agent.

            Is it the issue referenced in the ticket description or another one?

            Show
            oleg_nenashev Oleg Nenashev added a comment - > So, it looks like the slave update is not complete - do I need to do it manually? Please see the upgrade guide referenced above. Yes, you need to do it manually > The slave agent runs fine if I start it by clicking the launch button in the UI, so I'm puzzled as to why I can't run it as a service. Installing it as a service from the Java slave agent window does not work. It installs the service, but starting the service does not start the slave agent. Is it the issue referenced in the ticket description or another one?
            Hide
            annetteso Annette Sohor added a comment -

            Hi Oleg, yes I mentioned that installing the service from the Java slave agent window does not work in the 2nd para of my original description in this ticket:

            "After I launched the slave from the web UI, I selected the option in the Java window to install the slave agent as a service. However, when I try to start the slave agent from the service, it says it's started but the Jenkins web UI indicates that it is not started."

            Show
            annetteso Annette Sohor added a comment - Hi Oleg, yes I mentioned that installing the service from the Java slave agent window does not work in the 2nd para of my original description in this ticket: "After I launched the slave from the web UI, I selected the option in the Java window to install the slave agent as a service. However, when I try to start the slave agent from the service, it says it's started but the Jenkins web UI indicates that it is not started."
            Hide
            annetteso Annette Sohor added a comment -

            Hi, a colleague of mine managed to resolve this issue. The folder that the original slave agent was installed in was locked, so when we installed the new slave agent as a service from the Java window, it couldn't update the files correctly. We renamed the old C:\JK folder to allow the slave service to be installed correctly and create a new JK folder. The Jenkins slave service is working fine now.

            Show
            annetteso Annette Sohor added a comment - Hi, a colleague of mine managed to resolve this issue. The folder that the original slave agent was installed in was locked, so when we installed the new slave agent as a service from the Java window, it couldn't update the files correctly. We renamed the old C:\JK folder to allow the slave service to be installed correctly and create a new JK folder. The Jenkins slave service is working fine now.
            Hide
            annetteso Annette Sohor added a comment -

            See fix in my latest comment.

            Show
            annetteso Annette Sohor added a comment - See fix in my latest comment.
            annetteso Annette Sohor made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            danielbeck Daniel Beck made changes -
            Remote Link This issue links to "PR 3012 (Web Link)" [ 22547 ]

              People

              Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              annetteso Annette Sohor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: