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

Preview of nil content bad response #1085

Closed
lisandromaselli opened this issue Dec 6, 2022 · 1 comment
Closed

Preview of nil content bad response #1085

lisandromaselli opened this issue Dec 6, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lisandromaselli
Copy link

Version:

  • listmonk: v2.3.0
  • OS: docker

Description of the bug and steps to reproduce:
Preview of a nil content returns 502.

Description:
echo: http: panic serving ...: runtime error: invalid memory address or nil pointer dereference
goroutine 167 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1802 +0xb9
panic({0xb07d60, 0x11c0780})
/opt/hostedtoolcache/go/1.17.13/x64/src/runtime/panic.go:1047 +0x266
html/template.(*Template).lookupAndEscapeTemplate(0x0, {0xbadd96, 0x4})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:146 +0x50
html/template.(*Template).ExecuteTemplate(0xc0003dab60, {0xcdcae0, 0xc0003d6810}, {0xbadd96, 0xc00080cfd0}, {0xb2a2a0, 0xc0000ff200})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:135 +0x38
github.com/knadh/listmonk/internal/manager.(*CampaignMessage).render(0xc0000ff200)
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:752 +0x13f
github.com/knadh/listmonk/internal/manager.(*Manager).NewCampaignMessage(_, , {{0x0, {{0x0, 0x0, 0x0}, 0x0}, {{0x0, 0x0, 0x0}, ...}}, ...})
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:198 +0x215
main.handlePreviewCampaign({0xd073d0, 0xc0015879a0})
/home/runner/work/listmonk/listmonk/cmd/campaigns.go:144 +0x6e5
github.com/labstack/echo/v4/middleware.BasicAuthWithConfig.func1.1({0xd073d0, 0xc0015879a0})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/middleware/basic_auth.go:93 +0x4a5
github.com/labstack/echo/v4.(*Echo).add.func1({0xd073d0, 0xc0015879a0})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:536 +0x51
main.initHTTPServer.func1.1({0xd073d0, 0xc0015879a0})
/home/runner/work/listmonk/listmonk/cmd/init.go:684 +0x5f
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0001c4000, {0xce9cd8, 0xc000532000}, 0xc00020a200)
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:646 +0x3bc
net/http.serverHandler.ServeHTTP({0xc0003d64e0}, {0xce9cd8, 0xc000532000}, 0xc00020a200)
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:2879 +0x43b
net/http.(*conn).serve(0xc000d4c5a0, {0xced9a0, 0xc0005f89f0})
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1930 +0xb08
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:3034 +0x4e8
echo: http: panic serving 168.119.166.131:45000: runtime error: invalid memory address or nil pointer dereference
goroutine 202 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1802 +0xb9
panic({0xb07d60, 0x11c0780})
/opt/hostedtoolcache/go/1.17.13/x64/src/runtime/panic.go:1047 +0x266
html/template.(*Template).lookupAndEscapeTemplate(0x0, {0xbadd96, 0x4})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:146 +0x50
html/template.(*Template).ExecuteTemplate(0xc00029cc30, {0xcdcae0, 0xc000d5c390}, {0xbadd96, 0xc0003bcfd0}, {0xb2a2a0, 0xc00055ab40})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:135 +0x38
github.com/knadh/listmonk/internal/manager.(*CampaignMessage).render(0xc00055ab40)
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:752 +0x13f
github.com/knadh/listmonk/internal/manager.(*Manager).NewCampaignMessage(
, , {{0x0, {{0x0, 0x0, 0x0}, 0x0}, {{0x0, 0x0, 0x0}, ...}}, ...})
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:198 +0x215
main.handlePreviewCampaign({0xd073d0, 0xc0015872c0})
/home/runner/work/listmonk/listmonk/cmd/campaigns.go:144 +0x6e5
github.com/labstack/echo/v4/middleware.BasicAuthWithConfig.func1.1({0xd073d0, 0xc0015872c0})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/middleware/basic_auth.go:93 +0x4a5
github.com/labstack/echo/v4.(*Echo).add.func1({0xd073d0, 0xc0015872c0})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:536 +0x51
main.initHTTPServer.func1.1({0xd073d0, 0xc0015872c0})
/home/runner/work/listmonk/listmonk/cmd/init.go:684 +0x5f
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0001c4000, {0xce9cd8, 0xc0000e8000}, 0xc000164100)
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:646 +0x3bc
net/http.serverHandler.ServeHTTP({0xc000d5c0c0}, {0xce9cd8, 0xc0000e8000}, 0xc000164100)
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:2879 +0x43b
net/http.(*conn).serve(0xc001587220, {0xced9a0, 0xc0005f89f0})
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1930 +0xb08
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:3034 +0x4e8
echo: http: panic serving ....: runtime error: invalid memory address or nil pointer dereference
goroutine 214 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1802 +0xb9
panic({0xb07d60, 0x11c0780})
/opt/hostedtoolcache/go/1.17.13/x64/src/runtime/panic.go:1047 +0x266
html/template.(*Template).lookupAndEscapeTemplate(0x0, {0xbadd96, 0x4})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:146 +0x50
html/template.(*Template).ExecuteTemplate(0xc00029cc30, {0xcdcae0, 0xc000d5c420}, {0xbadd96, 0xc00008efd0}, {0xb2a2a0, 0xc00055b560})
/opt/hostedtoolcache/go/1.17.13/x64/src/html/template/template.go:135 +0x38
github.com/knadh/listmonk/internal/manager.(*CampaignMessage).render(0xc00055b560)
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:752 +0x13f
github.com/knadh/listmonk/internal/manager.(*Manager).NewCampaignMessage(
, _, {{0x0, {{0x0, 0x0, 0x0}, 0x0}, {{0x0, 0x0, 0x0}, ...}}, ...})
/home/runner/work/listmonk/listmonk/internal/manager/manager.go:198 +0x215
main.handlePreviewCampaign({0xd073d0, 0xc0004a4d20})
/home/runner/work/listmonk/listmonk/cmd/campaigns.go:144 +0x6e5
github.com/labstack/echo/v4/middleware.BasicAuthWithConfig.func1.1({0xd073d0, 0xc0004a4d20})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/middleware/basic_auth.go:93 +0x4a5
github.com/labstack/echo/v4.(*Echo).add.func1({0xd073d0, 0xc0004a4d20})
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:536 +0x51
main.initHTTPServer.func1.1({0xd073d0, 0xc0004a4d20})
/home/runner/work/listmonk/listmonk/cmd/init.go:684 +0x5f
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0001c4000, {0xce9cd8, 0xc000d34000}, 0xc0015e2400)
/home/runner/go/pkg/mod/github.com/labstack/echo/v4@v4.9.0/echo.go:646 +0x3bc
net/http.serverHandler.ServeHTTP({0xc00054e330}, {0xce9cd8, 0xc000d34000}, 0xc0015e2400)
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:2879 +0x43b
net/http.(*conn).serve(0xc0004a4be0, {0xced9a0, 0xc0005f89f0})
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:1930 +0xb08
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.17.13/x64/src/net/http/server.go:3034 +0x4e8

@lisandromaselli lisandromaselli added the bug Something isn't working label Dec 6, 2022
@knadh knadh closed this as completed in a555fd3 Dec 6, 2022
@knadh
Copy link
Owner

knadh commented Dec 6, 2022

A bug that results in a stack trace! Thanks for reporting this.

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

2 participants