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

conflicts = "overwrite" not working #126

Closed
timriffe opened this issue Jun 26, 2020 · 7 comments
Closed

conflicts = "overwrite" not working #126

timriffe opened this issue Jun 26, 2020 · 7 comments

Comments

@timriffe
Copy link

timriffe commented Jun 26, 2020

Hi,
I'm unable to overwrite files in my OSF repo https://osf.io/mpwjq/, can I get a tip on what to change in the code?

target_dir <- osf_retrieve_node("mpwjq") %>% 
    osf_ls_files(pattern = "Data") 
  
write.csv(subset(iris, Species != "setosa"), file = "test.csv")
  
# Works:
  target_dir %>%
    osf_upload("test.csv", conflicts = "overwrite")
# # A tibble: 1 x 3
# name     id                       meta            
#  <chr>    <chr>                    <list>          
# 1 test.csv 5ef5b073761b2c00715ca35b <named list [3]>
  
# Doesn't work:
target_dir %>%
    osf_upload("test.csv", conflicts = "overwrite")

# Error: Cannot complete action: file or folder "test.csv" already exists in this location
#       HTTP status code 409.

What other details would be helpful to provide to troubleshoot this?
Many thanks,
Tim

@cimentadaj
Copy link

I think this is similar to #121

@aaronwolen
Copy link
Member

Thanks @timriffe. @cimentadaj is right, this is a long-standing bug. I should have a fix for you to test by next week.

@aaronwolen
Copy link
Member

BTW, a workaround is to upload the files to the root of the project (ie, not within a directory) or create a Component called Data and upload to that instead.

@timriffe
Copy link
Author

timriffe commented Aug 11, 2020 via email

@aaronwolen
Copy link
Member

Should be fixed now. Feel free to re-open if you're still having issues.

@timriffe
Copy link
Author

Thank you, yes it seems to work. Just an observation, if I give a vector of files to upload I get this warning from osf_upload()

Warning message:
`...` is not empty.

We detected these problematic arguments:
* `needs_dots`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument? 

When I loop over the files then I do not get that warning.

Anyway, this issue is solved, thanks it's a big help!

@aaronwolen
Copy link
Member

Sounds like a bug. Thanks for reporting!

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

3 participants