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

Jenkins agent connection terminates with agents that 'Launch agent by connecting it to the controller'

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • core
    • None
    • Jenkins: 2.319.3
    • 2.332.1

      Jenkins service is terminating when trying to add agents when using Launch agent by connecting it to the controller

          [JENKINS-67881] Jenkins agent connection terminates with agents that 'Launch agent by connecting it to the controller'

          Hello markewaite, did you see any similar issues?

          Shanmukha Gajula added a comment - Hello  markewaite , did you see any similar issues?

          Mark Waite added a comment -

          1996phani based on the screenshot of a Java Web Start window for Jenkins, I assume that the thing that is terminating is the connection between the controller and the agent. The screenshot indicates to me that the Java Web Start window is running on the desktop, not running as a Windows service. The screenshot also indicates that the Jenkins controller is still running, because it is displaying a stack trace.

          Based on those two assumptions, this is a duplicate of JENKINS-67000. The workaround is to switch from using Java Web Start to instead start the agent from a batch file or Powershell script on the agent computer. The fix will be included in Jenkins 2.332.1, scheduled to release March 9, 2022. If you'd like to test the fix earlier, you could test the fix in Jenkins 2.335 or 2.336.

          Mark Waite added a comment - 1996phani based on the screenshot of a Java Web Start window for Jenkins, I assume that the thing that is terminating is the connection between the controller and the agent. The screenshot indicates to me that the Java Web Start window is running on the desktop, not running as a Windows service. The screenshot also indicates that the Jenkins controller is still running, because it is displaying a stack trace. Based on those two assumptions, this is a duplicate of JENKINS-67000 . The workaround is to switch from using Java Web Start to instead start the agent from a batch file or Powershell script on the agent computer. The fix will be included in Jenkins 2.332.1, scheduled to release March 9, 2022. If you'd like to test the fix earlier, you could test the fix in Jenkins 2.335 or 2.336.

          Thank you so much markewaite. Yes, it is a duplicate of JENKINS-67000.

          I will follow that thread.

          Shanmukha Gajula added a comment - Thank you so much markewaite . Yes, it is a duplicate of  JENKINS-67000 . I will follow that thread.

          Shanmukha Gajula added a comment - - edited

          Hi markewaite Thanks for the help, I have tested this in 2.336 it is working fine but I have an observation (both in 2.336 and 2.319.3 LTS ) where Run from the agent command line is giving some symbols in the URL

          for example instead of the '_' symbol it is giving %5F in the URL so while copy-pasting it is throwing me an error in CMD. and I have to manually replace that %5F with the '_' symbol. Not sure if this change is intentional. but if it is not intentional this can avoid such issues.

           

          Shanmukha Gajula added a comment - - edited Hi markewaite Thanks for the help, I have tested this in 2.336 it is working fine but I have an observation (both in 2.336 and 2.319.3 LTS ) where Run from the agent command line is giving some symbols in the URL for example instead of the '_ ' symbol it is giving %5F in the URL so while copy-pasting it is throwing me an error in CMD. and I have to manually replace that %5F with the ' _' symbol. Not sure if this change is intentional. but if it is not intentional this can avoid such issues.  

          Mark Waite added a comment -

          Closing as a duplicate of JENKINS-67000.

          Mark Waite added a comment - Closing as a duplicate of JENKINS-67000 .

          Mark Waite added a comment -

          That is a URL encoded character (as far as I understand it). Unfortunately, URL encoding uses the '%' character which can sometimes be treated as a special character by cmd.exe. Simplest solution is to not use characters in your agent name that require encoding. If that won't work, then try surrounding the URL with single quotes or possibly with double quotes.

          Mark Waite added a comment - That is a URL encoded character (as far as I understand it). Unfortunately, URL encoding uses the '%' character which can sometimes be treated as a special character by cmd.exe. Simplest solution is to not use characters in your agent name that require encoding. If that won't work, then try surrounding the URL with single quotes or possibly with double quotes.

          markewaite I agree, but this is not an issue in earlier versions like Jenkins 2.277.3

          Shanmukha Gajula added a comment - markewaite I agree, but this is not an issue in earlier versions like  Jenkins 2.277.3

            navneetlalg Navneet Lal Gupta
            1996phani Shanmukha Gajula
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: