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

Logging for Remote FS root during EC2 instance launch



    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • ec2-plugin
    • None
    • Jenkins 2.254
      EC2 Plugin 1.51
      Running in Amazon on Ubuntu 18.04



      When using the EC2 Plugin to launch instances in cloud, "Configure Cloud", I encountered a situation where it was perpetually starting and stopping instances without success. See snippet from log file, below.

      Eventually I discovered the reason.

      The configured "Remote FS root" was set to "/jenkins" for this cloud. However, the user didn't have permissions in the / directory to create the folder "/jenkins". I resolved it by pre-creating the "/jenkins" directory with the right permissions in the AMI. Of course, another solution could be to choose the user's home directory for their "Remote FS root" .

      Proposed change:

      The log file should clearly say something like "Failed to create Remote FS root /jenkins", on it's own separate line of the log file.  Currently the jenkins log does not indicate the reason for the failure. It's mysterious.

      Please improve the logging somehow. 

      If necessary, run an extra "check" during the startup of an instance, seeing if the Remote FS root exists and/or will be able to be created, and then log a failure. Similar to the "Verifying: java" section which is there now.   "Verifying: Remote FS root".     

      Or, simply make sure that when the directory is being created that any failure is propagated to the log file.

      2021-05-20 23:35:02.857+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Connected via SSH.
      2021-05-20 23:35:02.907+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Creating tmp directory (/tmp) if it does not exist
      2021-05-20 23:35:06.005+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Verifying: java -fullversion
      2021-05-20 23:35:08.134+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Verifying: which scp
      2021-05-20 23:35:08.138+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Copying remoting.jar to: /tmp
      2021-05-20 23:35:08.265+0000 [id=41084] INFO hudson.plugins.ec2.EC2Cloud#log: Launching remoting agent (via Trilead SSH2 Connection): java -jar /tmp/remoting.jar -workDir /jenkins
      2021-05-20 23:35:13.966+0000 [id=41109] INFO h.plugins.ec2.EC2OndemandSlave#lambda$terminate$0: Terminated EC2 instance (terminated): i-052f70e33b072d0a9
      2021-05-20 23:35:13.967+0000 [id=41109] INFO h.plugins.ec2.EC2OndemandSlave#lambda$terminate$0: Removed EC2 instance from jenkins master: i-052f70e33b072d0a9



          There are no comments yet on this issue.


            thoulen FABRIZIO MANFREDI
            sdarwin Sam Darwin
            0 Vote for this issue
            1 Start watching this issue