unrolled/render

PANIC: template: redefinition of template "layout"

panjunjie opened this issue · 4 comments

My website using render, most of the time are normal, is occasionally appear : PANIC: template: redefinition of template "layout" , I don't know what the reason is, please help.

description:

2015/03/04 20:33:00 http: multiple response.WriteHeader calls
[negroni] PANIC: template: redefinition of template "layout"
goroutine 73776 [running]:
github.com/codegangsta/negroni.func·003()
/var/GOPATH/src/github.com/codegangsta/negroni/recovery.go:34 +0x10d
html/template.Must(0x0, 0x7f9c8a8c1c00, 0xc208299440, 0x0)
/var/go/src/html/template/template.go:304 +0x50
github.com/unrolled/render.func·003(0xc2082f79c0, 0x15, 0x7f9c8a8c7ad0, 0xc2086f3bd0, 0x0, 0x0, 0x0, 0x0)
/var/GOPATH/src/github.com/unrolled/render/render.go:167 +0x539
path/filepath.walk(0xc2082f79c0, 0x15, 0x7f9c8a8c7ad0, 0xc2086f3bd0, 0xc208859428, 0x0, 0x0)
/var/go/src/path/filepath/path.go:347 +0x91
path/filepath.walk(0x98e970, 0x9, 0x7f9c8a8c7ad0, 0xc2080f2000, 0xc208859428, 0x0, 0x0)
/var/go/src/path/filepath/path.go:372 +0x51d
path/filepath.Walk(0x98e970, 0x9, 0xc208859428, 0x0, 0x0)
/var/go/src/path/filepath/path.go:394 +0xf2
github.com/unrolled/render.(_Render).compileTemplates(0xc20809f860)
/var/GOPATH/src/github.com/unrolled/render/render.go:173 +0x106
github.com/unrolled/render.(_Render).HTML(0xc20809f860, 0x7f9c8a8d50d8, 0xc2087b1e80, 0xc8, 0x988150, 0x8, 0x7f0660, 0xc20848ddd0, 0xc208859640, 0x1, ...)
/var/GOPATH/src/github.com/unrolled/render/render.go:250 +0x3f

From my experience this may happen when you're running it in development mode with concurrent access. Try to set development mode to false

Thank you much!

@tammomueller Thank you much!

Hey @panjunjie did this solve your issue? Can I close this?