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

Errors received when using webshot2 (timeout and callback) #43

Open
charleswidnall opened this issue Sep 23, 2022 · 0 comments
Open

Errors received when using webshot2 (timeout and callback) #43

charleswidnall opened this issue Sep 23, 2022 · 0 comments

Comments

@charleswidnall
Copy link

I run webshot2 (v 0.1.0) on hundreds of images that I generate and I store the output in my hard disk, a few times per day. Some days it runs fine, but other days it stops with the following message: Error: Chromote: timed out waiting for event Page.loadEventFired.

Thinking that it would be solved by increasing the delay, I changed it from 1 to 2, yesterday. However, today, after running successfully some 300 times, I received a new error message: Error in deregister_callback_fn(): could not find function "deregister_callback_fn". I include both tracebacks below. I cannot reproduce the event that creates the errors (I ran webshot2 10,000 times yesterday and it didn't issue any of the two errors. I include the code below, too.)

If you could provide some guidance on how to set the delay or any other modification you could think about, it would be appreciated.

Tracebacks
The 2nd traceback is exactly the same as the 1st one, except for the change in delay from delay = 1 to delay = 2.

Error: Chromote: timed out waiting for event Page.loadEventFired

12. stop(value)
11. doTryCatch(return(expr), name, parentenv, handler)
10. tryCatchOne(expr, names, parentenv, handlers[[1L]])
 9. tryCatchList(expr, classes, parentenv, handlers)
 8. tryCatch({
        result <- force(expr)
        if (is.promising(result)) {
            value <- NULL ...
 7. force(expr)
 6. domain$wrapSync(expr)
 5. with_promise_domain(domain, {
        tryCatch({
            result <- force(expr)
            if (is.promising(result)) { ...
 4. synchronize(p, loop = private$child_loop)
 3. cm$wait_for(p)
 2. webshot2::webshot(ret_url,
                      paste0("../images/webshot_", tinput,
                             "_600x345.png"), vwidth = 600, vheight = 345, delay = 1) at plotnow1_1_xxx.R#453
 1. create_save_screenshot(tinput)

Error in deregister_callback_fn() :
could not find function "deregister_callback_fn"

12. stop(value)
11. doTryCatch(return(expr), name, parentenv, handler)
10. tryCatchOne(expr, names, parentenv, handlers[[1L]])
9. tryCatchList(expr, classes, parentenv, handlers)
8. tryCatch({
        result <- force(expr)
        if (is.promising(result)) {
            value <- NULL ...
7. force(expr)
6. domain$wrapSync(expr)
5. with_promise_domain(domain, {
        tryCatch({
            result <- force(expr)
            if (is.promising(result)) { ...
4. synchronize(p, loop = private$child_loop)
3. cm$wait_for(p)
2. webshot2::webshot(ret_url,
                     paste0("../images/webshot_", tinput,
                            "_600x345.png"), vwidth = 600, vheight = 345, delay = 2) at plotnow1_1_xxx.R#453
1. create_save_screenshot(tinput)

Test
However, it doesn't reproduce the problem.

library(webshot2)
for(i in 1:10000){
  webshot2::webshot("https://github.com/rstudio/shiny/tree/main/tests",
                    file = "test.png",
                    vwidth = 600, vheight = 345, delay = 0.2)
  print(paste0(i, " - ", Sys.time()))
}
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

1 participant