-
Notifications
You must be signed in to change notification settings - Fork 86
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
Error: ‘inherits(future, "Future")’ is not TRUE #723
Comments
Sorry, I submitted this to the wrong repo. I guess I should have submitted to |
… "Future")' is not TRUE [#723]
I suspect your parallel worker crashes, because of the code you're running. That said, future should have given you another, more informative error message, but there is a typo/bug in future causing it to produce this error instead. I've fixed this in the develop branch. Can you please try by installing that version; if (requireNamespace("remotes")) install.packages("remotes")
remotes::install_github("HenrikBengtsson/future", ref="develop")
This is expected, because multisession futures inherits from cluster futures. Thanks |
Thanks for your response. Yes, the dev version does give a more helpful error now.
As to why that occurs, I am not sure. Do you? |
Thanks. Before troubleshooting further, could you make sure to update your R packages and retry, because several of your packages are outdated. It would be a waste of time to troubleshoot this just find out it has been fixed in some of the packages you use. |
Fair enough. I've done that and still get the same error. New session info:
|
There was a little bit more information in one of the errors just now:
I'm not sure what the purpose of that message is, but this doesn't seem to be a lot of memory. |
That's just a clue, in case there are large objects. It'll save some back a forth, when troubleshooting. See if you can reproduce this with fewer workers, e.g. What is odd, is that something is changing the connection of the main R process, invalidating it, resulting it not being able to talk to the parallel worker. What is the code you're running? |
Yes it still happens with workers = 2.
How was your question meant to finish? "What is the code you're running..." |
Are you saying the code in #723 produces this error? If so, then there must be something else going on too, because I cannot see how that could happen. Do you have a custom ~/.Rprofile file? Can you reproduce it when you run R via |
Hi @HenrikBengtsson, yes that is the minimal code to reproduce the error and is also why I am extremely confused! I do not have a custom I was also wondering if this is an RStudio issue. However, I had a 2023 version of RStudio with this issue occurring, and it persisted when I updated to the latest version. |
@sebsilas Did you try to run the MRE in a plain R terminal (so not in RStudio)? |
After trying multiple times, I haven't been able to reproduce the exact error. When I load the app, I get this error though, seeming to correspond to when the app would crash:
So this could be it, will try and resolve. |
Well, including the PATH variable to include |
Thank you. I can reproduce this, by taking your original example and reload the Shiny page frequently enough. It has to do with library(shiny)
library(promises)
future::plan(future::multisession) This is what https://rstudio.github.io/promises/articles/promises_06_shiny.html uses. (*) Futureverse is design to detect when you set the same I'll look into it, but I cannot promise anything soon. |
Thanks @HenrikBengtsson, but I've already tried this and it still produces the error. |
Here's the script that I used to replicate this. I can reproduce it if I set the plan within library(shiny)
library(promises)
library(future)
## Here and it'll work
plan(multisession, workers = 2)
ui <- fluidPage(
titlePanel("Promise fail")
)
server <- function(input, output, session) {
## Not here! Because that will trigger the error
## plan(multisession, workers = 2)
res <- promises::future_promise({
Sys.sleep(5)
"test_res"
}, seed = NULL) %...>% (function(result) {
print(result)
})
}
# Run the application
app <- shinyApp(ui = ui, server = server)
print(app) |
Ok, but just to confirm, I do still get this in RStudio with your script: futures_debug_2.mov |
?!? That is definitely not something the Futureverse is producing. It looks like you have problems with your RStudio setup. I would start by verifying it works in vanilla |
I see that this is now a movie that you uploaded to GitHub. I guess I looked at it too soon, and I literally saw the text "Uploading futures_debug_2.mov…" here in the issue tracker. |
Describe the bug
When I try to load a promise in the context of starting up a Shiny app, I get the following error:
Error: ‘inherits(future, "Future")’ is not TRUE
This doesn't happen consistently.
The traceback (see below) is interesting. It suggests my promise is of cluster type, even though I have used plan(multisession). If I explicitly set the plan when calling
future_promise
, I still get the same behaviour.Reproduce example
Expected behavior
I expect the promise not to fail.
Traceback
Session information
The text was updated successfully, but these errors were encountered: