Dokploy/dokploy · error · Error
Invalid Let's Encrypt configuration structure.
Error message
Invalid Let's Encrypt configuration structure.
What it means
updateLetsEncryptEmail parses traefik.yml and expects config.certificatesResolvers.letsencrypt.acme to exist so it can overwrite the email. If that structure is absent (custom config, older layout, resolver removed), it refuses with this error rather than writing a broken config.
Source
Thrown at packages/server/src/utils/traefik/web-server.ts:93
if (newHost) {
writeTraefikConfig(config, appName);
} else {
removeTraefikConfig(appName);
}
};
export const updateLetsEncryptEmail = (newEmail: string | null) => {
try {
if (!newEmail) return;
const { MAIN_TRAEFIK_PATH } = paths();
const configPath = join(MAIN_TRAEFIK_PATH, "traefik.yml");
const configContent = readFileSync(configPath, "utf8");
const config = parse(configContent) as MainTraefikConfig;
if (config?.certificatesResolvers?.letsencrypt?.acme) {
config.certificatesResolvers.letsencrypt.acme.email = newEmail;
} else {
throw new Error("Invalid Let's Encrypt configuration structure.");
}
const newYamlContent = stringify(config);
writeFileSync(configPath, newYamlContent, "utf8");
} catch (error) {
throw error;
}
};
export const readMainConfig = () => {
const { MAIN_TRAEFIK_PATH } = paths();
const configPath = join(MAIN_TRAEFIK_PATH, "traefik.yml");
if (existsSync(configPath)) {
const yamlStr = readFileSync(configPath, "utf8");
return yamlStr;
}
return null;
};
View on GitHub (pinned to 546686ea35)
Solutions
- Inspect traefik.yml and restore/patch the certificatesResolvers.letsencrypt.acme block
- Set the email through the normal Dokploy Let's Encrypt settings flow so config is initialized first
- Back up and regenerate the config, then re-apply customizations
- Ensure you're on a current Dokploy version matching the config schema
Example fix
# before (traefik.yml missing resolver)
certificatesResolvers: {}
# after
certificatesResolvers:
letsencrypt:
acme:
email: old@example.com
storage: /letsencrypt/acme.json
httpChallenge:
entryPoint: web Defensive patterns
Strategy: validation
Validate before calling
const cfg = parse(readFileSync(configPath, 'utf8')) as MainTraefikConfig;
if (!cfg?.certificatesResolvers?.letsencrypt?.acme) {
// restore expected structure before updating email
} Type guard
const hasAcmeResolver = (c: MainTraefikConfig | undefined): c is MainTraefikConfig & { certificatesResolvers: { letsencrypt: { acme: object } } } =>
!!c?.certificatesResolvers?.letsencrypt?.acme; Prevention
- Back up traefik.yml before manual edits
- Keep the letsencrypt resolver name unchanged
When it happens
Trigger: traefik.yml customized so the letsencrypt certificatesResolver was renamed or deleted; a Dokploy version that stores ACME config differently; first-run before Let's Encrypt was configured.
Common situations: User hand-edited traefik.yml; upgraded instance with a stale config file; changed the ACME resolver name.
Related errors
AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27).
Data as JSON: /api/errors/bac3d583f31268f0.
Report an issue: GitHub.