Bug #37697
closed[DEV] When having connection issue, scan CDN always fail silently and return empty result which is hard to debug
Description
[DEV] When having connection issue, scan CDN always fail silently and return empty result which is hard to debug
Cloned from 16009677
Description of problem:
Scan CDN always fail silently when it encounter an error connecting to the Red Hat CDN for whatever reason, such as 403 forbidden and http proxy issue. It just return an empty result without any error. This makes it very hard to debug an issue when empty result is returned.
Steps to Reproduce:
1. In the Foreman, use firewall to block connection to 443 port to simulate the connection issue
firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -m tcp --dport=443 -j REJECT
2. Login to the Foreman web ui -> Content -> Red Hat Repositories page. Expand any repository set
Actual results:
No repositories available.
Expected results:
Should raise proper error
Additional info:
In 'app/lib/katello/util/cdn_var_substitutor.rb'
def find_substitutions(paths_with_substitutions)
to_resolve = paths_with_substitutions.select { |path| path.substitutable? }
resolved = paths_with_substitutions - to_resolve
return resolved if to_resolve.empty?
futures = to_resolve.map do |path_with_substitution|
Concurrent::Promises.future do
path_with_substitution.resolve_substitutions(@resource)
end
end
futures.each do |future|
begin
resolved << future.value <=============== Might need to use future.value! here so that exception can be raised
end
end
find_substitutions(resolved.compact.flatten)
end
DEV Tracker for https://issues.redhat.com/browse/SAT-8076
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1896209