Skip to content

v2.8.0-rc.1: panic: runtime error: invalid memory address or nil pointer dereference #6336

@cattyhouse

Description

@cattyhouse
  • build args
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux XCADDY_GO_BUILD_FLAGS="-ldflags '-s -w -buildid='" xcaddy build v2.8.0-rc.1 --output caddy-v2.8.0-rc.1-x86_64
  • caddyfile
example.com

respond "Hello, privacy!"
  • ./caddy-v2.8.0-rc.1-x86_64 validate -c ./caddyfile
2024/05/22 23:39:54.908 INFO    using config from file  {"file": "./caddyfile"}
2024/05/22 23:39:54.909 INFO    adapted config to JSON  {"adapter": "caddyfile"}
2024/05/22 23:39:54.909 INFO    http.auto_https 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}
2024/05/22 23:39:54.910 INFO    http.auto_https enabling automatic HTTP->HTTPS redirects        {"server_name": "srv0"}
2024/05/22 23:39:54.910 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc0004a5e00"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xad9c52]

goroutine 1 [running]:
github.com/caddyserver/caddy/v2.Context.AppIfConfigured({{0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/context.go:462 +0x32
github.com/caddyserver/caddy/v2/modules/caddytls.(*TLS).Cleanup(0xc00009de00)
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/modules/caddytls/tls.go:356 +0xc5
github.com/caddyserver/caddy/v2.NewContext.func1()
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/context.go:73 +0x162
github.com/caddyserver/caddy/v2.Validate(0xc000716d80)
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/caddy.go:692 +0xb6
github.com/caddyserver/caddy/v2/cmd.cmdValidateConfig({0x0?})
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/cmd/commandfuncs.go:547 +0x155
github.com/caddyserver/caddy/v2/cmd.init.1.func8.WrapCommandFuncForCobra.1(0xc000741b08, {0x1a4fd00?, 0x4?, 0x1a4fcd4?})
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/cmd/cobra.go:137 +0x2f
github.com/spf13/cobra.(*Command).execute(0xc000741b08, {0xc0004664e0, 0x2, 0x2})
        /Users/m1/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0x2c88da0)
        /Users/m1/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/m1/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/caddyserver/caddy/v2/cmd.Main()
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/[email protected]/cmd/main.go:75 +0x1d8
main.main()
        /Users/m1/make/caddy-trojan/buildenv_2024-05-23-0735.204431611/main.go:11 +0xf

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions