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

New permanent agent using incorrect Docker launch details fails with NoStaplerConstructorException

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • docker-plugin
    • None
    • Newest version of the plugin

      Reproduction steps:
      // I ran it with mvn hpi:run with the newest version of the docker plugin

      • from Jenkins dashboard, click 'Build Executor Status'
      • click ‘New Node’ button
      • name it anything, click ‘Permanent Agent’ option
      • I put the remote root directory as /tmp and left everything else as is
      • click ‘Save' and boom, angry Jenkins

      Theory:

      • it is due to the launch method ‘Docker variant of Launch agents via SSH awith SSH key injection’ - does not fail gracefully when given incorrect details
      • I played with leaving the host empty and typing in something, and either way got the same stack trace

      Stack trace is attached.

          [JENKINS-73553] New permanent agent using incorrect Docker launch details fails with NoStaplerConstructorException

          Julie Heard added a comment - - edited

          Julie Heard added a comment - - edited It may be related to this PR https://github.com/jenkinsci/docker-plugin/pull/835/files

          Jesse Glick added a comment -

          For reference:

          NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class io.jenkins.docker.connector.DockerComputerSSHConnector$InjectKeySSHLauncher
          

          https://github.com/jenkinsci/docker-plugin/commit/d342195d1107bb7c69a0084dae855c2b5362017a originally. If I follow the history, the real problem is that the Credentials API is overused and made mandatory even for cases where it is more harmful than helpful. And here I think the docker-plugin is attempting to let you enter an SSH private key directly rather than going through Credentials, which clashes with what the SSH Agents plugin expects.

          Jesse Glick added a comment - For reference: NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class io.jenkins.docker.connector.DockerComputerSSHConnector$InjectKeySSHLauncher https://github.com/jenkinsci/docker-plugin/commit/d342195d1107bb7c69a0084dae855c2b5362017a originally. If I follow the history, the real problem is that the Credentials API is overused and made mandatory even for cases where it is more harmful than helpful. And here I think the docker-plugin is attempting to let you enter an SSH private key directly rather than going through Credentials, which clashes with what the SSH Agents plugin expects.

          Jesse Glick added a comment -

          BTW I am not sure if this plugin has a maintainer, and if so, which issue tracker is used, since https://github.com/jenkinsci/docker-plugin/issues is also open.

          Jesse Glick added a comment - BTW I am not sure if this plugin has a maintainer, and if so, which issue tracker is used, since https://github.com/jenkinsci/docker-plugin/issues is also open.

            Unassigned Unassigned
            julieheard Julie Heard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: