Billionmail/BillionMail · error

at least one domain is required

Error message

at least one domain is required

What it means

Parameter check in AcmeCLI.Validate: the Domains slice on the AcmeCLI instance is empty, so there is nothing to request a certificate for. Validate rejects this before invoking applyCommand, since a certificate order requires at least one SAN domain.

Source

Thrown at core/internal/service/acme/cli.go:91

	cli.VerifyType = "http"
	cli.DnsProvider = ""
	cli.DnsConfig = nil
	return cli
}

/**
 * @brief Validate parameters
 * @return error
 */
func (cli *AcmeCLI) Validate() error {
	// Check email
	if cli.Email == "" {
		return fmt.Errorf("email is required")
	}

	// Check domains
	if len(cli.Domains) == 0 {
		return fmt.Errorf("at least one domain is required")
	}

	// Check verification type
	if cli.VerifyType != "http" && cli.VerifyType != "dns" {
		return fmt.Errorf("verification type must be either 'http' or 'dns'")
	}

	// Check DNS provider if using DNS verification
	if cli.VerifyType == "dns" {
		if cli.DnsProvider == "" {
			return fmt.Errorf("DNS provider is required for DNS verification")
		}

		// Check if DNS provider is supported
		supportedProviders := []string{"tencentcloud", "alidns", "cloudxns", "azuredns", "cloudflare", "godaddy"}
		isSupported := false
		for _, provider := range supportedProviders {
			if cli.DnsProvider == provider {

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Populate cli.Domains with at least one FQDN before Apply
  2. Pass --domains example.com (comma-separated for multiple) on the command
  3. Guard upstream: if len(domains)==0 skip issuance and log a config warning

Example fix

// before
domains := strings.Split(os.Getenv("CERT_DOMAINS"), ",") // empty env -> []
cli := &AcmeCLI{Email: e, Domains: domains, VerifyType: "http"}
// after
if len(domains) == 0 || domains[0] == "" { log.Fatal("CERT_DOMAINS must list at least one domain") }
cli := &AcmeCLI{Email: e, Domains: domains, VerifyType: "http"}
Defensive patterns

Strategy: validation

Validate before calling

if len(cli.Domains) == 0 {
    return errors.New("at least one domain must be configured before issuing")
}
for _, d := range cli.Domains {
    if strings.TrimSpace(d) == "" { return errors.New("blank entry in domain list") }
}

Try / catch

if err := cli.Validate(); err != nil {
    if strings.Contains(err.Error(), "at least one domain") {
        log.Printf("no domains configured; check --domains flag / CERT_DOMAINS env")
    }
    os.Exit(1)
}

Prevention

When it happens

Trigger: AcmeCLI constructed with Domains == nil or len(Domains) == 0 (missing --domains flag, empty config list) then Validate/Apply is called.

Common situations: Flag parsing where --domains was forgotten; splitting an empty domains env var yields zero entries; programmatic use where a dynamic domain list ended up empty after filtering.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/38021798403c007c. Report an issue: GitHub.