blogdown serve_site(), Hugo execution failed with error code 1

Hi, there,

I am tried to learn and use blogdown to build an academic website, by following this tweet thread: https://twitter.com/dsquintana/status/1139846569623281664?s=20

I could successfully build and run the website on my PC months ago but recently when I return to this project, I found the serve_site() does work.

the error message is as follow.

I tried to search for a solution but couldn't find one.

Below are my system information:

devtools::session_info()

  • Session info ---------------------------------------------------------------------------------------------
    setting value
    version R version 3.6.1 (2019-07-05)
    os Windows 10 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate English_United States.1252
    ctype English_United States.1252
    tz Europe/Berlin
    date 2019-11-26

  • Packages -------------------------------------------------------------------------------------------------
    package * version date lib source
    assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.1)
    backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1)
    blogdown 0.17 2019-11-13 [1] CRAN (R 3.6.1)
    bookdown 0.16 2019-11-22 [1] CRAN (R 3.6.1)
    callr 3.3.2 2019-09-22 [1] CRAN (R 3.6.1)

blogdown::hugo_version()
[1] ‘0.59.1’

Hi, and welcome!

At it's simplest, the function is trying to render a file in a non-existent path. Without a reproducible example, called a reprex , it's hard to say where this train went off the tracks.

I've run into my own share of problems with blogdown that I've found a way to troubleshoot. I create a test site locally following the guidance in the definitive source

1 Like

Hi, Richard,

Thanks for your reply.
I also thought that it might be the problem of path, because the ... in the error message was really odd to me.
I checked the path, there are many subfolders under the path myBlog\public\authors\, a folder name as "admin" is one of them. Is there any way that I can specify which folder should serve_site() use to build site?

About the reproducible example, I agree with you. But it's hard for me to provide that code, because basically serve_site() was the only code I run. I guess the only way to let others' to reproduce this error would be uploading the public folder to github. Do you have any suggestions?

Many thanks!

1 Like

I think that serve_site {blogdown} documentation suggests the folder is non-configurable. The signature is serve_site(...)

... Arguments passed to servr::httw() (arguments dir, site.dir, baseurl, and handler have been provided, hence you cannot customize these arguments).

I'd suggest confirming this by opening an issue at the github page and soliciting suggestions there if no one here comes to the rescue.

1 Like

@hcp4715 do you manage to build your website ? using blogdown::build_site(local = TRUE) ?

This is what serve_site is using.

I suspect the issue is not with serving the site but rather building it .

2 Likes

Hi, @cderv,

Thanks, just tried, the same error.

1 Like

That's really weird then, because there are folders.

That looks like a path error. Confirm their existence in the terminal?

Hi, @technocrat,
What did you mean by "their existence in the terminal"?
the current working directory is My_sites/myBlog/

image

1 Like

Sorry to be obscure.

From the terminal

 $ 516:  cat /Users/rc/projects/locus/content/post/index.html
---
site: blogdown:::blogdown_site
---
1 Like

Hi, @technocrat,

Sorry I not sure I understand.

Did you mean that I should click the terminal window of R studio, and input cat /Users/rc/projects/locus/content/post/index.html? And then run serve_site().

That's what I've just done (changed the path of index.html to mine), but it didn't change anything.

Forgive my inexperience. When using R, I only used Console of Rstudio (and also I run blogdown on a windows system).

Would you just give a bit more instructions? e.g., which terminal I should use, or with file I should edit?

thanks a lot!

Sorry to be obscure again, and Unix-centric to boot.

The goal is to confirm the existence and location of the file identified in the error message. cat is just one tool to do that. However you do it in Windows normally will work just as well.

1 Like

Hi, thanks.
I run the code (see below), but the problem persists.

OK, I'm now officially stumped. @cderv ?

This seems like a path issue. You have ... before index.html in your error. The path you test for existence is not the same.

It is not easy for us without seeing the all website. Can you share your source code in a GH repo or similar?

I would check all the conf in your config file. Also you can try to use hugo at the command line to see if it is R which is meddling with the path.

I really don't know why this dots are added. That must be a hugo behavior that I am currently missing.

1 Like

Hi, @cderv

Thanks a lot, which part of the site should I upload? The whole folder that including all files (which includes config, content, 'public', and other subfolders), or just the folder public?

I think this is the source folder which is interesting as you can"t build it currently

I see.
Here is the github repo: https://github.com/hcp4715/blogdown_trial
I think I uploaded all the files in my folder.
Thanks for taking your time.

Just a wild guess: maybe some issues with authors folder that contains some dots like
https://github.com/hcp4715/blogdown_trial/tree/master/public/authors/blomster-j.-k

public/authors/blomster-j.-k

maybe hugo can't access those folder with a . in the name

Does that mean, all names in the authors' folder should avoid . ?
But Actually I didn't create these folders, these were automatically added when I added information of papers.