Redis backend errors due to incorrect aioredis version dependency

Bug #1982979 reported by Thomas Pike
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postfix-mta-sts-resolver (Ubuntu)
New
Undecided
Unassigned

Bug Description

Attempting to enable the redis backend of postfix-mta-sts-resolver with eg. the following config:

$ cat /etc/mta-sts-daemon.yml
cache:
  type: redis
  options:
    url: 'redis://127.0.0.1:6379/0'

results in this error:

  Traceback (most recent call last):
    File "/usr/bin/mta-sts-daemon", line 33, in <module>
      sys.exit(load_entry_point('postfix-mta-sts-resolver==1.1.2', 'console_scripts', 'mta-sts-daemon')())
    File "/usr/lib/python3/dist-packages/postfix_mta_sts_resolver/daemon.py", line 123, in main
      evloop.run_until_complete(amain(cfg, evloop))
    File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
    File "/usr/lib/python3/dist-packages/postfix_mta_sts_resolver/daemon.py", line 65, in amain
      await cache.setup()
    File "/usr/lib/python3/dist-packages/postfix_mta_sts_resolver/redis_cache.py", line 40, in setup
      self._pool = aioredis.from_url(url, **opts)
   AttributeError: module 'aioredis' has no attribute 'from_url'

From version 1.1.0 to 1.1.2 of postfix-mta-sts-resolver, redis support requires aioredis v2 (source: https://github.com/Snawoot/postfix-mta-sts-resolver/releases), however the only available version of python3-aioredis in Ubuntu 22.04 is 1.3.1-2. This would appear to be the cause of the error.

$ lsb_release -rd
Description: Ubuntu 22.04 LTS
Release: 22.04

$ apt-cache policy postfix-mta-sts-resolver
postfix-mta-sts-resolver:
  Installed: 1.1.2-1
  Candidate: 1.1.2-1
  Version table:
 *** 1.1.2-1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

Expected result: working redis backend
Actual result: python stacktrace error as detailed above and service fails to start

The functionality worked fine in Ubuntu 20.04 (though the config file options required were slightly different for that version of postfix-mta-sts-resolver).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.