Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cattyhouse opened this issue May 22, 2024 · 5 comments
Labels
bug 🐞 Something isn't working
Milestone

Comments

@cattyhouse
Copy link

cattyhouse commented May 22, 2024

  • 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/v2@v2.8.0-rc.1/context.go:462 +0x32
github.com/caddyserver/caddy/v2/modules/caddytls.(*TLS).Cleanup(0xc00009de00)
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/v2@v2.8.0-rc.1/modules/caddytls/tls.go:356 +0xc5
github.com/caddyserver/caddy/v2.NewContext.func1()
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/v2@v2.8.0-rc.1/context.go:73 +0x162
github.com/caddyserver/caddy/v2.Validate(0xc000716d80)
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/v2@v2.8.0-rc.1/caddy.go:692 +0xb6
github.com/caddyserver/caddy/v2/cmd.cmdValidateConfig({0x0?})
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/v2@v2.8.0-rc.1/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/v2@v2.8.0-rc.1/cmd/cobra.go:137 +0x2f
github.com/spf13/cobra.(*Command).execute(0xc000741b08, {0xc0004664e0, 0x2, 0x2})
        /Users/m1/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0x2c88da0)
        /Users/m1/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/m1/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/caddyserver/caddy/v2/cmd.Main()
        /Users/m1/go/pkg/mod/github.com/caddyserver/caddy/v2@v2.8.0-rc.1/cmd/main.go:75 +0x1d8
main.main()
        /Users/m1/make/caddy-trojan/buildenv_2024-05-23-0735.204431611/main.go:11 +0xf

@mohammed90 mohammed90 added the bug 🐞 Something isn't working label May 23, 2024
@mohammed90 mohammed90 added this to the v2.8.0 milestone May 23, 2024
@mholt
Copy link
Member

mholt commented May 23, 2024

Ooo! A bug in a prerelease! Rock on, thanks for the report!

@mholt mholt closed this as completed in 2ce5c65 May 23, 2024
@cattyhouse
Copy link
Author

@mholt i am glad a bug is found. on the other hand, this indicates that such basic test was not run when caddy got released, do you think you could also add some tests before releasing?

@mholt
Copy link
Member

mholt commented May 23, 2024

Revamping our test suite is on my list, for sure.

@milewski
Copy link

Why this is only happening for me in a swarm cluster ... but exactly same version is not happening on my local?

@mholt
Copy link
Member

mholt commented May 29, 2024

@milewski Probably because this requires a very specific config situation. It's highly dependent on your config, and that's likely different from your local in your cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants