Frankenphp daemon keeps exiting

1. The problem I’m having:

frankenphp systemd daemon keeps exiting.

2. Error messages and/or full log output:

Aug 19 14:07:18 dev frankenphp[9273]: {"level":"debug","ts":1724076438.6005154,"logger":"http.stdlib","msg":"http: TLS handshake error from 82.180.154.41:53332: local error: tls: bad record MAC"}

3. Caddy version:

FrankenPHP v1.2.3 PHP 8.3.10 Caddy v2.8.4

4. How I installed and ran Caddy:

systemctl start frankenphp

a. System environment:

systemd

b. Command:

systemctl start frankenphp

c. Service/unit/compose file:

[Unit]
Description=FrankenPHP Server
After=network.target network-online.target
Requires=network-online.target

[Service]
Restart=on-failure
Type=notify
User=frankenphp
Group=frankenphp
ExecStartPre=/usr/bin/frankenphp validate --config /etc/frankenphp/Caddyfile
ExecStart=/usr/bin/frankenphp run --environ --config /etc/frankenphp/Caddyfile
ExecReload=/usr/bin/frankenphp reload --config /etc/frankenphp/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE

Environment=PHP_INI_SCAN_DIR=/etc/php.d/

[Install]
WantedBy=multi-user.target

d. My complete Caddy config:

{
    # Enable FrankenPHP
    frankenphp

    # Logging
    log {
        output stderr
        level DEBUG
    }
}

dev.sportch.co.uk {
    # Enable compression (optional)
    encode zstd br gzip

    root * /var/www/html/SportchLegacyApp

    # Define a route for handling requests
    route {

        # Security: Hide specific paths
        @hide path /.env *.sql *.template /gtscripts/* *.txt *.md /random /support vapi/ var/ /support /system.* /lib
        respond @hide 404

        # Execute PHP files
        php_server

        # Rewrite subfolder requests for screenscrapers
        rewrite /ladder/* /ladder/index.php
        rewrite /manager/* /manager/index.php

         # Add WebSocket support
        @websocket {
            header Connection *Upgrade*
            header Upgrade websocket
        }
        reverse_proxy @websocket localhost:5502
    }
}

5. Links to relevant resources:

That’s not a fatal log. It just means some client failed the TLS handshake, likely some bot/crawler. Is that really the last thing in the logs before it exits?

Please share more than just one log line. Be more specific. Give us more to work with.

You’ll need to ask on the FrankenPHP github repo.

1 Like

How do I know when it exited?

Well, you tell me. How do you know it exited at all? What’s your evidence of that? I don’t understand.

1 Like

The website was working. The website stopped working. The frankenphp service wasn’t running. Starting it fixed the website.

Okay, then find the logs from just before you started it back up.

1 Like

I’ll have to wait till it happens again. I didn’t note the time and there’s reams of log data being generated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.