Skip to content

Auth email templates fall back to defaults if Kong template endpoint is unavailable during startup #4668

@jasny

Description

@jasny

Describe the bug

When starting Supabase with npx supabase start, custom Auth email templates configured via auth.email.template.* sometimes fall back to the built-in default templates.

This happens if Auth (GoTrue) starts before Kong’s template endpoint (:8088) is ready. Auth logs connection errors, loads default templates, and continues using them even after Kong becomes healthy. Custom templates are only applied after manually restarting the Auth container.

To Reproduce

  1. Configure custom email templates using auth.email.template.* with content_path in supabase/config.toml
  2. Run npx supabase start
  3. Trigger a signup confirmation email
  4. Observe that the default Supabase confirmation email is sent
  5. Restart the Auth container: docker restart supabase_auth_<project>
  6. Trigger the signup email again
  7. Observe that the custom email template is now used

Expected behavior

Auth should:

  • Retry loading email templates once Kong becomes available, or
  • Wait for Kong’s template endpoint to be reachable before initializing templates, or
  • Reload templates dynamically instead of caching fallback defaults permanently

Custom email templates should be applied consistently after startup.

Screenshots

Not applicable. Issue reproduced via logs and Mailpit HTML email inspection.

System information

  • Ticket ID: not available (issue occurs during startup, not a CLI command failure)

  • Version of OS: Linux

  • Version of CLI: 2.70.5

  • Version of Docker: Docker Engine 25.x

  • Versions of services: output of npx supabase services

    kong, auth, db, rest, realtime, storage, studio, inbucket, analytics, edge-runtime
    

Additional context

Relevant Auth startup logs:

{"error":"templatemailer: template type \"confirmation\": Get \"http://supabase_kong_<project>:8088/email/confirmation.html\": dial tcp 172.18.0.5:8088: connect: connection refused","event":"templatemailer_template_body_http_error","level":"error","mail_type":"confirmation","time":"2025-12-29T00:26:28Z"}

Later in the same run:

  • supabase_kong_<project> is healthy
  • wget http://supabase_kong_<project>:8088/email/confirmation.html works from inside both Kong and Auth containers
  • Emails are still sent using default templates

Workaround

docker restart supabase_auth_<project>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions