-
Notifications
You must be signed in to change notification settings - Fork 64
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: [EACCES] Failed to copy - Permission denied #601
Comments
I can get the same error outside of a test without the library(pins)
b <- board_temp(version = TRUE)
pin_write(b, iris)
#> Using `name = 'iris'`
#> Guessing `type = 'rds'`
#> Creating new version '20220310T234720Z-ace06'
#> Writing to pin 'iris'
pin_write(b, iris)
#> Using `name = 'iris'`
#> Guessing `type = 'rds'`
#> Creating new version '20220310T234720Z-ace06'
#> Error: [EACCES] Failed to copy '/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpjHUpD9/iris.rds' to '/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpjHUpD9/pins-7ab33a326f35/iris/20220310T234720Z-ace06/iris.rds': permission denied Created on 2022-03-10 by the reprex package (v2.0.1) |
@juliasilge I have started looking into this issue; one thing to investigate is as to whether this issue you raise and the one I raise are in fact, the same issue. The purpose of |
Sincerest apologies @juliasilge - I spoke too soon! I believe these to be driven by the same issue, with your example showing actually much more clearly what's going on (for the first half of the issue, anyway). In your example, both of the ids were assigned to ## another example
library(pins)
b <- board_temp(version = TRUE)
pin_write(b, iris)
#> Using `name = 'iris'`
#> Guessing `type = 'rds'`
#> Creating new version '20220311T152649Z-44b86'
#> Writing to pin 'iris'
## check the path for where iris.rds now lives:
iris_path <- pin_meta(b, "iris")$local$dir
file.exists(file.path(iris_path, "iris.rds"))
#> [1] TRUE
## print out the file path
cat(iris_path, "\n")
#> /tmp/Rtmp6WM9qJ/pins-2aee99ad7f4/iris/20220311T152649Z-44b86
pin_write(b, iris)
#> Using `name = 'iris'`
#> Guessing `type = 'rds'`
#> Creating new version '20220311T152649Z-44b86'
#> Error: [EACCES] Failed to copy '/tmp/Rtmp6WM9qJ/iris.rds' to '/tmp/Rtmp6WM9qJ/pins-2aee99ad7f4/iris/20220311T152649Z-44b86/iris.rds': permission denied Created on 2022-03-11 by the reprex package (v2.0.1) It looks like the "permission denied" error comes about because it's trying to overwrite a file ( Now back to the original example, when I ran it outside of testthat, the IDs I was getting were library(testthat)
test_that("board_temp within testthat test", {
PINBOARD <- pins::board_temp(versioned = TRUE)
## write iris in once, as it is
pins::pin_write(PINBOARD, iris, "iris", versioned = TRUE)
Sys.sleep(2)
## this forces df1 to be a copy of iris
df1 <- iris
df1$Petal.Width <- df1$Petal.Width + 0
pins::pin_write(PINBOARD, df1, "iris", versioned = TRUE)
expect_true(TRUE)
})
#> Test passed 🥇 Created on 2022-03-11 by the reprex package (v2.0.1) Here's what I propose:
|
Thanks for your patience on this @minimenchmuncher! What do you think about the proposed error message in #727? |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
I'm attempting to wrap some of the functionality of pins, including versioning, within another package and so I am attempting to run some of of the pins within testthat. As part of that wrap, I'm trying to run tests using dummy data (here, just
iris
) and am getting an error message that permission was denied while copying the data.Reprex
Created on 2022-03-10 by the reprex package (v2.0.1)
Session info
What I'm attempting to do seems to work just fine run outside of the test, but does not work within
test_that
. I get the same error when this is part of a test suite and I usedevtools::test()
. Any assistance would be appreciated!The text was updated successfully, but these errors were encountered: