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

Github Actions Error #7

Open
howardbaik opened this issue Jun 4, 2024 · 5 comments
Open

Github Actions Error #7

howardbaik opened this issue Jun 4, 2024 · 5 comments

Comments

@howardbaik
Copy link
Contributor

I am helping @kweav with this GHA error. I've identified the source of the error to be running these lines of GHA code, which leads us to this line from the make_screenshots.R script (from ottr-reports), which runs ottrpal::get_chapters().

This line throws the error that we see in the GHA: https://github.com/jhudsl/ottrpal/blob/5d44949ef35f9dc258a3c27ff8775d41bc966deb/R/bookdown_to_leanpub.R#L437

Instead of supplying docs/index.html, I think we should just provide it the url to the index.html, which in our case is https://hutchdatascience.org/bench_to_bytes/index.html.

What do you think @cansavvy ?

@cansavvy
Copy link

cansavvy commented Jun 4, 2024

It's unclear from the documentation but it's supposed to be able to be used either way. It shouldn't matter whether a local index file or an index file from online is provided. But if both methods aren't working then we should try to fix that.

@howardbaik
Copy link
Contributor Author

I tried to avoid using a local index file by using the online index file. The reason is the GHA seems to specify the working directory as /__w/bench_to_bytes/bench_to_bytes, and I wasn't sure what to make of this path.

@cansavvy
Copy link

cansavvy commented Jun 5, 2024

Did some pair programming with Howard.

I am pretty sure this has to do with whether or not the pages were published yet (or if credentials are up to date) Essentially if this part in make_screenshots.R doesn't retireve a pages url then it will make it look like ottrpal::get_chapters() failed because an NA will be passed to it:

if (is.null(opt$base_url)) {
  base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat)
  base_url <- gsub("/$", "", base_url)
}

chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/"))

Howard thinks this may not be the cause of the error and is going to look into it.

@kweav
Copy link
Contributor

kweav commented Jun 5, 2024

I don't think pages was set up when I first merged the PR, but I set it up before I reran the jobs.

@howardbaik
Copy link
Contributor Author

howardbaik commented Jun 6, 2024

I have created a dummy repo here and have been experimenting with the problematic GHAs.

First, I got the usual git error from the Render bookdown job:

error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

After I managed to solve all these issues, I ran into a different type of error from Run the screenshot creation :

Error in webshot::webshot(url, file_name) : 
  webshot.js returned failure value: 1

It seemed like we need to set force = TRUE inside webshot::install_phantomjs(), but that still doesn't fix this error message.

I wonder if we need to setup the pages first before running webshot::webshot()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants