Skip to content

Troubleshoot self-hosting

Match a Supermetry startup or email error to a verified fix: Docker Compose and buildx, PostgreSQL connection, configuration, port conflicts and SMTP.

Match the startup error to a verified fix, then check readiness again.

  1. If Compose reports compose build requires buildx 0.17 or later, upgrade buildx or disable Bake for this run.

    Terminal window
    COMPOSE_BAKE=false docker compose -f deploy/docker-compose.yml up -d --build
  2. If an older checkout left deploy-* containers or deploy_* volumes, inspect them before removing anything.

    Terminal window
    docker ps -a --filter name=deploy-
    docker volume ls --filter name=deploy_

    Back up any needed data before deleting an old container or volume. Current Compose resources use the supermetry project name.

  3. If PostgreSQL 18 starts with an empty database after an upgrade, check the volume mount. PostgreSQL 18 stores its cluster below /var/lib/postgresql/18/docker, and the current Compose file mounts the volume at /var/lib/postgresql.

    An old volume mounted at /var/lib/postgresql/data must be backed up with its old configuration and restored into a fresh PostgreSQL 18 volume. Do not remount it at the new path.

  4. For installer database failures, correct the field named by the message:

    • connection refused by PostgreSQL host: start PostgreSQL and check its host and port.
    • DNS name not found: correct the database hostname.
    • password authentication failed for user ...: correct the user or password.
    • database ... does not exist: create the database or correct its name.
    • PostgreSQL TLS certificate could not be verified: correct the certificate trust or sslmode.

    Interactive installation keeps the entered values and asks again. An unattended --yes install exits without writing files.

  5. If plain supermetry prints Supermetry is not configured, run the installer or create .env with SUPERMETRY_DATABASE_URL, SUPERMETRY_SECRET_KEY, and SUPERMETRY_BASE_URL.

  6. If startup reports listen on ... address already in use, identify the process using the configured port.

    Terminal window
    sudo ss -ltnp 'sport = :8787'

    Stop the unintended process or change SUPERMETRY_LISTEN, then restart Supermetry.

  7. Check the service and readiness.

    Terminal window
    sudo systemctl status supermetry --no-pager
    sudo journalctl -u supermetry -n 50 --no-pager
    curl -fsS http://127.0.0.1:8787/readyz

What you should see: the service is active and /readyz returns {"status":"ok"}.

Start with the test button: in the app open Instance administration → Email (SMTP) and select Send test email. A failure shows the step that failed and the server’s reply. The log records the failed step only, without the server’s reply, because replies can contain email addresses.

  1. For failures outside the test (reports, alerts, invitations), read the log for the failed step.

    For a binary install:

    Terminal window
    sudo journalctl -u supermetry -n 100 --no-pager | grep -i smtp

    For Docker:

    Terminal window
    cd /opt/supermetry
    docker compose logs --tail 100 supermetry | grep -i smtp
  2. Match the error prefix to the cause. The text after the prefix is the server’s own message.

    Error prefix Likely cause Fix
    SMTP is not configured No host is set in the environment or in the app. Set SUPERMETRY_SMTP_HOST or fill in Email (SMTP).
    SMTP authentication requires STARTTLS or implicit TLS A username is set but the connection is not encrypted. Use starttls (587) or implicit (465), or remove the username for a trusted local relay.
    parse SMTP from address The From address is not a valid address, or has a line break. Use analytics@example.com or "Supermetry <analytics@example.com>".
    parse SMTP recipient The recipient address is not valid. Correct the address of the user or channel.
    connect SMTP The host and port cannot be reached: wrong name, port blocked by a firewall, or the provider blocks outbound SMTP. Check the host and port from the Supermetry host, for example with nc -vz HOST PORT. In Docker, localhost is the container.
    start SMTP TLS The TLS handshake failed: the certificate does not match the host name, is expired or untrusted, or the mode does not match the port. Use the host name on the certificate. Use implicit on 465 and starttls on 587. Certificates are always verified.
    set SMTP deadline The connection deadline could not be applied. Rare. Retry; if it repeats, report it with the log line.
    create SMTP client The server’s first reply was not SMTP, usually plain text sent to a TLS port or the reverse. Match the mode to the port.
    SMTP greeting The server rejected the EHLO greeting. Set SUPERMETRY_SMTP_HELO to a real, resolvable host name.
    SMTP server does not support STARTTLS The server offers no STARTTLS on this port. Use implicit if the port is 465, or another port or provider setting.
    authenticate SMTP The username or password was refused. Check the credentials. Many providers need an app password or SMTP-specific credentials, not the account password.
    set SMTP sender The server rejected the From address. Verify the sender address or domain with the provider, and use it in From.
    set SMTP recipient The server rejected the recipient, often an unverified recipient in a provider sandbox or a relay that does not accept that domain. Verify the recipient or lift the sandbox; check the relay’s rules.
    open SMTP message The server refused to accept message data. Read the server’s text after the prefix; check provider limits and sender status.
    write SMTP message The connection dropped while sending. Retry; check for network or provider interruptions.
    finish SMTP message The server rejected the message after receiving it, for example as spam or over a limit. Read the server’s text; check the SPF, DKIM and DMARC records and the provider’s sending limits.
    quit SMTP The server did not end the session cleanly after accepting the message. Usually harmless; confirm whether the message arrived.
    load SMTP settings The settings saved in the app could not be read. Check the database connection and the secret key, then save the settings again.
  3. If Supermetry does not start, match the startup message.

    Startup error Fix
    SUPERMETRY_SMTP_PORT must be an integer from 1 to 65535 Use a number from 1 to 65535.
    SUPERMETRY_SMTP_STARTTLS must be a boolean Use true or false, or switch to SUPERMETRY_SMTP_TLS.
    SUPERMETRY_SMTP_TLS must be starttls, implicit or none Use one of the three values.
    SUPERMETRY_SMTP_TLS and SUPERMETRY_SMTP_STARTTLS disagree; set only SUPERMETRY_SMTP_TLS Remove SUPERMETRY_SMTP_STARTTLS.
    SUPERMETRY_SMTP_USER requires TLS: use SUPERMETRY_SMTP_TLS=starttls or implicit Turn on TLS or remove the username.
    SUPERMETRY_SMTP_FROM is required when SUPERMETRY_SMTP_HOST is set Set the From address.
    SUPERMETRY_SMTP_HELO must be a host name Use a host name such as app.example.com.
  4. If the test or the log shows success but the message is not in the inbox, the mail server accepted it and the problem is after Supermetry. Check, in order:

    • The spam or junk folder and any quarantine.
    • The provider’s activity or log page for a bounce, block or deferral.
    • SPF, DKIM and DMARC for the domain in the From address.
    • That the From address or domain is verified at the provider.
    • That the provider account is out of any sandbox and under its sending limits.
    • That the recipient address is spelled correctly.

What you should see: the test email arrives, or the log shows a single prefix from the table that you can act on.