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

Dynamic file error when file previously did not exist #1324

Closed
4 tasks done
shirdekel opened this issue Sep 22, 2020 · 2 comments
Closed
4 tasks done

Dynamic file error when file previously did not exist #1324

shirdekel opened this issue Sep 22, 2020 · 2 comments

Comments

@shirdekel
Copy link

Prework

  • Read and abide by drake's code of conduct.
  • Search for duplicates among the existing issues, both open and closed.
  • Be considerate of the maintainer's time and make it as easy as possible to troubleshoot any problems you identify. Read here and here to learn about minimal reproducible examples. Format your code according to the tidyverse style guide to make it easier for others to read.
  • If you think your issue has a quick and definite solution, consider posting to Stack Overflow under the drake-r-package tag. (If you anticipate extended follow-up and discussion, you are already in the right place!)

Description

When running my plan, I get the following error:

> make(the_plan)
Error in if (trigger_format_file(target, meta, config)) { : 
  missing value where TRUE/FALSE needed

I know that it comes from a dynamic file target (with static branching), that the file (in this case a directory, actually) previously didn't exist, and that the error is fixed when I change the target name. When I investigate the error (at trigger_format_file()), the issue seems to be that that hash_old <- meta_old$format_file_hash evaluates to NA, in turn because meta_old$format_file_hash is NA. Unfortunately I've been struggling to create a reprex, because I don't know enough about the internals of drake to work out how to get to meta_old. And also the below example works, even though the file doesn't exist:

library(drake)

plan <- 
  drake_plan(
  x = target(
    file.path(tempdir(), "x"),
    target = "file"
  )
)

make(plan)
#> ℹ Consider drake::r_make() to improve robustness.
#> ▶ target x

Created on 2020-09-22 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.2 (2020-06-22)
#>  os       macOS Mojave 10.14.6        
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_AU.UTF-8                 
#>  ctype    en_AU.UTF-8                 
#>  tz       Australia/Sydney            
#>  date     2020-09-22                  
#> 
#> ─ 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)                 
#>  base64url     1.4         2018-05-14 [1] CRAN (R 4.0.0)                 
#>  callr         3.4.4       2020-09-07 [1] CRAN (R 4.0.2)                 
#>  cli           2.0.2       2020-02-28 [1] CRAN (R 4.0.0)                 
#>  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.0       2020-04-10 [1] CRAN (R 4.0.0)                 
#>  digest        0.6.25      2020-02-23 [1] CRAN (R 4.0.0)                 
#>  drake       * 7.12.5.9000 2020-09-22 [1] Github (ropensci/drake@9fb42f5)
#>  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)                 
#>  filelock      1.0.2       2018-10-05 [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)                 
#>  highr         0.8         2019-03-20 [1] CRAN (R 4.0.0)                 
#>  hms           0.5.3       2020-01-08 [1] CRAN (R 4.0.0)                 
#>  htmltools     0.5.0       2020-06-16 [1] CRAN (R 4.0.0)                 
#>  igraph        1.2.5       2020-03-19 [1] CRAN (R 4.0.0)                 
#>  knitr         1.29        2020-06-23 [1] CRAN (R 4.0.2)                 
#>  lifecycle     0.2.0       2020-03-06 [1] CRAN (R 4.0.0)                 
#>  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)                 
#>  pillar        1.4.6       2020-07-10 [1] CRAN (R 4.0.1)                 
#>  pkgbuild      1.1.0       2020-07-13 [1] CRAN (R 4.0.2)                 
#>  pkgconfig     2.0.3       2019-09-22 [1] CRAN (R 4.0.0)                 
#>  pkgload       1.1.0       2020-05-29 [1] CRAN (R 4.0.0)                 
#>  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)                 
#>  progress      1.2.2       2019-05-16 [1] CRAN (R 4.0.0)                 
#>  ps            1.3.4       2020-08-11 [1] CRAN (R 4.0.2)                 
#>  purrr         0.3.4       2020-04-17 [1] CRAN (R 4.0.0)                 
#>  R6            2.4.1       2019-11-12 [1] CRAN (R 4.0.0)                 
#>  remotes       2.1.1       2020-02-15 [1] CRAN (R 4.0.0)                 
#>  rlang         0.4.7       2020-07-09 [1] CRAN (R 4.0.1)                 
#>  rmarkdown     2.3         2020-06-18 [1] CRAN (R 4.0.0)                 
#>  rprojroot     1.3-2       2018-01-03 [1] CRAN (R 4.0.0)                 
#>  sessioninfo   1.1.1       2018-11-05 [1] CRAN (R 4.0.0)                 
#>  storr         1.2.1       2018-10-18 [1] CRAN (R 4.0.0)                 
#>  stringi       1.5.3       2020-09-09 [1] CRAN (R 4.0.2)                 
#>  stringr       1.4.0       2019-02-10 [1] CRAN (R 4.0.0)                 
#>  testthat      2.3.2       2020-03-02 [1] CRAN (R 4.0.0)                 
#>  tibble        3.0.3       2020-07-10 [1] CRAN (R 4.0.1)                 
#>  tidyselect    1.1.0       2020-05-11 [1] CRAN (R 4.0.0)                 
#>  txtq          0.2.3       2020-06-23 [1] CRAN (R 4.0.2)                 
#>  usethis       1.6.1       2020-04-29 [1] CRAN (R 4.0.0)                 
#>  vctrs         0.3.4       2020-08-29 [1] CRAN (R 4.0.2)                 
#>  withr         2.2.0       2020-04-20 [1] CRAN (R 4.0.0)                 
#>  xfun          0.17        2020-09-09 [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.0/Resources/library

Any tips on how to further diagnose this?

@wlandau
Copy link
Member

wlandau commented Sep 22, 2020

Internally, it should be acceptable to have a NA file hash. Does fc917bd fix the issue?

@shirdekel
Copy link
Author

Yes it does, thanks!

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

No branches or pull requests

2 participants