Repository sync fails with the error 'RPM1004: Error retrieving metadata: A connection error occurred' on Satellite 6 server.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • While trying to sync repositories on Satellite, it fails withRPM1004: Error retrieving metadata: A connection error occurred.

  • Red Hat Satellite 6 installed with proxy fails with below connection tests:

      #nc -v -w 5 cdn.redhat.com 443 
      Ncat: Version 6.40 ( http://nmap.org/ncat )
      Ncat: Connection timed out.
    
      #nc -v -w 5 subscription.rhsm.redhat.com 443 
      Ncat: Version 6.40 ( http://nmap.org/ncat )
      Ncat: Connection timed out.
    
      #nc -v -w 5 --proxy PROXY URL:PROXY PORT cdn.redhat.com 443 
      Ncat: Version 6.40 ( http://nmap.org/ncat )
      Ncat: Proxy returned status code 503.
    
      #nc -v -w 5 --proxy PROXY URL:PROXY PORT subscription.rhsm.redhat.com 443
      Ncat: Version 6.40 ( http://nmap.org/ncat )
      Ncat: Proxy returned status code 503.
    
  • While trying to sync the repositories on Red Hat Satellite, below error has been observed in the Red Hat Satellite WebUI -> Monitor -> Tasks -> Synchronize repository Task :

    result: 
    error:
      code: RPM1004
      data:
        reason: Not Found
      description: 'Error retrieving metadata: Not Found'
      sub_errors: []
    

Resolution

  • Whitelist Satellite server IP in the proxy.

  • If the Satellite server was upgraded, or any changes made in proxy, then ensure the same is reflecting in the below configuration files.

    # cat /etc/foreman-installer/scenarios.d/satellite-answers.yaml | grep proxy
    # cat /etc/rhsm/rhsm.conf | grep proxy
    
  • In order to update proxy information on Satellite server, follow Configuring Satellite Server with an HTTP Proxy.

  • Make sure the URL is correct for Red Hat CDN URL on Satellite Web UI under the below path:

    • Satellite WebUI -> Content -> Subscriptions -> Manage Manifest

    NOTE: For connected Satellite the correct URL is https://cdn.redhat.com

  • Make sure there is no entry added in /etc/hosts file for cdn.redhat.com

For Custom Repository

  • If there is a company wide firewall rule which does not allow SSL verification for custom repositories, disable SSL check for the repository(provided that the URL should allow non SSL download as well).

     Content --> Product --> Custom Product --> Custom Repository --> Verify SSL:NO
    
  • Verify the validity of root Certificate Authority (CA) certificate by running the following command from Satellite CLI against custom repository repomd.xml URL.

     # curl -v https://customrepo.example.com/pub/repos/yum/redhat/rhel-8-x86_64/repodata/repomd.xml
    
  • See the article for more information.

For more KB articles/solutions related to Red Hat Satellite 6.x Repository Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Repository Issues.

Root Cause

  • The Satellite server was not whitelisted in the proxy.
  • Incorrect Red Hat CDN URL mentioned on Manage Manifest page in Satellite WEB UI.
  • Manual entry added in /etc/hosts file for cdn.redhat.com

Diagnostic Steps

  • Test connection to the RHSM and CDN from Satellite server using a proxy:

      # nc -v -w 5 cdn.redhat.com 443 
     
      # nc -v -w 5 subscription.rhsm.redhat.com 443 
    
      # nc -v -w 5 --proxy PROXY URL:PROXY PORT cdn.redhat.com 443 
    
      # nc -v -w 5 --proxy PROXY URL:PROXY PORT subscription.rhsm.redhat.com 443
    
  • See the article for more information.

SBR
Product(s)
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.