Project

General

Profile

Bug #2839

Openstack finish script fails to authenticate

Added by Ian Mordey almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
Difficulty:
easy
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Foreman 1.2.0 fails to authenticate via ssh for finish script and rolls back. I've tested this creating a Fedora 19 Host on Openstack Grizzly (from RDO). From the Fedora host logs I can see Foreman attempts to authenticate before the fedora user is actually created.

Reproduction:
1. Create new Fedora 19 Host through Foreman
2. Foreman provisions the host on Openstack
3. Foreman fails to authenticate
4. Foreman rolls back

Fix:
Add this to ssh.rb:
  • ssh.rb.old 2013-07-25 17:59:29.389244296 +0100
    --- ssh.rb 2013-07-25 18:00:23.041063187 +0100 *******
  • 89,98 **
    --- 89,102 ----
    retry
    rescue Net::SSH::ConnectionTimeout
    logger.debug "Host timed out for #{address}, retrying"
    sleep(2)
    retry
    + rescue Net::SSH::AuthenticationFailed
    + logger.debug "Auth failed.. retrying"
    + sleep(2)
    + retry
    rescue Timeout::Error
    retry
    rescue => e
    logger.debug "SSH error: #{e.message}\n " + e.backtrace.join("\n ")
    end

I'm not sure this is a good fix but it works for me..

Associated revisions

Revision f9d56555 (diff)
Added by Ian Mordey almost 6 years ago

Fixes #2839 - retry SSH authentication issues with cloud-init

Revision 0aa3893f (diff)
Added by Ian Mordey almost 6 years ago

Fixes #2839 - retry SSH authentication issues with cloud-init

(cherry picked from commit f9d5655583a9a9d0309fcd4bd19ac9b43021c7d1)

History

#1 Updated by Lukas Zapletal almost 6 years ago

  • Target version set to 1.3.0
  • Difficulty set to easy

Hey Ian, thanks for the patch. We will look on this.

#2 Updated by Dominic Cleal almost 6 years ago

  • Category changed from Host creation to Compute resources
  • Status changed from New to Ready For Testing

#3 Updated by Ian Mordey almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal almost 6 years ago

  • Target version changed from 1.3.0 to 1.2.1

Also available in: Atom PDF