Closed andrewheiss closed 4 years ago
I was able to reproduce it once, but was unable to reproduce it again no matter what I try. Does it work if you close and reopen the RStudio project?
Ha, yeah, it's been so hard to nail down what's happening—I get it to reproduce like 70% of the time. Sometimes it happens with serve_site()
, sometimes with preview_site()
. I was closing and reopening RStudio completely each time too.
Is there a way to see the hugo server logs, or are those invisible? It would help pin down what's happening.
I have tried several times and was not able to reproduce it again.
How about setting these options in .Rprofile
?
options(
blogdown.use.processx = FALSE,
xfun.bg_process.verbose = TRUE
)
You may also check if there are any other stray hugo processes running and try to kill
them:
ps -A | grep 'hugo server'
Oh good, I got an error message finally. Something is causing hugo to panic:
Change detected, rebuilding site.
2020-10-15 22:24:22.713 -0400
Source changed "/Users/andrew/Desktop/testing/content/post/2015-07-23-r-rmarkdown/index_files/figure-html/log-duration-histogram-1.png": CREATE
Source changed "/Users/andrew/Desktop/testing/content/post/2015-07-23-r-rmarkdown/index_files/figure-html/log-duration-before-after-histogram-1.png": CREATE
Total in 0 ms
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4af0326]
goroutine 16 [running]:
github.com/gohugoio/hugo/hugolib.(*pageMaps).withMaps(0x0, 0xc000f8f2c0, 0x1, 0xc000f8f2b0)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:772 +0x26
github.com/gohugoio/hugo/hugolib.(*pageMaps).walkBundles(0x0, 0xc000f8f2b0)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:754 +0x61
github.com/gohugoio/hugo/hugolib.(*HugoSites).resetPageStateFromEvents(0xc0004d08c0, 0xc000fac8a0)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites.go:908 +0x65
github.com/gohugoio/hugo/hugolib.(*Site).processPartial(0xc0000d5680, 0xc000f96840, 0xc000e35730, 0xc000f92f00, 0x4, 0x4, 0xc000e355c0, 0x40cb711)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/site.go:1095 +0x955
github.com/gohugoio/hugo/hugolib.(*HugoSites).process(0xc0004d08c0, 0xc000f96840, 0xc000e35730, 0xc000f92d80, 0x4, 0x4, 0x69e3de0, 0x300000001)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:224 +0x99
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2.2()
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:102 +0x64
runtime/trace.WithRegion(0x5c8bb60, 0xc000fac7b0, 0x584baad, 0x7, 0xc000e35758)
/usr/local/Cellar/go/1.14/libexec/src/runtime/trace/annotation.go:137 +0xfe
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2(0x69e3de0, 0xc000f8f101)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:104 +0x162
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func3()
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:121 +0x2f
runtime/trace.WithRegion(0x5c8bb60, 0xc000fac7b0, 0x584ba4b, 0x7, 0xc000e35900)
/usr/local/Cellar/go/1.14/libexec/src/runtime/trace/annotation.go:137 +0xfe
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc0004d08c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000fac780, 0x0, 0xc000f92d80, ...)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:123 +0x904
github.com/gohugoio/hugo/commands.(*commandeer).rebuildSites(0xc000867860, 0xc000f92d80, 0x4, 0x4, 0x0, 0x0)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/commands/hugo.go:741 +0x407
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents(0xc000867860, 0xc000a6f200, 0xc000095fa0, 0xc000226c00, 0x20, 0x20, 0xc0000a1e30)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/commands/hugo.go:1106 +0x764
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1(0xc000a6f200, 0xc000867860, 0xc000095fa0, 0xc0000a1e30)
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/commands/hugo.go:848 +0x1d8
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
/private/tmp/hugo-20200315-13671-ect7cm/hugo-0.67.1/src/github.com/gohugoio/hugo/commands/hugo.go:844 +0x293
I know nothing about Go, so I can't do anything about it. Does this happen to other Hugo versions? You probably know that you can install multiple versions of Hugo now, and can switch among them via options(blogdown.hugo.version =)
in .Rprofile
.
Upgrading to Hugo 0.76.5 seems to maybe have fixed it? I can't get it to trigger the crash like I did before. Now to fix my class website templates to handle all the breaking Hugo changes :)
Okay. Good to know that v0.67.1 might happen to be buggy. Once you find a version that works, you can pin the version in the option blogdown.hugo.version
, so your website will not be affected by future Hugo updates.
I've spent all morning working with auto-generation and there have been no crashes, so this can probably just get closed. Thanks!
Awesome! Thanks for the report and test!
FYI I just noticed that your section headers had double anchors (on mouse over): https://evalf20.classes.andrewheiss.com/example/rdd/ We had a mechanism to prevent that in rmarkdown, but it failed for some reason in your post. I'll look into it.
Should be fixed in the dev version of rmarkdown now:
remotes::install_github('rstudio/rmarkdown')
Oh cool! I ended up adding this to an _output.yaml
in all my content subdirectories to turn off rmarkdown's anchoring, since hugo-academic does it automatically:
blogdown::html_page:
anchor_sections: false
Now I'll go remove those all :)
Also, rmarkdown auto adds the anchors in xaringan now too, so I added anchor_sections: false
to the YAML in my sldies, since anchoring isn't really necessary there (but that's probably for a new issue in rmarkdown or xaringan)
I've disabled it in xaringan a couple of days ago: https://github.com/yihui/xaringan/commit/8c921da8001a58279ba9a3c057c67c182df6dff3 I've submitted new versions of rmarkdown and xaringan to CRAN this afternoon.
Oh perfect! I'll take all those YAML options out now too :)
In the latest version of blogdown (856b50bba9479156fe5c031632d71b98f71f2285), the Hugo server stops working after knitting a file if
blogdown.serve_site.startup
andblogdown.knit.on_save
are both set to FALSE in the options.Here's how to recreate the bug (can't do a single reprex here since it involves multiple steps):
Make clean new site with
blogdown::new_site()
Add
.Rprofile
to the project folder with this content:Restart R so that it picks up the new options and doesn't automatically start the server
Run either
blogdown:::serve_site()
(or use RStudio add-in menu) to start the server (or withblogdown:::preview_site()
)Edit one of the default R Markdown files and knit with ⌘⇧K (or button in RStudio)
Server at localhost:4321 (or whatever port the daemon is using) silently stops:
Here's my session info:
By filing an issue to this repo, I promise that
xfun::session_info('blogdown')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/blogdown')
.