Bug 1331553 - Detect Undercloud error message not very helpful
Summary: Detect Undercloud error message not very helpful
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: fusor-server
Version: 1.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: John Matthews
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks: qci-sprint-17
TreeView+ depends on / blocked
 
Reported: 2016-04-28 19:16 UTC by Tasos Papaioannou
Modified: 2019-02-25 17:28 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-25 17:28:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1255394 0 unspecified CLOSED Undercloud services should be able to listen on the public / external network too 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1255412 0 unspecified CLOSED RHCI currently requires routable access to the OSP undercloud's provisioning nice. It shouldn't. 2021-02-22 00:41:40 UTC

Internal Links: 1255394 1255412

Description Tasos Papaioannou 2016-04-28 19:16:51 UTC
Description of problem:

If I try to detect the undercloud from a new deployment, and the undercloud director's httpd service is down for some reason, then I get the error message:

"Error: The Undercloud is not accessible. Please check that the address specified is your Undercloud's provisioning interface, you have logged in and run fusor-undercloud-installer on the Undercloud, and that it can be reached by your RHCI server."

This error message is given *after* the fusor server has *successfully* ssh'ed to the undercloud, but it then fails to connect to port 80 on the undercloud. This error message should specify that connectivity to httpd is the problem.


Version-Release number of selected component (if applicable):

QCI-1.1-RHEL-7-20160428.t.0

How reproducible:

100%

Steps to Reproduce:
1.) Stop httpd service on undercloud.
2.) Verify ssh connectivity from fusor to undercloud.
3.) See unhelpful error message when trying to detect undercloud from new deployment.

Actual results:

Error message suggests steps that have all been done.

Expected results:

Error message specifies that SSH was successful, but pinging TCP port 80 failed.



Additional info:

Relevant code is in:

./fusor_server-0.0.1/app/controllers/fusor/api/openstack/underclouds_controller.rb:

        def create
          underhost = params[:underhost]
          underuser = params[:underuser]
          underpass = params[:underpass]

          ssh = Egon::Undercloud::SSHConnection.new(underhost, underuser, underpass)
          io = StringIO.new
          ssh.execute("sudo hiera admin_password", io)
          admin = io.string.strip
          if admin.include?('failed') || admin.include?('error') || admin.include?('fingerprint')
            render json: {errors: admin}, status: 422
          else
            io = StringIO.new
            ssh.execute("sudo hiera controller_host", io)
            ip_addr = io.string.strip

            # This is deplorable, but the undercloud services only listen on the
            # provisioning network, which may or may not be accessible from here.
            # See if it is, and if not then throw an error saying so and suggesting
            # a possible workaround.
            # See bug https://bugzilla.redhat.com/show_bug.cgi?id=1255412
            routable = tcp_pingable?(ip_addr)
            if !routable
              render(json: {errors: "Error: The Undercloud is not accessible. Please check that the address specified"\
                     " is your Undercloud's provisioning interface, you have logged in and run fusor-undercloud-installer"\
                     " on the Undercloud, and that it can be reached by your RHCI server."}, status: 422)
              #system('sudo route add ' + ip_addr + ' via ' + underhost)

[...]

        def tcp_pingable?(ip)
          # This code is from net-ping, and stripped down for use here
          # We don't need all the ldap dependencies net-ping brings in

          @service_check = true
          @port          = 80
          @timeout       = 1
          @exception     = nil
          bool           = false
          tcp            = nil

          begin
            Timeout.timeout(@timeout) do
              begin
                tcp = TCPSocket.new(ip, @port)
              rescue Errno::ECONNREFUSED => err
                if @service_check
                  bool = false
                else
                  @exception = err
                end
              rescue StandardError => err
                @exception = err
              else
                bool = true
              end
            end
          rescue Timeout::Error => err
            @exception = err
          ensure
            tcp.close if tcp
          end

          bool
        end
      end
    end
  end
end

Comment 2 Sudhir Mallamprabhakara 2019-02-25 17:28:57 UTC
QCI has sunset. Closing the BZ's


Note You need to log in before you can comment on or make changes to this bug.