Bug 1858855

Summary: Creating compute resources on IPV6 network does not fail gracefully
Product: Red Hat Satellite Reporter: Lai <ltran>
Component: Compute ResourcesAssignee: Tomer Brisker <tbrisker>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: lzap, mhulan, oprazak, pcreech, tbrisker
Target Milestone: 6.8.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-2.1.2.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:04:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Error screen ipv6 none

Description Lai 2020-07-20 15:14:42 UTC
Created attachment 1701773 [details]
Error screen ipv6

Description of problem:
I know that one of the requirements is that IPv6 doesn't support compute resources, but when you try to create one, it doesn't fail gracefully.

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

How reproducible:
100%

Steps to Reproduce:
1. Have all ipv6 connection setup.
2. Create proxy on firefox to access UI
3. Login on UI, Infrastructure -> Compute Resources
4. Select EC2 from dropdown menu and fill in all necessary info
5. Click submit.

Actual results:
Oops, we're sorry but something went wrong Network is unreachable - connect(2) for <ip> (Errno::ENETUNREACH)

Expected results:
At least stay on satellite with a better error message.

Additional info:
Any compute resources provider fails the same way.  Is there a way we make this error handle better on the UI?

Comment 2 Tomer Brisker 2020-08-25 09:26:03 UTC
Created redmine issue https://projects.theforeman.org/issues/30706 from this bug

Comment 4 Lukas Zapletal 2020-09-01 09:22:46 UTC
So I have created a script to see what exactly fog-aws connects to. It looks like it uses DNS query, depending on region the hostname is for example ec2.us-west-2.amazonaws.com but this hostname does not appear to have AAAA record. Thus this will never work on IPv6.

https://mxtoolbox.com/SuperTool.aspx?action=aaaa%3aec2.us-west-2.amazonaws.com&run=toolpage

require 'fog/aws'
require 'json'
require 'excon'
require 'httplog' # require this *after* your HTTP gem of choice
Excon.defaults.merge!(:debug_request => true, :debug_response => true)
HttpLog.configure do |config|
  # Enable or disable all logging
  config.enabled = true
  # You can assign a different logger or method to call on that logger
  config.logger = Logger.new($stdout)
  config.logger_method = :log
  # I really wouldn't change this...
  config.severity = Logger::Severity::INFO
  # Tweak which parts of the HTTP cycle to log...
  config.log_connect   = true
  config.log_request   = true
  config.log_headers   = true
  config.log_data      = true
  config.log_status    = true
  config.log_response  = true
  config.log_benchmark = true
end
ec2 = Fog::Compute.new :provider => 'AWS', :region => 'us-west-2', :aws_access_key_id => "xxxx", :aws_secret_access_key => "yyyy"
ec2.unmonitor_instances(:test)

Comment 6 Bryan Kearney 2020-09-01 12:06:23 UTC
Upstream bug assigned to tbrisker

Comment 7 Bryan Kearney 2020-09-01 12:06:26 UTC
Upstream bug assigned to tbrisker

Comment 8 Bryan Kearney 2020-09-01 16:06:28 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30706 has been resolved.

Comment 11 Lukáš Hellebrandt 2020-09-23 10:33:35 UTC
Verified with Sat 6.8 snap 16.

Used reproducer from OP. After clicking Submit, I got a pop-up message saying "Error while trying to create resource: getaddrinfo: Name or service not known (SocketError)" which is expected.
Furthermore, after clicking Load, I get "Unable to save getaddrinfo: Name or service not known (SocketError)".
With Hammer:
# hammer compute-resource create --name ec2-3 --provider ec2 --user <access-key> --password <secret-key> --region us-west-2
Could not create the compute resource:
  getaddrinfo: Name or service not known (SocketError)

Comment 14 errata-xmlrpc 2020-10-27 13:04:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4366