Slow response when getting all domains

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.11
How are you able to access your server: The webadmin
SSH

Describe your issue

There are some issues about a white screen when logging into the admin panel, such as White Screen Issue When Accessing YunoHost Admin Panel. I had the same issue and a comment there gave me some clues.

The issue happens when I go to the Domains page: the screen becomes blank, and no matter how many times I logout/login the admin panel remains blank. I looked in /var/log/yunohost/yunohost-api.log and saw the request for /domains/*/cert?full&locale=en took 410s: it looks like each domain is checked sequentially and times out after 10 seconds for the main domain and 20 seconds for subdomains. 20 subdomains, 410 seconds.

Going into each of them also takes a lot of time, ~40s.

I have listed the full log below, with actual domains elided for privacy. Maybe an interesting data point: I only actually use 2 of them, most are dormant

Share relevant logs or error messages

Accessing the list of domains:

2025-04-07 12:56:02,488 DEBUG    moulinette.actionsmap.process - processing action 'yunohost.domain.cert.status'
2025-04-07 12:56:12,507 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain rako.space, returning rako.space
2025-04-07 12:56:32,520 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain admin.rako.space, returning rako.space
2025-04-07 12:56:52,543 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d1.rako.space, returning rako.space
2025-04-07 12:57:12,559 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d2.rako.space, returning rako.space
2025-04-07 12:57:32,575 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d3.rako.space, returning rako.space
2025-04-07 12:57:52,590 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d4.rako.space, returning rako.space
2025-04-07 12:58:12,608 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d5.rako.space, returning rako.space
2025-04-07 12:58:32,622 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d6.rako.space, returning rako.space
2025-04-07 12:58:52,637 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d7.rako.space, returning rako.space
2025-04-07 12:59:12,656 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d8.rako.space, returning rako.space
2025-04-07 12:59:32,669 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d9.rako.space, returning rako.space
2025-04-07 12:59:52,685 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d10.rako.space, returning rako.space
2025-04-07 13:00:12,702 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d11.rako.space, returning rako.space
2025-04-07 13:00:32,715 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d12.rako.space, returning rako.space
2025-04-07 13:00:52,730 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d13.rako.space, returning rako.space
2025-04-07 13:01:12,744 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d14.rako.space, returning rako.space
2025-04-07 13:01:32,762 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d15.rako.space, returning rako.space
2025-04-07 13:01:52,781 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d16.rako.space, returning rako.space
2025-04-07 13:02:12,797 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d17.rako.space, returning rako.space
2025-04-07 13:02:32,815 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d18.rako.space, returning rako.space
2025-04-07 13:02:52,829 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d19.rako.space, returning rako.space
2025-04-07 13:02:52,834 DEBUG    moulinette.actionsmap.process - action executed in 410.346s
2025-04-07 13:02:52,839 INFO     geventwebsocket.handler.log_request - 127.0.0.1 - - [2025-04-07 13:02:52] "GET /domains/*/cert?full&locale=en HTTP/1.1" 200 110 410.356327

Accessing a domain:

2025-04-07 13:13:16,195 DEBUG    moulinette.actionsmap.process - processing action 'yunohost.domain.config.get'
2025-04-07 13:13:36,209 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d1.rako.space, returning rako.space
2025-04-07 13:13:56,226 WARNING  yunohost.domain._get_dns_zone_for_domain - Could not identify correctly the dns zone for domain d1.rako.space, returning rako.space
2025-04-07 13:13:56,327 DEBUG    yunohost.configpanel.get - Formating result in 'full' mode
2025-04-07 13:13:56,335 DEBUG    moulinette.actionsmap.process - action executed in 40.139s
2025-04-07 13:13:56,338 INFO     geventwebsocket.handler.log_request - 127.0.0.1 - - [2025-04-07 13:13:56] "GET /domains/d1.rako.space/config?full&locale=en HTTP/1.1" 200 4503 40.148048

Answer

It was DNS

I manually put FDN’s DNS and they are now down. Getting the default DNS back with yunohost tools regen-conf dnsmasq did the trick.

I am now going through each of the unused one and removing them one by one, and for some reason ynh goes through each domain twice and still goes in timeouts:

2025-04-07 13:15:11,789 DEBUG    yunohost.hook.<lambda> - ++ yunohost domain list --features mail_in mail_out --output-as json
2025-04-07 13:15:24,228 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain rako.space, returning rako.space
2025-04-07 13:15:34,360 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain rako.space, returning rako.space
2025-04-07 13:15:54,531 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain admin.rako.space, returning rako.space
2025-04-07 13:16:14,544 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain admin.rako.space, returning rako.space
2025-04-07 13:16:34,633 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d1.rako.space, returning rako.space
2025-04-07 13:16:54,646 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d1.rako.space, returning rako.space
2025-04-07 13:17:14,828 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d2.rako.space, returning rako.space
2025-04-07 13:17:34,839 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d2.rako.space, returning rako.space
2025-04-07 13:17:54,978 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d3.rako.space, returning rako.space
2025-04-07 13:18:14,992 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d3.rako.space, returning rako.space
2025-04-07 13:18:35,110 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d4.rako.space, returning rako.space
2025-04-07 13:18:55,122 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d4.rako.space, returning rako.space
2025-04-07 13:19:15,232 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d5.rako.space, returning rako.space
2025-04-07 13:19:35,244 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d5.rako.space, returning rako.space
2025-04-07 13:19:55,450 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d6.rako.space, returning rako.space
2025-04-07 13:20:15,471 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d6.rako.space, returning rako.space
2025-04-07 13:20:35,600 WARNING  yunohost.hook.<lambda> - WARNING Could not identify correctly the dns zone for domain d7.rako.space, returning rako.space
[...]

Looking at the code, the caches in /var/cache/yunohost/dns_zones where last updated on 2025-03-26