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
Updated by Chris Roberts 4 months ago
- Category set to Repositories
- Status changed from New to Assigned
- Assignee set to William Clark
- Target version changed from Katello 4.15.0 to Katello 4.14.0
- Triaged changed from No to Yes
Updated by The Foreman Bot 3 months ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11100 added
Updated by William Clark 3 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|0f7c58fd9a1f9dd6ee34ea2c3ffd76f99c86fddc.