After updgrade foreman 2.3 to 2.4 at the time of package installation shows Error: Failed to download metadata for repo: Cannot download repomd.xml: All mirrors were tried

Problem:
Error: Failed to download metadata for repo ‘OS_RHEL-8_RHEL-8-BaseOS’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

For all repo like as, RHEL 8,7,6

For more details please see the attached log,
ketello.log (2.5 MB)

Expected outcome:

Foreman and Proxy versions:
Foreman-2.4.0-el7
foreman-proxy-2.4.0

Foreman and Proxy plugin versions:
2.4.0

Distribution and version:
CentOS Linux 7.9.2009
kernel-3.10.0-1160

Other relevant data:

2021-06-02 18:47:44 [INFO ] [post] Executing hooks in group post
2021-06-02 18:47:44 [DEBUG ] [root] Executing: foreman-rake upgrade:run
2021-06-02 18:48:03 [DEBUG ] [root] =============================================
2021-06-02 18:48:03 [DEBUG ] [root] Upgrade Step 1/4: katello:correct_repositories. This may take a long while.
2021-06-02 18:48:03 [DEBUG ] [root] Processing Repository 1/40: RHEL-6-REPO (1)
2021-06-02 18:48:03 [DEBUG ] [root] Failed upgrade task: katello:correct_repositories, see logs for more information.
2021-06-02 18:48:03 [DEBUG ] [root] =============================================
2021-06-02 18:48:03 [DEBUG ] [root] Upgrade Step 2/4: katello:correct_puppet_environments. This may take a long while.
2021-06-02 18:48:03 [DEBUG ] [root] Processing Puppet Environment 1/6: 1-RHEL-6_Content-v11_0-puppet-b1743510-cfd3-4234-8c0c-a4317cc2372f (73)
2021-06-02 18:48:03 [DEBUG ] [root] Failed upgrade task: katello:correct_puppet_environments, see logs for more information.
2021-06-02 18:48:03 [DEBUG ] [root] =============================================
2021-06-02 18:48:03 [DEBUG ] [root] Upgrade Step 3/4: katello:clean_backend_objects. This may take a long while.
2021-06-02 18:48:03 [DEBUG ] [root] 0 orphaned consumer id(s) found in candlepin.
2021-06-02 18:48:03 [DEBUG ] [root] Candlepin orphaned consumers:
2021-06-02 18:48:03 [DEBUG ] [root] =============================================
2021-06-02 18:48:03 [DEBUG ] [root] Upgrade Step 4/4: katello:upgrades:4.0:remove_ostree_puppet_content.
2021-06-02 18:48:03 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/30-upgrade.rb returned nil
2021-06-02 18:48:03 [DEBUG ] [post] cdn_ssl_version already migrated, skipping
2021-06-02 18:48:03 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/31-cdn_setting.rb returned true
2021-06-02 18:48:03 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/34-pulpcore_directory_layout.rb returned nil
2021-06-02 18:48:03 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-post_install_message.rb returned nil
2021-06-02 18:48:03 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-version_locking.rb returned nil
2021-06-02 18:48:03 [INFO ] [post] All hooks in group post finished
2021-06-02 18:48:03 [DEBUG ] [root] Exit with status code: 2 (signal was 2)
2021-06-02 18:48:03 [DEBUG ] [root] Cleaning /tmp/kafo_installation20210602-19025-1evbsv5
2021-06-02 18:48:03 [DEBUG ] [root] Cleaning /tmp/kafo_installation20210602-19025-7w2hza
2021-06-02 18:48:03 [DEBUG ] [root] Cleaning /tmp/default_values.yaml
2021-06-02 18:48:03 [DEBUG ] [root] Installer finished in 917.601735831 seconds