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

crash with watching on -- html/template internal error: template escaping out of sync #1405

Closed
pbnjay opened this issue Sep 5, 2015 · 3 comments

Comments

@pbnjay
Copy link

pbnjay commented Sep 5, 2015

Just saw an odd crash while editing a post with watching enabled. I'm editing in Sublime Text, using the SFTP plugin to sync on save to my server where hugo is running. After one of my saves I got this crash, my best guess is that the file wasn't completely synced yet? Although I'm editing a markdown content file, so I'm not sure why that is affecting the template state.

I have not been able to reproduce this one with the exact same files that were in place, so it seems like it may be a race of some sort.

I'm running on the latest binary package, invocation was hugo server -t hugo-incorporated -w -p 3000 -b http://example.com --appendPort=false

Snip of running goroutine, I can post the full crash dump if interested:

Change detected, rebuilding site 
2015-09-05 18:41 +0000 
panic: html/template internal error: template escaping out of sync [recovered] 
        panic: html/template internal error: template escaping out of sync 

goroutine 820 [running]: 
text/template.errRecover(0xc208263a50) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:104 +0x14f 
html/template.(*Template).lookupAndEscapeTemplate(0xc208124580, 0xc208281b00, 0x1b, 0xc2082dea50, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/html/template/template.go:112 +0x3a6 
html/template.(*Template).ExecuteTemplate(0xc208124580, 0x7f4823e316b8, 0xc2080f7ab0, 0xc208281b00, 0x1b, 0xae1020, 0xc20803ac00, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/html/template/template.go:88 +0x54 
github.com/spf13/hugo/tpl.ExecuteTemplate(0xae1020, 0xc20803ac00, 0xc2080f7ab0, 0xc208281ac0, 0x2, 0x2) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/tpl/template.go:114 +0x1d6 
github.com/spf13/hugo/tpl.ExecuteTemplateToHTML(0xae1020, 0xc20803ac00, 0xc208281ac0, 0x2, 0x2, 0x0, 0x0) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/tpl/template.go:131 +0xaa 
github.com/spf13/hugo/tpl.Partial(0xc2082e3041, 0xc, 0xc208148e90, 0x1, 0x1, 0x0, 0x0) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/tpl/template.go:100 +0x260 
reflect.Value.call(0x9c8640, 0xc4bef0, 0x13, 0xaec750, 0x4, 0xc20820c780, 0x2, 0x2, 0x0, 0x0, ...) 
        /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:419 +0x10e5 
reflect.Value.Call(0x9c8640, 0xc4bef0, 0x13, 0xc20820c750, 0x2, 0x2, 0x0, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:296 +0xbc 
text/template.(*state).evalCall(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0x9c8640, 0xc4bef0, 0x13, 0x7f4823e3c948, 0xc2080ffd70, 0xc2082e3038, ...) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:567 +0xaa4 
text/template.(*state).evalFunction(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0xc2080ffda0, 0x7f4823e3c948, 0xc2080ffd70, 0xc208235e80, 0x3, 0x4, ...) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:459 +0x33b 
text/template.(*state).evalCommand(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0xc2080ffd70, 0x0, 0x0, 0x0, 0x0, 0x0, ...) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:359 +0x210 
text/template.(*state).evalPipeline(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0xc208038be0, 0x0, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:332 +0x1a8 
text/template.(*state).walk(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0x7f4823e31408, 0xc2080ffe60) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:167 +0x145 
text/template.(*state).walk(0xc2081ce640, 0xae1020, 0xc20803ac00, 0x16, 0x7f4823e3c8b8, 0xc2080fb980) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:175 +0x862 
text/template.(*Template).Execute(0xc208235680, 0x7f4823e316b8, 0xc208011500, 0xae1020, 0xc20803ac00, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/text/template/exec.go:155 +0x3f2 
html/template.(*Template).ExecuteTemplate(0xc208124580, 0x7f4823e316b8, 0xc208011500, 0xc2082801c0, 0x1a, 0xae1020, 0xc20803ac00, 0x0, 0x0) 
        /usr/local/Cellar/go/1.4.2/libexec/src/html/template/template.go:92 +0xc0 
github.com/spf13/hugo/hugolib.(*Site).renderThing(0xc2083161c0, 0xae1020, 0xc20803ac00, 0xc2082801c0, 0x1a, 0x7f4823e316b8, 0xc208011500, 0x0, 0x0) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1500 +0x210 
github.com/spf13/hugo/hugolib.(*Site).render(0xc2083161c0, 0xc2081ce580, 0x3a, 0xae1020, 0xc20803ac00, 0xc208011500, 0xc20813c000, 0xa, 0x10, 0x0, ...) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1475 +0x2bd 
github.com/spf13/hugo/hugolib.(*Site).renderAndWritePage(0xc2083161c0, 0xc2081ce580, 0x3a, 0xc2081ce4c0, 0x32, 0xae1020, 0xc20803ac00, 0xc20813c000, 0xa, 0x10, ...) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1426 +0xdf 
github.com/spf13/hugo/hugolib.pageRenderer(0xc2083161c0, 0xc208066ba0, 0xc208066ae0, 0xc2082e0080) 
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:965 +0x47e 
created by github.com/spf13/hugo/hugolib.(*Site).RenderPages 
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:923 +0x124 
@bep
Copy link
Member

bep commented Sep 5, 2015

Thanks for the report.

This duplicates #1326 and #917.

This data race is a bug in Go's stdlib and is fixed in Go 1.5 -- and as such will be fixed in Hugo 0.15.

@bep bep closed this as completed Sep 5, 2015
@bep bep added the Duplicate label Sep 5, 2015
@pbnjay
Copy link
Author

pbnjay commented Sep 5, 2015

Great thanks for the update, for some reason those didn't come up in my search. Sorry for the dupe!

bep added a commit that referenced this issue Apr 20, 2021
fb551cc75 Update index.md
7af894857 Update index.md
d235753ea Hugo 0.82.1
e03e72deb Merge branch 'temp0821'
e62648961 Merge branch 'release-0.82.1'
e1ab0f6eb releaser: Add release notes to /docs for release of 0.82.1
5d354c38d Replaced ``` code blocks with Code Toggler
c9d065c20 Remove duplicate YAML keys (#1420)
8ae31e701 Add webp image encoding support
848f2af26 Update internal.md (#1407)
c103a86a4 Fix `ref` shortcode example output (#1409)
9f8ba56dc Remove leading dot from where function KEY (#1419)
363251a51 Improve presentation of template lookup order (#1382)
b73da986d Improve description of Page Resources (#1381)
4e0bb96d5 Rework robots.txt page (#1405)
edf893e6f Update migrations.md (#1412)
450f1580b Add link to `site` function doc (#1417)
cfffa6e6f Added one extension to the list (#1414)
05f1665a0 Update theme
5de0b1c6a Update theme
250e20552 Add hugo.IsExtended
dea5e1fd7 Fix typo on merge function page (#1408)
1bbed2cf3 Update configuration.md
be0b64a46 Omit ISO
cbb5b8367 Fix `dateFormat` documentation
698f15466 Regenerate the docshelper
f9a8a7cb6 Update multilingual.md
a22dc6267 Fix grammar (#1398)
eb98b0997 Fix pretty URL example (#1397)
f4c4153dc Mention date var complementation in post scheduling (#1396)
17fae284c Fix resources.ExecuteAsTemplate argument order (#1394)
97e2c2abb Use code-toggle shortcode in `multilingual.md` (#1388)
3a84929bb Harmonize capitalization (#1393)
17f15daa6 fix file naming used in example (#1392)
5d97b6a18 Add slice syntax to sections permalinks config
00665b97b Improve description of `site.md`
edcf5e3fc Fix example in `merge.md`
f275ab778 Update postprocess.md
9593e3991 Fix file name
59bd9656f Update postprocess.md
1172fb6d0 Update to theNewDynamic repository (#1263)
f5b5c1d2c Update Hugo container image
4f2e92f2a Adapt anchorize.md to Goldmark
98aa19073 Directly link to `highlight` shortcode (#1384)
4c75c2422 Fix header level
f15c06f23 markdownify: add note about render-hooks and .RenderString (#1281)
69c82eb68 Remove Blackfriday reference from shortcode desc (#1380)
36de478df Update description of ignoreFiles config setting (#1377)
6337699d8 Remove "Authors" page from documentation (#1371)
35e73ca90 fix indent in example (#1372)
d3f01f19a Remove opening body tag from header example (#1376)
341a5a7d8 Update index.md
c9bfdbee6 Release 0.82.0
119644949 releaser: Add release notes to /docs for release of 0.82.0
32efaed78 docs: Regenerate docs helper
dea5449a2 docs: Regen CLI docs
eeab18fce Merge commit '81689af79901f0cdaff765cda6322dd4a9a7ccb3'
d508a1259 Attributes for code fences should be placed after the lang indicator only
c80905cef deps: Update to esbuild v0.9.0
95350eb79 Add support for Google Analytics v4
02d36f9bc Allow markdown attribute lists to be used in title render hooks
7df220a64 Merge commit '9d31f650da964a52f05fc27b7fb99cf3e09778cf'
d80bf61b7 Fixes #7698.

git-subtree-dir: docs
git-subtree-split: fb551cc750faa83a1493b0e0d0898cd98ab74465
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants