No QR Code Displayed After Enablong 2FA

I’m using the Dockerised version of Nextcloud. I last pulled v22.2.10. It’s the regular docker-compose setup:

version: "3"

services:
  NCDatabase:
    image: mariadb:10.5.16
    container_name: nextcloud-db
    volumes:
      - NCMariaDB:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD
      - MYSQL_RANDOM_ROOT_PASSWORD
      - MYSQL_DATABASE
      - MYSQL_USER
      - MYSQL_PASSWORD
    restart: always

  NCFrontend:
    image: nextcloud:latest
    container_name: nextcloud
    depends_on:
      - NCDatabase
    expose:
      - 80
    volumes:
      - NCData:/var/www/html
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=[URL]
      - LETSENCRYPT_HOST=[URL]
      - LETSENCRYPT_EMAIL=[EMAIL]
      - MYSQL_DATABASE
      - MYSQL_USER
      - MYSQL_PASSWORD
      - MYSQL_HOST
      - OVERWRITEPROTOCOL
    restart: always

volumes:
  NCMariaDB:
  NCData:

networks:
  default:
    external:
      name: nginx-reverse-proxy

Nextcloud version (eg, 20.0.5): 22.2.10
Operating system and version (eg, Ubuntu 20.04): Linux 4.18.0-277.el8.x86_64 x86_64
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): 8.0.21

The issue you are facing:

After enabling 2FA, I’m unable to see any QR codes as explained in the docs here.

Is this the first time you’ve seen this error? (Y/N): y

Steps to replicate it:

  1. Enable 2FA under Settings > Administration > Security,
  2. Go to Settings > Personal > Security,
  3. Observe that there is no QR code generated under the 2FA title.

The output of your Nextcloud log in Admin > Logging:

Level	App	Message		Time
Error	notifications	Swift_TransportException: Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused)	
2022-08-15T08:53:02+0200
Warning	core	Login failed: 'can' (Remote IP: '185.39.64.5')	
2022-08-08T09:12:22+0200
Warning	core	Login failed: 'can' (Remote IP: '185.39.64.5')	
2022-08-08T09:12:21+0200
Error	no app in context	Swift_TransportException: Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused)	
2022-08-06T21:31:37+0200
Error	index	OCP\Files\NotPermittedException: Could not create folder	
2022-08-06T21:29:07+0200
Warning	no app in context	Could not detect any host in http:///data/htaccesstest.txt	
2022-08-06T21:28:16+0200
Warning	no app in context	Could not detect any host in https:///data/htaccesstest.txt	
2022-08-06T21:28:16+0200
Warning	no app in context	Could not detect any host in http:///data/htaccesstest.txt	
2022-08-06T21:25:38+0200
Warning	no app in context	Could not detect any host in https:///data/htaccesstest.txt