Caddy wont start

1. Caddy version (caddy version):

v2.1.0 h1:MC4d65RCVaEKy1iOFjsD51mybOwS8qdEVBi7ESDhUfE=

2. How I run Caddy:

as a service, installed via apt

a. System environment:

Debian 10 - intel i5-8400, 48GB ram, systemd

b. Command:

/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

d. My complete Caddyfile or JSON config:

{
email   (my email)
}

crafters-island.com www.crafters-island.com {
   root * /var/www/html
   route {
       php_fastcgi unix//run/php/php7.4-fpm.caddy.sock
   }
   file_server
   handle_errors {
      @404 {
         expression {http.error.status_code} == 404
      }

      rewrite @404 /404.html
      file_server
   }
}

ipv6.crafters-island.com ipv4.crafters-island.com {
   root * /var/www/html
   file_server
}

jellyfin.crafters-island.com {
   reverse_proxy * localhost:8096
}

sonarr.crafters-island.com {
   reverse_proxy * localhost:8989
}

radarr.crafters-island.com {
   reverse_proxy * localhost:7878
}

forums.crafters-island.com {
   reverse_proxy * localhost:8080
}

cisn.xyz {
    root * /var/www/cisn.xyz
    route {
        try_files {path} {path}/index.php yourls-loader.php
        php_fastcgi unix//run/php/php7.4-fpm.caddy.sock
    }
    file_server
    encode zstd gzip
}

speedtest.crafters-island.com {
   root * /var/www/speedtest
   route {
       php_fastcgi unix//run/php/php7.4-fpm.caddy.sock
   }
   file_server
}

3. The problem I’m having:

caddy.service: Main process exited, code=exited, status=1/FAILURE

4. Error messages and/or full log output:

Jun 28 20:29:23 WebServer caddy[5336]: 2020/06/28 20:29:23 WARNING: proto: file "pb.proto" is already registered
Jun 28 20:29:23 WebServer caddy[5336]: A future release will panic on registration conflicts. See:
Jun 28 20:29:23 WebServer caddy[5336]: https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict
Jun 28 20:29:23 WebServer caddy[5336]: caddy.HomeDir=/var/lib/caddy
Jun 28 20:29:23 WebServer caddy[5336]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Jun 28 20:29:23 WebServer caddy[5336]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Jun 28 20:29:23 WebServer caddy[5336]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Jun 28 20:29:23 WebServer caddy[5336]: runtime.GOOS=linux
Jun 28 20:29:23 WebServer caddy[5336]: runtime.GOARCH=amd64
Jun 28 20:29:23 WebServer caddy[5336]: runtime.Compiler=gc
Jun 28 20:29:23 WebServer caddy[5336]: runtime.NumCPU=6
Jun 28 20:29:23 WebServer caddy[5336]: runtime.GOMAXPROCS=6
Jun 28 20:29:23 WebServer caddy[5336]: runtime.Version=go1.14.4
Jun 28 20:29:23 WebServer caddy[5336]: os.Getwd=/
Jun 28 20:29:23 WebServer caddy[5336]: LANG=en_US.UTF-8
Jun 28 20:29:23 WebServer caddy[5336]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jun 28 20:29:23 WebServer caddy[5336]: HOME=/var/lib/caddy
Jun 28 20:29:23 WebServer caddy[5336]: LOGNAME=caddy
Jun 28 20:29:23 WebServer caddy[5336]: USER=caddy
Jun 28 20:29:23 WebServer caddy[5336]: INVOCATION_ID=85309e6c5ddb45fb907ccd38c558c49b
Jun 28 20:29:23 WebServer caddy[5336]: JOURNAL_STREAM=9:99457
Jun 28 20:29:23 WebServer caddy[5336]: {"level":"info","ts":1593394163.5117776,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Jun 28 20:29:23 WebServer caddy[5336]: {"level":"info","ts":1593394163.5139236,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["[::1]:2019","127.0.0.1:2019","localhost:2019"]}
Jun 28 20:29:23 WebServer caddy[5336]: 2020/06/28 20:29:23 [INFO][cache:0xc0008ea780] Started certificate maintenance routine
Jun 28 20:29:23 WebServer caddy[5336]: {"level":"info","ts":1593394163.5141277,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
Jun 28 20:29:23 WebServer caddy[5336]: {"level":"info","ts":1593394163.5141466,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Jun 28 20:29:23 WebServer caddy[5336]: 2020/06/28 20:29:23 proto: don't know how to compare []
Jun 28 20:29:23 WebServer caddy[5336]: 2020/06/28 20:29:23 [INFO][cache:0xc0008ea780] Stopped certificate maintenance routine
Jun 28 20:29:23 WebServer caddy[5336]: run: loading initial config: loading new config: loading http app module: provision http: server srv0: setting up server error handling routes: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 0: loading matcher modules: module name 'expression': provision http.matchers.expression: CEL request matcher expects return type of bool, not primitive:BOOL
Jun 28 20:29:23 WebServer systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit caddy.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jun 28 20:29:23 WebServer systemd[1]: caddy.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit caddy.service has entered the 'failed' state with result 'exit-code'.

5. What I already tried:

I reinstalled caddy from github, tried to run manually and double check caddy file.

6. Links to relevant resources:

Unfortunately Caddy v2.1 has a known regression from v2.0 relating to the expression matcher.

We’re still determining how we want to release a fix. For now, I recommend you revert to Caddy v2.0 or use the CI artifact from that PR which contains the fix, found here:

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