From d2e1567d26b5b34f62e64d01b2db1759e4cf0da0 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 17 Jul 2025 13:17:50 -0700 Subject: [PATCH] warn about missing server during ARI checks (#10369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is part of https://github.com/certbot/certbot/issues/10336 on my test server, the output of `certbot renew` after deleting the server field looks like: Screenshot 2025-07-17 at 12 06
07 PM --- certbot/src/certbot/_internal/renewal.py | 5 +++-- certbot/src/certbot/_internal/tests/renewal_test.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/certbot/src/certbot/_internal/renewal.py b/certbot/src/certbot/_internal/renewal.py index 6b1268758..64a7b6af8 100644 --- a/certbot/src/certbot/_internal/renewal.py +++ b/certbot/src/certbot/_internal/renewal.py @@ -397,8 +397,9 @@ def should_autorenew(config: configuration.NamespaceConfig, if acme: renewal_time, _ = acme.renewal_time(cert_pem) else: - logger.info("Certificate has no 'server' field configured, unable to " - "perform ACME Renewal Information (ARI) request.") + renewal_conf_file = storage.renewal_filename_for_lineagename(config, lineage.lineagename) + logger.warning("Skipping ARI check because %s has no 'server' field. This issue will not " + "prevent certificate renewal", renewal_conf_file) now = datetime.datetime.now(datetime.timezone.utc) diff --git a/certbot/src/certbot/_internal/tests/renewal_test.py b/certbot/src/certbot/_internal/tests/renewal_test.py index 4899fdbf2..9ba3a35d4 100644 --- a/certbot/src/certbot/_internal/tests/renewal_test.py +++ b/certbot/src/certbot/_internal/tests/renewal_test.py @@ -418,7 +418,11 @@ class RenewalTest(test_util.ConfigTestCase): mock_ocsp.return_value = True assert renewal.should_autorenew(self.config, mock_rc, acme_clients) mock_rc.server = None - assert renewal.should_autorenew(self.config, mock_rc, acme_clients) + with mock.patch('certbot._internal.renewal.logger.warning') as mock_warning: + assert renewal.should_autorenew(self.config, mock_rc, acme_clients) + # Ensure we warned about skipping ARI checks when server is None + assert any(call.args[0].startswith('Skipping ARI') for call in + mock_warning.call_args_list) @mock.patch('certbot._internal.client.create_acme_client') @mock.patch('certbot._internal.storage.RenewableCert.ocsp_revoked')