Unable to retrieve metada

Unable to sync the centos 8.4 repositories. Getting an error saying unable to retrieve meta data

Expected outcome:
Should be able to sync the repository
Foreman and Proxy versions:
Distribution and version:
RHEL 7.7
Other relevant data:
I am using ansible playbook for creating a product and syncing of the repository. When I run the play book, I am getting this error

This is my playbook

    - name: "Create repository"
        username: "admin"
        password: "admin"
        server_url: "https://myhost.com"
        name: "{{ item }}"
        state: present
        content_type: "yum"
        product: "{{ Product }}"
        organization: "Test Organization"
        url: "https://vault.centos.org/8.1.1911/AppStream/x86_64/os/"
        mirror_on_sync: true
        download_policy: immediate

    - name: "Sync repository"
        username: "admin"
        password: "admin"
        server_url: "https://myhost.com"
        repository: "AppStream"
        product: "{{ Product }}"
        organization: "Test Organization"

Hi @almond,

Can you check if you can curl the repository (https://vault.centos.org/8.1.1911/AppStream/x86_64/os/repodata/repomd.xml)

Also, are you using an http proxy?


Yes I am using an http proxy that is defined in my foreman @Dewar

Also, I tried it with different repo Index of /vault/8.3/BaseOS/Source/

And still I am facing the same issue

Were you able to curl the above: https://vault.centos.org/8.1.1911/AppStream/x86_64/os/repodata/repomd.xml

From within your server terminal?

Yes,curl is working fine @Dewar

Apparently the same thing is working on our test server. But not in this machine. @Dewar

Double check the http proxy configuration and make sure that the proxy is either set properly for the given repository or set as a global default. ‘A connection error’ sounds like a firewall/proxy issue. You might also check ‘journalctl -u pulpcore-worker@*’ to get more information about the connection error (although i doubt you’ll see much more).

No issues with http_proxy
Only this can be found inside the log

journalctl -u pulpcore-worker@*
 pulpcore-worker-1[12147]: pulp: rq.worker:INFO: Cleaning registries for queue

Changing the URL from https to http did the trick.