A domain's tasks outlive it: deleting it, or DKIM set to manual, leaves them queued; back to automatic adds a second #327

Closed
opened 2026-11-09 05:53:45 +00:00 by jcoffey-dev · 1 comment
Owner

Reported on the forum (https://community.coffeylabs.org/t/232, posts 8 and 9).

  1. Deleting a domain leaves its DKIM management and certificate renewal tasks in the scheduler. When they run, they fail: the DKIM task ends Failed with "Domain not found" (crates/services/src/task_manager/dkim.rs, ~line 64), and the failed entries stay in the task list. #314 deleted the domain's DKIM keys with it, but not its tasks.
  2. DKIM key management set to manual leaves the queued DKIM task. It later fails with "Domain is not set to automatic DKIM management".
  3. Back to automatic always queues a new DKIM task (will_trigger_dkim, crates/jmap/src/registry/mapping/domain.rs, ~line 104), so the domain now has two.

Fix:

  • Destroying a domain deletes the tasks that name it (DKIM management, DNS management, ACME renewal), in the same write.
  • DKIM to manual deletes the domain's DKIM task. Certificate management to manual should do the same for its renewal task; check that path too.
  • Queuing a DKIM task replaces a queued one for the same domain instead of adding another, as 23d746e does for renewals.
  • A task whose domain is gone ends quietly as done instead of Failed, so an install that already has stale ones isn't stuck with failures.
  • Tests for each of the three, and a note in the release notes about stale tasks on existing installs.
Reported on the forum (https://community.coffeylabs.org/t/232, posts 8 and 9). 1. **Deleting a domain** leaves its DKIM management and certificate renewal tasks in the scheduler. When they run, they fail: the DKIM task ends Failed with "Domain not found" (`crates/services/src/task_manager/dkim.rs`, ~line 64), and the failed entries stay in the task list. #314 deleted the domain's DKIM keys with it, but not its tasks. 2. **DKIM key management set to manual** leaves the queued DKIM task. It later fails with "Domain is not set to automatic DKIM management". 3. **Back to automatic** always queues a new DKIM task (`will_trigger_dkim`, `crates/jmap/src/registry/mapping/domain.rs`, ~line 104), so the domain now has two. Fix: - Destroying a domain deletes the tasks that name it (DKIM management, DNS management, ACME renewal), in the same write. - DKIM to manual deletes the domain's DKIM task. Certificate management to manual should do the same for its renewal task; check that path too. - Queuing a DKIM task replaces a queued one for the same domain instead of adding another, as 23d746e does for renewals. - A task whose domain is gone ends quietly as done instead of Failed, so an install that already has stale ones isn't stuck with failures. - Tests for each of the three, and a note in the release notes about stale tasks on existing installs.
jcoffey-dev added the bug
priority
p2
labels 2026-11-09 05:53:45 +00:00
jcoffey-dev self-assigned this 2026-11-09 05:53:56 +00:00
Author
Owner

Fixed in #332 (4ef32fab). Deleting a domain removes its DKIM, DNS and renewal tasks. Turning DKIM, DNS or certificate management from automatic to manual removes the matching task, and queuing a DKIM task replaces the queued one, so manual then automatic leaves one. A task whose domain is gone, or no longer manages that part, now ends quietly instead of Failed, so stale ones on existing installs clear themselves on their next run. Ships in the next server rc.

Fixed in #332 (4ef32fab). Deleting a domain removes its DKIM, DNS and renewal tasks. Turning DKIM, DNS or certificate management from automatic to manual removes the matching task, and queuing a DKIM task replaces the queued one, so manual then automatic leaves one. A task whose domain is gone, or no longer manages that part, now ends quietly instead of Failed, so stale ones on existing installs clear themselves on their next run. Ships in the next server rc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#327