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

Oracle is not launching due to "ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • None

      I have set up the oracle-cloud-infrastructure-compute plugin. The instances is launched in Oracle cloud, no errors are shown in the Jenkins log. However, the node fails to connect due to:

      ```

      Connecting to ssh: ubuntu@140.238.88.34:22
      Authenticating with private key
      No init script to copy to remote agent
      Verifying that Java is installed
      openjdk full version "1.8.0_342-8u342-b07-0ubuntu1~20.04-b07"
      Deleting remote slave.jar if it exists prior to copy [sudo rm -f /home/ubuntu/slave.jar]
      Copying slave.jar to remote agent using scp
      Launching Agent (via Trilead SSH2 Connection): sudo chown ubuntu /home/ubuntu/slave.jar && sudo -u ubuntu java -jar /home/ubuntu/slave.jar
      Remote Agent has terminated with exit code: 1
      Closing SSH Session to: 140.238.88.34
      FATAL: Failed to launch Agent
      Closing SSH Connection to
      FATAL: SSH Agent launch failed on: ubuntu@140.238.88.34:22
      ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
      Also:   java.lang.Throwable: launched here
          at hudson.slaves.SlaveComputer._connect(SlaveComputer.java:287)
          at hudson.model.Computer.connect(Computer.java:445)
          at hudson.slaves.CloudRetentionStrategy.start(CloudRetentionStrategy.java:75)
          at hudson.slaves.CloudRetentionStrategy.start(CloudRetentionStrategy.java:45)
          at hudson.model.AbstractCIBase.createNewComputerForNode(AbstractCIBase.java:180)
          at hudson.model.AbstractCIBase.updateNewComputer(AbstractCIBase.java:222)
          at jenkins.model.Jenkins.updateNewComputer(Jenkins.java:1668)
          at jenkins.model.Nodes.addNode(Nodes.java:146)
          at jenkins.model.Jenkins.addNode(Jenkins.java:2210)
          at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:248)
          at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:823)
          at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:94)
          at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:69)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
          at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)
      java.io.EOFException: unexpected stream termination
          at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:459)
          at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:404)
          at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:437)
          at com.oracle.cloud.baremetal.jenkins.ssh.SshComputerLauncher.launchAgent(SshComputerLauncher.java:285)
          at com.oracle.cloud.baremetal.jenkins.ssh.SshComputerLauncher.launch(SshComputerLauncher.java:98)
          at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:48)
          at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:82)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)

      ```

      Here's the Oracle cloud config from jcasc (with some values removed):

      ```

      • baremetal:
        cloudName: "oracle"
        credentialsId: "oracle"
        instanceCapStr: "1"
        maxAsyncThreads: "50"
        nextTemplateId: 1
        templates:
      • assignPublicIP: true
        autoImageUpdate: false
        availableDomain: "TGmT:UK-LONDON-1-AD-3"
        compartmentId: "ocid1.tenancy.oc1.."
        doNotDisable: false
        exportJenkinsEnvVars: false
        idleTerminationMinutes: "30"
        imageCompartmentId: "ocid1.tenancy.oc1.."
        imageId: "ocid1.image.oc1.uk-london-1."
        initScriptTimeoutSeconds: 120
        jenkinsAgentUser: "ubuntu"
        labelString: "oracle-amd64"
        mode: EXCLUSIVE
        numExecutors: 1
        remoteFS: "/home/ubuntu"
        retryTimeoutMins: 10
        shape: "VM.Standard.E2.1.Micro"
        sshConnectTimeoutSeconds: "900"
        sshCredentialsId: "oracle-key"
        startTimeoutSeconds: "900"
        stopOnIdle: false
        subnetCompartmentId: "ocid1.tenancy.oc1.."
        subnetId: "ocid1.subnet.oc1.uk-london-1."
        templateId: 0
        usePublicIP: true
        vcnCompartmentId: "ocid1.tenancy.oc1.."
        vcnId: "ocid1.vcn.oc1.uk-london-1."
        ```

            sindhusri16 Yarlagadda Sindhu Sri
            cockers_97 Andrew Cockerill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: