What does this mean exactly? how can i fix this?

  1. Caddy version (caddy version):

v2

  1. How I run Caddy:

Caddyfile in /etc/caddy. caddy run command

a. System environment:

ubuntu 20.04 desktop. repository installation

b. Command:

caddy run

d. My complete Caddyfile or JSON config:

# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.

jellymmeirolas.ddnss.de {
        reverse_proxy localhost:8096
}

syncmmeirolas.ddnss.de {
        reverse_proxy localhost:8384 {
                header_up Host localhost
        }
}

# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080

# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

  1. The problem I’m having:

streams randomly exiting. losing connection to sever

Getting a lot of this output with systemctl status caddy:

Mai 27 17:00:06 mmeiraserv caddy[1596]: {"level":"error","ts":1622127606.941126,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}
Mai 27 17:00:06 mmeiraserv caddy[1596]: {"level":"error","ts":1622127606.942183,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"context canceled"}
Mai 27 17:00:07 mmeiraserv caddy[1596]: {"level":"error","ts":1622127607.561407,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}
Mai 27 17:00:07 mmeiraserv caddy[1596]: {"level":"error","ts":1622127607.5617344,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}
Mai 27 17:00:07 mmeiraserv caddy[1596]: {"level":"error","ts":1622127607.6203701,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}
Mai 27 17:00:07 mmeiraserv caddy[1596]: {"level":"error","ts":1622127607.6229143,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}

systemctl status caddy after reloading returns:

Mai 29 02:50:53 mmeiraserv caddy[108520]: {"level":"info","ts":1622249453.032154,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Mai 29 02:50:53 mmeiraserv caddy[108520]: {"level":"warn","ts":1622249453.0329623,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":12}
Mai 29 02:50:53 mmeiraserv caddy[1596]: {"level":"info","ts":1622249453.033529,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_addr":"127.0.0.1:49718","headers":{"Accept-Encodi

caddy run returns:

2021/05/29 01:16:49.031 INFO    using adjacent Caddyfile
2021/05/29 01:16:49.032 WARN    input is not formatted with 'caddy fmt' {"adapter": "caddyfile", "file": "Caddyfile", "line": 12}
run: loading initial config: loading new config: starting caddy administration endpoint: listen tcp 127.0.0.1:2019: bind: address already in use

cheers

Caddy uses an admin API endpoint (i.e. 127.0.0.1:2019) to provide a bunch of functionality, including graceful config reloads.

That error is telling you that another instance of Caddy is already running, and has bound itself to that address, so a second instance of Caddy cannot run at the same time using the same address.

If you’re running Caddy as a systemd service, then you don’t need to use caddy run, since it’s already running as a service. Instead, use sudo service caddy <command> to manage the service.

Hard to say what the problem is, but it’s possible that you’re running into this problem:

https://github.com/caddyserver/caddy/issues/3896

This is a known issue unfortunately, but we need the Go standard library to be updated for the fix.

thx francislavoie as always for the fast reply :slight_smile:

since i am not very linux savvy, could you tell me how i close the other caddy instance?

“sudo service caddy” outputs:

caddy: unrecognized service

that issue with the Go standard library from the looks of it is going on since at least December, and no fix yet. is there a temporary fix at least?
there is something about “calling directly the /x/net/http2 ConfigureServer”… how can i do that?
will it have any repercussion on functionality or security?

thx again

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