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

Recent version of fs causing problems in pins #364

Closed
juliasilge opened this issue Dec 9, 2021 · 9 comments
Closed

Recent version of fs causing problems in pins #364

juliasilge opened this issue Dec 9, 2021 · 9 comments

Comments

@juliasilge
Copy link
Member

I am having trouble with the most recent versions of fs together with pins.

With fs 1.5.0:

library(pins)

b <- board_rsconnect()
#> Connecting to RSC 2021.11.1 at <https://colorado.rstudio.com/rsc>
b %>% pin_meta("julia.silge/mtcars")
#> List of 10
#>  $ file       : chr "mtcars.rds"
#>  $ file_size  : 'fs_bytes' int 1.19K
#>  $ pin_hash   : chr "5a338159141e2a0b"
#>  $ type       : chr "rds"
#>  $ title      : chr "mtcars: a pinned 32 x 11 data frame"
#>  $ description: NULL
#>  $ created    : POSIXct[1:1], format: "2021-12-09 09:56:00"
#>  $ api_version: num 1
#>  $ user       : list()
#>  $ local      :List of 4
#>   ..$ dir       : 'fs_path' chr "~/Library/Caches/pins/rsc-e62371cfd77db754024f9c5ed3556a73/b6b87680-1005-47f9-97f0-5f2c83baca82/51486"
#>   ..$ url       : chr "https://colorado.rstudio.com/rsc/content/b6b87680-1005-47f9-97f0-5f2c83baca82/_rev51486/"
#>   ..$ version   : chr "51486"
#>   ..$ content_id: chr "b6b87680-1005-47f9-97f0-5f2c83baca82"

Created on 2021-12-09 by the reprex package (v2.0.1)

With fs 1.5.1:

library(pins)

b <- board_rsconnect()
#> Connecting to RSC 2021.11.1 at <https://colorado.rstudio.com/rsc>
b %>% pin_meta("julia.silge/mtcars")
#> Error: [EEXIST] Failed to copy '/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpkNnQ8q/file8f3123af0cae' to '/Users/juliasilge/Library/Caches/pins/rsc-e62371cfd77db754024f9c5ed3556a73/b6b87680-1005-47f9-97f0-5f2c83baca82/51486/data.txt': file already exists

Created on 2021-12-09 by the reprex package (v2.0.1)

I believe (based on stepping through this via debugonce()) that the problem is with fs::dir_create(cache_path) in the pin_meta methods for Connect, Azure, etc.

cc @hadley

@hadley
Copy link
Member

hadley commented Dec 9, 2021

This is probably #325, so try installing latest latest fs?

@juliasilge
Copy link
Member Author

Ah yep, you are right. Fantastic! 🙌

@kmasiello
Copy link

Still seeing issues with this, despite using fs v 1.5.2.

Reprex:

library(pins)
board2 <- board_url(c("penguins" = "https://colorado.rstudio.com/rsc/example_pin/", 
                      "katiemtcars" = "https://colorado.rstudio.com/rsc/content/f88b195a-eefd-42a4-a219-1efe63169cbf/")
)
pin_read(board2, "penguins")
#> Error: [EACCES] Failed to copy '/var/folders/y7/hjp2x8fx2gjc_qfz9yyn2wm00000gn/T/RtmpLiGXwl/filed6809d3ee14' to '/Users/katie/Library/Caches/pins/url/f959e41b9bc2c3a1e7692037f23c9f99/data.txt': permission denied
pin_read(board2, "katiemtcars")
#> Error: [EACCES] Failed to copy '/var/folders/y7/hjp2x8fx2gjc_qfz9yyn2wm00000gn/T/RtmpLiGXwl/filed68038b36816' to '/Users/katie/Library/Caches/pins/url/ac76a5e4027cb2904d44fe54b0ebc1b8/data.txt': permission denied

sessionInfo:

sessionInfo()
#> R version 4.0.2 (2020-06-22)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS  10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] knitr_1.36        magrittr_2.0.1    R.cache_0.15.0    rlang_0.4.12     
#>  [5] fastmap_1.1.0     fansi_0.5.0       stringr_1.4.0     styler_1.6.2     
#>  [9] highr_0.9         tools_4.0.2       xfun_0.28         R.oo_1.24.0      
#> [13] utf8_1.2.2        withr_2.4.3       htmltools_0.5.2   ellipsis_0.3.2   
#> [17] yaml_2.2.1        digest_0.6.28     tibble_3.1.6      lifecycle_1.0.1  
#> [21] crayon_1.4.2      purrr_0.3.4       R.utils_2.11.0    vctrs_0.3.8      
#> [25] fs_1.5.2          glue_1.5.1        evaluate_0.14     rmarkdown_2.11   
#> [29] reprex_2.0.1      stringi_1.7.5     compiler_4.0.2    pillar_1.6.4     
#> [33] backports_1.2.1   R.methodsS3_1.8.1 pkgconfig_2.0.3

@juliasilge
Copy link
Member Author

I installed to the current dev version from GitHub and then I was OK.

@kmasiello
Copy link

no luck :(
doesn't work with fs 1.5.2 or 1.5.2.9000

@hadley
Copy link
Member

hadley commented Dec 10, 2021

Your reprex works for me with CRAN fs and dev pins:

library(pins)
board2 <- board_url(c("penguins" = "https://colorado.rstudio.com/rsc/example_pin/", 
                      "katiemtcars" = "https://colorado.rstudio.com/rsc/content/f88b195a-eefd-42a4-a219-1efe63169cbf/")
)
pin_read(board2, "penguins")
#> # A tibble: 344 × 8
#>    species island    bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
#>    <fct>   <fct>              <dbl>         <dbl>             <int>       <int>
#>  1 Adelie  Torgersen           39.1          18.7               181        3750
#>  2 Adelie  Torgersen           39.5          17.4               186        3800
#>  3 Adelie  Torgersen           40.3          18                 195        3250
#>  4 Adelie  Torgersen           NA            NA                  NA          NA
#>  5 Adelie  Torgersen           36.7          19.3               193        3450
#>  6 Adelie  Torgersen           39.3          20.6               190        3650
#>  7 Adelie  Torgersen           38.9          17.8               181        3625
#>  8 Adelie  Torgersen           39.2          19.6               195        4675
#>  9 Adelie  Torgersen           34.1          18.1               193        3475
#> 10 Adelie  Torgersen           42            20.2               190        4250
#> # … with 334 more rows, and 2 more variables: sex <fct>, year <int>
pin_read(board2, "katiemtcars")
#>                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
#> Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
#> Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
#> Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
#> Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
#> Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
#> Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1

Created on 2021-12-10 by the reprex package (v2.0.1)

@jennybc
Copy link
Member

jennybc commented Dec 10, 2021

FWIW @kmasiello your error is Error: [EACCES] Failed to copy ... permission denied whereas the errors about expanding ~/ were different.

@kmasiello
Copy link

Curious @hadley if the reprex works for you repeatedly. @ivelasq and I have both experienced it failing after successive tries. In one instance, it would read repeatedly just fine, but then fail once the board_url() call was rerun.
If this is pointing to something besides fs, I'm happy to move the thread to another repo.

@kmasiello
Copy link

solved with dev version of pins 1.0.0.9000 🎉

@r-lib r-lib locked as resolved and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants