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

Jenkins slave can't connect via ssh to GCE instance

      When setting up the GCE plugin, I'm unable to get the slave to connect properly. The logs show only an authentication error:

       

      Aug 13, 2018 2:44:45 PM null
      INFO: Connected via SSH.
      Aug 13, 2018 2:44:45 PM null
      WARNING: Authentication failed. Trying again...
      Aug 13, 2018 2:45:00 PM null
      INFO: Authenticating as jenkins
      Aug 13, 2018 2:45:00 PM null
      INFO: Connecting to 10.1.2.3 on port 22, with timeout 10000.
      Aug 13, 2018 2:45:00 PM null
      INFO: Connected via SSH.
      Aug 13, 2018 2:45:00 PM null
      WARNING: Authentication failed. Trying again...
      Aug 13, 2018 2:45:15 PM null
      INFO: Authenticating as jenkins
      Aug 13, 2018 2:45:15 PM null
      INFO: Connecting to 10.1.2.3 on port 22, with timeout 10000.
      Aug 13, 2018 2:45:16 PM null
      INFO: Connected via SSH.
      

      Eventually it throws a "bootstrapresult failed" error:

       

      Aug 13, 2018 2:50:36 PM null 
      WARNING: bootstrapresult failed
      

      I can't find any way to begin debugging this issue. The Google Cloud console shows that a new ssh key has been added to the metadata on the freshly provisioned instance, corresponding to the user that Jenkins will use, but I can't get any further logs from the system; logging into the freshly provisioned instance with a different user and examining /var/log/secure doesn't show any ssh login failures.

          [JENKINS-53017] Jenkins slave can't connect via ssh to GCE instance

          Is there any way I can debug this? The log output from the plugin is insufficient to work out why this is happening.

          Alexander O'Donovan-Jones added a comment - Is there any way I can debug this? The log output from the plugin is insufficient to work out why this is happening.

          I eventually traced this to a GCP image that was starting up with a readonly filesystem, resulting in the Google services not being initialised correctly. That said, it would be good to have more debugging information available (such as running the SSH connection in some form of verbose mode) to more quickly eliminate options.

          Alexander O'Donovan-Jones added a comment - I eventually traced this to a GCP image that was starting up with a readonly filesystem, resulting in the Google services not being initialised correctly. That said, it would be good to have more debugging information available (such as running the SSH connection in some form of verbose mode) to more quickly eliminate options.

          Rachel Yen added a comment -

          Hi Alexander,

          I agree we should probably have better SSH connection debugging information. We will definitely look into this as something to add onto. In the meantime, I will close this issue. 

           

          Thanks!

          Rachel Yen added a comment - Hi Alexander, I agree we should probably have better SSH connection debugging information. We will definitely look into this as something to add onto. In the meantime, I will close this issue.    Thanks!

          Rukeith Tseng added a comment -

          Why this issue been closed. Is it been solved? How to solve it?

          Rukeith Tseng added a comment - Why this issue been closed. Is it been solved? How to solve it?

          Rachel Yen added a comment -

          We haven't heard back about this issue in a while and we're migrating to https://github.com/jenkinsci/google-compute-engine-plugin/issues. Please file an issue there if you see fit. Thanks!

          Rachel Yen added a comment - We haven't heard back about this issue in a while and we're migrating to https://github.com/jenkinsci/google-compute-engine-plugin/issues.  Please file an issue there if you see fit. Thanks!

            zombiemoose Rachel Yen
            alexandernc Alexander O'Donovan-Jones
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: