yum/dnf exits with "Error: Failed to synchronize cache for repo 'xxx'" without further details

Solution Unverified - Updated -

Issue

  • Executing a yum or dnf command fails in error, as in the example below

    # dnf repolist
    [...]
    Error: Failed to synchronize cache for repo 'XXX'
    
  • Log file /var/log/dnf.log shows a Python backtrace

    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 566, in load
        ret = self._repo.load()
      File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 503, in load
        return _repo.Repo_load(self)
    RuntimeError: Failed to synchronize cache for repo 'XXX'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
        return _main(base, args, cli_class, option_parser_class)
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
        return cli_run(cli, base)
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
        cli.run()
      File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1124, in run
        self._process_demands()
      File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 828, in _process_demands
        load_available_repos=self.demands.available_repos)
      File "/usr/lib/python3.6/site-packages/dnf/base.py", line 400, in fill_sack
        self._add_repo_to_sack(r)
      File "/usr/lib/python3.6/site-packages/dnf/base.py", line 135, in _add_repo_to_sack
        repo.load()
      File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 568, in load
        raise dnf.exceptions.RepoError(str(e))
    dnf.exceptions.RepoError: Failed to synchronize cache for repo 'XXX'
    2019-05-24T09:45:02Z CRITICAL Error: Failed to synchronize cache for repo 'XXX'
    

Environment

  • Red Hat Enterprise Linux 8
  • yum / dnf

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content