Closed hadley closed 6 years ago
Please see if the development version provides more useful information:
devtools::install_github('rstudio/blogdown')
It should be rare to run into this error (since Hugo is pretty fast and should normally only take one or two seconds to build the site).
That didn't print anything extra that was helpful (I'm trying to build the rstudio blog, so I assume it's some config issue on my computer)
Running the command at the console suggests that it's because my hugo doesn't support --navigateToChanged
— instead it prints an error message and lists all the options.
I see. In that case, you need to blogdown::update_hugo()
.
Right, but there should be some prompt to do that, either by checking the installed version of hugo (on load maybe?) or by making sure that the hugo failure is shown in the R session (currently it only shows up as a timeout which suggest there's something that you should be checking but aren't)
I tried to show the detailed error message from Hugo but I don't know why it was not displayed (need to investigate processx further but don't have time): https://github.com/rstudio/blogdown/blob/571078cc0906c580af0fef8bc1e20d6f3ea399c9/R/serve.R#L101
You ran into this issue because I set the (less well-known) --navigateToChanged
argument in the RStudio blog repo, and you are an early user of blogdown (hence installed an early version of Hugo lower than 0.25). Most users probably will never run into this issue.
At a minimum, you should be checking for $is_alive()
in your loop, and probably also $get_exit_status()
. I'd recommend talking to @gaborcsardi about the correct way to write this loop. I realise that this particular case is not a common failure mode, but writing the process code correctly will make a wide class of failures much more informative.
Yeah, I am happy to help. E.g. if hugo writes sg on the standard output when it is ready, we can simply detect that. And if it fails, then we can just print the standard output and standard error to the screen.
This will also be a good use case that can go into the processx/callr README.
Hi all,
I think I've just run into this error too --- and in my case the problem is definitely the --navigateToChanged
option. In fact, the error has never occurred to me but today (after updating to R 4.0.3
in Ubuntu), I'm getting some extra messages when I run blogdown::serve_site()
:
--------------------------------------------------------------------------------
You are recommended to ignore more items in the 'ignoreFiles' field in config.toml: "\\.knit\\.md$", "\\.utf8\\.md$"
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
You are recommended to remove the item '_files$' in the 'ignoreFiles' field in config.toml.
--------------------------------------------------------------------------------
Launching the server via the command:
hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t academic -D -F --navigateToChanged
then after about 30 secs, the process stops with an error
Error: It took more than 30 seconds to launch the server. There may be something wrong. The process has been killed. If the site needs more time to be built and launched, set options(blogdown.server.timeout) to a larger value.
If I try running the hugo
command from outside R
and without the --navigateToChanged
option, all works OK though... I did update hugo
with blogdown::update_hugo()
and blogdown
with devtools::install_github('rstudio/blogdown')
, but I still can't make it work from R
...
Am I missing something obvious? Thanks
@giabaio The --navigateToChanged
argument is added by default only if your Hugo version is >= 0.25, and I think it is unlikely that this argument could be the problem (your Hugo version must be greater than 0.25, otherwise blogdown won't add this argument). How did you install Hugo? For Ubuntu, neither apt
nor snap
is recommended for installing Hugo: https://gohugo.io/getting-started/installing/#linux And you are recommended to use blogdown::install_hugo()
to install Hugo from its Github releases.
Thanks, @yihui The weird thing is that I've never got this error before, nor has blogdown ever "talked" to me to tell me what Hugo command it was running in the background. (I'm on the latest Hugo version, which I think is 0.76).
But you're right that actually running the Hugo command (even with the `--navigateToChanged`` argument at the end) does work from command line, but not from R/blogdown.
I can't remember how I installed Hugo in the first place, but I've now removed and re-installed using blogdown::install_hugo()
and the problem doesn't seem to go away...
I mean I can modify my R script to run Hugo from system so it's not a great problem for me, but I'm just not sure what the issue is... Also, what I can do is to run blogdown on my other two sites to see if there's anything specific to the one I'm trying to update now, or whether it's more than that... Also, I've got another Ubuntu distro with a version of R < 4.0.3 and I can check whether that makes a difference too...
Thanks for your prompt response!
Quick update --- seem to NOT work for my other websites too...
@giabaio That's really weird. Could you try blogdown::hugo_cmd('server')
and see if it throws an error?
Seems to be doing OK...
> blogdown::hugo_cmd('server')
Start building sites …
| EN
-------------------+-------
Pages | 1635
Paginator pages | 209
Non-page files | 248
Static files | 106
Processed images | 28
Aliases | 62
Sitemaps | 1
Cleaned | 0
Built in 1793 ms
Watching for changes in /home/gianluca/Dropbox/Rstuff/Website/{assets,content,data,layouts,static,themes}
Watching for config changes in /home/gianluca/Dropbox/Rstuff/Website/config.toml, /home/gianluca/Dropbox/Rstuff/Website/config/_default
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/gianluca/ (bind address 127.0.0.1)
Press Ctrl+C to stop
The only thing that's really changed since my last update of the site (8th Oct) is the R version, I think... Like you say, weird --- at least as far as I can make up... I can make the whole site available of GitHub if it helps you...
Web Server is available at http://localhost:1313/gianluca/ (bind address 127.0.0.1)
@giabaio Oh I think I know what's going on now. You had a baseURL
setting. That's my oversight and will fix it soon. Sorry about that. Actually this might be a Hugo bug: https://github.com/gohugoio/hugo/issues/7823
@yihui Thanks --- yes: in fact blogdown works fine with my other site that doesn't have a baseURL
but fails for the other two that do...
Thanks for your help!
@giabaio Should be fixed now. You can install the development version via
remotes::install_github('rstudio/blogdown')
Note that if you have This is no longer necessary.baseURL
in the config file, it needs to contain the full domain (e.g., https://www.example.org/sub/path/
instead of /sub/path/
).
Thanks!
Thank you @yihui --- I think now all seems to be working! I may have to fiddle with the git ftp command to update the server, but locally all seems good. Much appreciated!
Thanks! Using the GitHub version also helped me resolve a similar issue with a site that also has a baseURL
. This solution allowed me to render this post.
## From config/_default/config.toml that is symlinked from config.toml
baseurl = "http://LieberInstitute.github.io/rstatsclub/"
Error:
> blogdown:::preview_site(startup = TRUE)
Launching the server via the command:
hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-academic -D -F --navigateToChanged
Error: It took more than 30 seconds to launch the server. There may be something wrong. The process has been killed. If the site needs more time to be built and launched, set options(blogdown.server.timeout) to a larger value.
## Tried the following after finding this thread
> blogdown::hugo_cmd('server')
Building sites …
| EN
-------------------+-----
Pages | 88
Paginator pages | 2
Non-page files | 10
Static files | 83
Processed images | 33
Aliases | 22
Sitemaps | 1
Cleaned | 0
Built in 756 ms
Watching for changes in /Users/lcollado/Dropbox/Code/libdcode/rstatsclubsource/{archetypes,assets,content,data,layouts,static,themes}
Watching for config changes in /Users/lcollado/Dropbox/Code/libdcode/rstatsclubsource/config.toml, /Users/lcollado/Dropbox/Code/libdcode/rstatsclubsource/config/_default
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/rstatsclub/ (bind address 127.0.0.1)
Press Ctrl+C to stop
## Then I installed the GitHub version
> remotes::install_github('rstudio/blogdown')
This is the final working R session info.
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.0.2 Patched (2020-09-12 r79195)
os macOS Catalina 10.15.7
system x86_64, darwin17.0
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/New_York
date 2020-10-21
─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
backports 1.1.10 2020-09-15 [1] CRAN (R 4.0.2)
blogdown 0.21.19 2020-10-21 [1] Github (rstudio/blogdown@1a7ad52)
bookdown 0.21 2020-10-13 [1] CRAN (R 4.0.2)
callr 3.5.1 2020-10-13 [1] CRAN (R 4.0.2)
cli 2.1.0 2020-10-12 [1] CRAN (R 4.0.2)
colorout * 1.2-2 2020-05-18 [1] Github (jalvesaq/colorout@726d681)
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0)
devtools * 2.3.2 2020-09-18 [1] CRAN (R 4.0.2)
digest 0.6.26 2020-10-17 [1] CRAN (R 4.0.2)
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.2)
httpuv 1.5.4 2020-06-06 [1] CRAN (R 4.0.2)
jsonlite 1.7.1 2020-09-07 [1] CRAN (R 4.0.2)
knitr 1.30 2020-09-22 [1] CRAN (R 4.0.2)
later 1.1.0.1 2020-06-05 [1] CRAN (R 4.0.2)
magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2)
pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.2)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.2)
promises 1.1.1 2020-06-09 [1] CRAN (R 4.0.2)
ps 1.4.0 2020-10-07 [1] CRAN (R 4.0.2)
R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.2)
remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2)
rlang 0.4.8 2020-10-08 [1] CRAN (R 4.0.2)
rmarkdown 2.5 2020-10-21 [1] CRAN (R 4.0.2)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
servr 0.20 2020-10-19 [1] CRAN (R 4.0.2)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
testthat * 2.3.2 2020-03-02 [1] CRAN (R 4.0.0)
usethis * 1.6.3 2020-09-17 [1] CRAN (R 4.0.2)
withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.2)
xfun 0.18 2020-09-29 [1] CRAN (R 4.0.2)
yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)
[1] /Library/Frameworks/R.framework/Versions/4.0branch/Resources/library
$ hugo version
Hugo Static Site Generator v0.74.3/extended darwin/amd64 BuildDate: unknown
Hi @yihui, I seem to be having the same issue described in this thread, but I have not managed to fix it.
Even after using: remotes::install_github('rstudio/blogdown')
I still run into the following issue when running "blogdown::serve_site()":
Launching the server via the command: C:\Users\Master\AppData\Roaming\Hugo\hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-future-imperfect -D -F --navigateToChanged ERROR: The process "10244" not found. Error: It took more than 30 seconds to launch the server. There may be something wrong. The process has been killed. If the site needs more time to be built and launched, set options(blogdown.server.timeout) to a larger value.
Is there another way to fix this?
Thanks!
I have no idea what went wrong here and no obvious way to find out