Custom Repository sync fails with an error 'RPM1004: Error retrieving metadata: A connection error occurred' on Satellite 6 server.
Environment
- Red Hat Satellite 6.x
Issue
-
Red Hat repositories are syncing with no error but repository from a
Custom productwhich areSSLbased are failing. -
While trying to sync
Third-partyrepositories onRed Hat Satellite, it fails withRPM1004: Error retrieving metadata: A connection error occurred.2021-10-13T21:07:03 [E|bac|] RPM1004: Error retrieving metadata: A connection error occurred (Katello::Errors::PulpError) -
Repository sync for a
Custom productbased onSSLandcertificatessigned byDST Root CA X3fails with the error given below:Oct 13 21:06:45 satellite pulp: nectar.downloaders.threaded:ERROR: Skipping requests to customrepo.example.com due to repeated connection failures: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618) -
Below error has been observed in the
Red Hat SatelliteGUI -> Monitor -> Tasks -> Sync task:RPM1004: Error retrieving metadata: A connection error occurred "error"=> {"code"=>"RPM1004", "data"=>{"reason"=>"A connection error occurred"}, "description"=>"Error retrieving metadata: A connection error occurred",
Resolution
-
Update the
ca-certificatespackage on aRed Hat Satelliteserver and remove theDST Root CA X3certificates fromTrust-Store. by following below steps.# yum --disableplugin=foreman-protector update ca-certificates # cp /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /root/ # perl -e 'while(<>){last if $_ =~ m/DST Root CA X3/;}print $_;while(<>){last if length($_)==1;print $_}' </etc/pki/tls/certs/ca-bundle.crt > /etc/pki/ca-trust/source/blacklist/DST_Root_CA_X3.pem # update-ca-trust extract -
Start syncing
Customrepository again throughRed Hat SatellitewebUI and check the progress.
For more KB articles/solutions related to Red Hat Satellite 6.x SSL Certificates Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x SSL Certificates Issues
Root Cause
- Validity of root
Certificate Authority(CA) certificate withCN = DST Root CA X3will be expire soon or already expired. - Refer to the article, which describes the issue in more detail.
Diagnostic Steps
-
To find out the server
certificatevalidity use belowcurlcommand with complete path ofCustomrepository.# curl -v https://customrepo.example.com/pub/repos/yum/redhat/rhel-8-x86_64/repodata/repomd.xml
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.